Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Text Parser (https://forums.graalonline.com/forums/showthread.php?t=73857)

Deadly_Killer 05-08-2007 04:20 AM

PHP Code:

function onCreated()
{
  
temp.txt "Hello <variable>player.account</variable>. How are you doing on this fine day?";
  
  
this.parseText(temp.txt);
}

function 
parseText(buf)
{
  
temp.tok buf.tokenize(" ");
  
temp.hld temp.tok;
  
  for (
temp.0temp.temp.tok.size(); temp.I++)
  {
    
temp.var = temp.tok[temp.I];
    
    if (
temp.var.starts("<variable>"))
    {
      
temp.str temp.var.substring(10temp.var.pos("</variable>") - 10);
      
      
temp.hld[temp.I] = makevar(temp.str);
    }
  }
  
  for (
temp.var : temp.hldtemp.@= temp.var @ " ";
  
  return 
temp.r;


I made something real quick.

cbk1994 05-08-2007 04:51 AM

Quote:

Originally Posted by Deadly_Killer (Post 1306231)
PHP Code:

function onCreated()
{
  
temp.txt "Hello <variable>player.account</variable>. How are you doing on this fine day?";
  
  
this.parseText(temp.txt);
}

function 
parseText(buf)
{
  
temp.tok buf.tokenize(" ");
  
temp.hld temp.tok;
  
  for (
temp.0temp.temp.tok.size(); temp.I++)
  {
    
temp.var = temp.tok[temp.I];
    
    if (
temp.var.starts("<variable>"))
    {
      
temp.str temp.var.substring(10temp.var.pos("</variable>") - 10);
      
      
temp.hld[temp.I] = makevar(temp.str);
    }
  }
  
  for (
temp.var : temp.hldtemp.@= temp.var @ " ";
  
  return 
temp.r;


I made something real quick.

eww makevar.

Deadly_Killer 05-08-2007 07:02 AM

Quote:

Originally Posted by cbkbud (Post 1306235)
eww makevar.

A) makevar is good.
B) Please don't get me started... especially for someone who abuses his space bar badly.

Oh, and if you didn't know.. you used it in your OWN SCRIPT as well.

Inverness 05-08-2007 08:40 AM

Quote:

Originally Posted by Deadly_Killer (Post 1306254)
Oh, and if you didn't know.. you used it in your OWN SCRIPT as well.

Classic example of being owned.
However, his script is a case where it is necessary.

Deadly_Killer 05-08-2007 01:12 PM

Quote:

Originally Posted by Inverness (Post 1306259)
Classic example of being owned.
However, his script is a case where it is necessary.

I used makevar once, and the same way he used it.

And i always use makevar anyway, it is a lot better then lolz@(osldol @ "lolz");

cbk1994 05-08-2007 01:49 PM

Quote:

Originally Posted by Deadly_Killer (Post 1306254)
A) makevar is good.
B) Please don't get me started... especially for someone who abuses his space bar badly.

Oh, and if you didn't know.. you used it in your OWN SCRIPT as well.

Please try not to be an ass when posting in my thread. If you don't want to help, by all means don't!

makevar() is untidy, it is much better in most cases to use var.( @ "lol" ); Skyld will probably be on to rave about that soon anyway.

Second, we have all already had a discussion about formatting of code. If you did not listen to any of it, that is not a problem of mine. I made a post, called Clean Coding: Common Sense which would explain to you exactly why I format the way I do. I did not rave about your code, because I realize that you have your own way of coding. Please do not try to tell me that the way I use spaces is wrong. There is nothing wrong with what I do. All it does is make it easier for me to read, and for the fellow scripters on servers I work on (any scripters I have worked with have all complimented on my formatting).

Please stay out of this thread if you do not wish to contribute something helpful.

Chompy 05-08-2007 02:45 PM

Quote:

Originally Posted by cbkbud (Post 1306271)
Please try not to be an ass when posting in my thread. If you don't want to help, by all means don't!

makevar() is untidy, it is much better in most cases to use var.( @ "lol" ); Skyld will probably be on to rave about that soon anyway.

Second, we have all already had a discussion about formatting of code. If you did not listen to any of it, that is not a problem of mine. I made a post, called Clean Coding: Common Sense which would explain to you exactly why I format the way I do. I did not rave about your code, because I realize that you have your own way of coding. Please do not try to tell me that the way I use spaces is wrong. There is nothing wrong with what I do. All it does is make it easier for me to read, and for the fellow scripters on servers I work on (any scripters I have worked with have all complimented on my formatting).

Please stay out of this thread if you do not wish to contribute something helpful.

Explain how makevar() is untidy..
It's way easier to locate makevars then a bunch of () and @ etc..

I don't see why you think makevar() is untidy...

Btw;

use of obj.positions() would be more effective then obj.pos() if you ask me..

Deadly_Killer 05-08-2007 11:06 PM

Quote:

Originally Posted by cbkbud (Post 1306271)
Please try not to be an ass when posting in my thread. If you don't want to help, by all means don't!

makevar() is untidy, it is much better in most cases to use var.( @ "lol" ); Skyld will probably be on to rave about that soon anyway.

Second, we have all already had a discussion about formatting of code. If you did not listen to any of it, that is not a problem of mine. I made a post, called Clean Coding: Common Sense which would explain to you exactly why I format the way I do. I did not rave about your code, because I realize that you have your own way of coding. Please do not try to tell me that the way I use spaces is wrong. There is nothing wrong with what I do. All it does is make it easier for me to read, and for the fellow scripters on servers I work on (any scripters I have worked with have all complimented on my formatting).

Please stay out of this thread if you do not wish to contribute something helpful.

Why do you try to provoke a fight? You even called something ugly that you used in your OWN script.

They can compliment it because they lack being able to script, any scripter will tell you that your script is a mess. Besides, please stop being jealous that I created a 20-30 line script to do what your 150-200 line script does and faster.

Refer to below about makevar:

Quote:

Originally Posted by Chompy (Post 1306282)
Explain how makevar() is untidy..
It's way easier to locate makevars then a bunch of () and @ etc..

I don't see why you think makevar() is untidy...


cbk1994 05-08-2007 11:57 PM

Quote:

Originally Posted by Deadly_Killer (Post 1306375)
Why do you try to provoke a fight? You even called something ugly that you used in your OWN script.

They can compliment it because they lack being able to script, any scripter will tell you that your script is a mess. Besides, please stop being jealous that I created a 20-30 line script to do what your 150-200 line script does and faster.

Refer to below about makevar:

Please refrain from posting in my threads if this is how you are going to act.

Deadly_Killer 05-09-2007 03:07 AM

Quote:

Originally Posted by cbkbud (Post 1306397)
Please refrain from posting in my threads if this is how you are going to act.

Do you not understand that I was only contributing when you attempted to attack me?

You should most likely refrain yourself from posting -period- if this is how you are going to act.

Rapidwolve 05-09-2007 03:09 AM

I'd prefer using:
PHP Code:

this.(@ obj) = value

Rather then using:
PHP Code:

makevar("this." obj) = value

I just think its a matter of scripting preference.

Deadly_Killer 05-09-2007 03:14 AM

Quote:

Originally Posted by Rapidwolve (Post 1306457)
I'd prefer using:
PHP Code:

this.(@ obj) = value

Rather then using:
PHP Code:

makevar("this." obj) = value

I just think its a matter of scripting preference.

This isn't about that at all. He attacked me for using makevar, and when I attacked him back he went all pissy on me... and all I did was try to contribute something that works pretty much the same way but uses tags.

cbk1994 05-09-2007 03:50 AM

Okay, let's just stop this fight. It obviously started with a misunderstanding on both sides, so let's just stop it now.

Rapidwolve 05-09-2007 03:59 AM

Quote:

Originally Posted by cbkbud (Post 1306474)
Okay, let's just stop this fight. It obviously started with a misunderstanding on both sides, so let's just stop it now.

Way to go :).


All times are GMT +2. The time now is 12:26 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.