Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-08-2002, 01:07 AM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
tokenize3

there should be a tokenize3 command that tokenizes without tokenizing with spaces.


ie: tokenize3 |,bob|went to the|market;

token1=bob
token2=went to the
token3=market
Reply With Quote
  #2  
Old 08-08-2002, 04:33 AM
jeff335 jeff335 is offline
Registered User
Join Date: Oct 2001
Posts: 605
jeff335 is on a distinguished road
Er, future improvements?



But it sounds good.
__________________

Quote:
Some people like standing around talking to idiots in the real world, and some don't. Neither choice is inherently better than the other.

-Kaimetsu
Reply With Quote
  #3  
Old 08-09-2002, 12:14 AM
zorakid2001 zorakid2001 is offline
Banned
Join Date: Jul 2002
Location: Oregon USA <-- this place sux0rs
Posts: 113
zorakid2001 is on a distinguished road
Send a message via ICQ to zorakid2001 Send a message via AIM to zorakid2001
WTF?? i dont understand
Reply With Quote
  #4  
Old 08-09-2002, 12:14 AM
zorakid2001 zorakid2001 is offline
Banned
Join Date: Jul 2002
Location: Oregon USA <-- this place sux0rs
Posts: 113
zorakid2001 is on a distinguished road
Send a message via ICQ to zorakid2001 Send a message via AIM to zorakid2001
oh now i do sorry for being a retard
Reply With Quote
  #5  
Old 08-09-2002, 12:33 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
you could just have the string be like "bob" "went to" "the market"
0 - bob
1 - went to
2 - the market
Reply With Quote
  #6  
Old 08-09-2002, 04:27 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
Except tokenize "bob" "went to" "the market" returns
"bob"
"went
to"
"the
market"
is his point
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #7  
Old 08-09-2002, 04:37 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by Tyhm
Except tokenize "bob" "went to" "the market" returns
"bob"
"went
to"
"the
market"
is his point
Last I checked when you tokened something in quotes, it took everything inside the quotes as 1 token, I'll check again just to make sure later =/
Reply With Quote
  #8  
Old 08-09-2002, 05:59 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
Quote:
Originally posted by Python523

Last I checked when you tokened something in quotes, it took everything inside the quotes as 1 token, I'll check again just to make sure later =/
I think so too.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #9  
Old 08-09-2002, 02:51 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
eek

i have this script



if (actionserverside) {
with (getplayer(#p(0))) {
setstring client.test,#p(1);
}
}
//#CLIENTSIDE
if (playerchats && startswith(-,#c)) {
triggeractoin 0,0,serverside,test,"#a,#e(1,-1,#c)";
}

then when i parse the string, it messes up if you have a " within your message

Xx

i dont know why i posted that Xx


i would like to see tokenize3
__________________
[signature]insert here[/signature]
Reply With Quote
  #10  
Old 08-10-2002, 10:12 PM
MysticHasteP2P_2 MysticHasteP2P_2 is offline
Registered User
Join Date: Jun 2002
Location: Down under
Posts: 137
MysticHasteP2P_2 is on a distinguished road
Anything within " & " Is a token so:

Bob "went to the" market
tokens being
1-bob
2-went to the
3-market
__________________
MysticHaste/Dlaiyre Rain
Reply With Quote
  #11  
Old 08-11-2002, 11:07 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
why not use tokenize2?

tokenize2 delims,str; - divides str into tokens, using 'delims' as additional delimiters

example:
tokenize2 $,Bob$went to the$market;

that will return a token for each one
#t(0) = Bob
#t(1) = went to the
#t(2) = market

Why add tokenize3 that does the samething as tokenize2? Delims, as indicated from the commands.rtf is the delimiter you want the command to use to seperate each word in the string. If you make delims blank then yes, each space in str will be the cutoff point each time it occurs.
__________________
Reply With Quote
  #12  
Old 08-11-2002, 10:42 PM
mikepg mikepg is offline
Registered User
Join Date: Nov 2001
Location: VA, USA
Posts: 501
mikepg is on a distinguished road
Send a message via AIM to mikepg Send a message via Yahoo to mikepg
Quote:
Originally posted by G_yoshi
why not use tokenize2?

tokenize2 delims,str; - divides str into tokens, using 'delims' as additional delimiters

example:
tokenize2 $,Bob$went to the$market;

that will return a token for each one
#t(0) = Bob
#t(1) = went to the
#t(2) = market

Why add tokenize3 that does the samething as tokenize2? Delims, as indicated from the commands.rtf is the delimiter you want the command to use to seperate each word in the string. If you make delims blank then yes, each space in str will be the cutoff point each time it occurs.
Nope, tokenize2 always has spaces and commas as default delims. so tokenize2 $,Bob$went to the$market;
would come out
0: Bob
1: went
2: to
3: the
4: market

Tokenize 3 might be useful...but you can easily get around the spaces with quotes....i use them all the time, for things like the on screen radio, it used wraptext, everything was just quoted though. It should work fine.
__________________
~War Lord Mpg2
Bravo Online's Asst. Staff Manager

"Sittin by the tree, sippin eggnog, waitin on christmas gifts"
Reply With Quote
  #13  
Old 08-11-2002, 11:29 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally posted by mikepg


Nope, tokenize2 always has spaces and commas as default delims. so tokenize2 $,Bob$went to the$market;
would come out
0: Bob
1: went
2: to
3: the
4: market

Tokenize 3 might be useful...but you can easily get around the spaces with quotes....i use them all the time, for things like the on screen radio, it used wraptext, everything was just quoted though. It should work fine.
you specify 'delims' as the delimiter, did you not read the command description?

divides str into tokens, using 'delims' as additional `delimiters
__________________
Reply With Quote
  #14  
Old 08-12-2002, 12:06 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
Quote:
Originally posted by G_yoshi


you specify 'delims' as the delimiter, did you not read the command description?

divides str into tokens, using 'delims' as additional `delimiters
Case rested.
__________________

subliminal message: 1+1=3
Reply With Quote
  #15  
Old 08-12-2002, 11:58 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally posted by Falcor


Case rested.
Eh?

I just fail to see the reason to duplicate an existing command. If it fails to work properly, then post it in the bugs forum Maybe Stefan will go back and make sure it works for the next release
__________________
Reply With Quote
  #16  
Old 08-12-2002, 12:10 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Quote:
Originally posted by G_yoshi


Eh?

I just fail to see the reason to duplicate an existing command. If it fails to work properly, then post it in the bugs forum Maybe Stefan will go back and make sure it works for the next release
tokenize2 +,bob+went to+have+sex;
#t(0)=bob
#t(1)=went
#t(2)=to
#t(3)=have
#t(4)=sex

MY way
tokenize3 +,bob+went to+have+sex;
#t(0)=bob
#t(1)=went to
#t(2)=have
#t(3)=sex

tokenize3 wouldnt do the ADDITIONAL delimeters it would just simply use new delimeters and remove all old forms.

no spaces etc...
Reply With Quote
  #17  
Old 08-12-2002, 12:13 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Quote:
Originally posted by Python523

Last I checked when you tokened something in quotes, it took everything inside the quotes as 1 token, I'll check again just to make sure later =/

no..
go on my server and type "/me test,test,test

only test will show up

and somewhere along the line, a line of only test will show up.

it uses #I()

which is same as tokenize2 without using command
Reply With Quote
  #18  
Old 08-12-2002, 12:14 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally posted by Warcaptain


tokenize2 +,bob+went to+have+sex;
#t(0)=bob
#t(1)=went
#t(2)=to
#t(3)=have
#t(4)=sex

MY way
tokenize3 +,bob+went to+have+sex;
#t(0)=bob
#t(1)=went to
#t(2)=have
#t(3)=sex

tokenize3 wouldnt do the ADDITIONAL delimeters it would just simply use new delimeters and remove all old forms.

no spaces etc...
Again, you've ignored what I said. If tokenize2 is not working right then report it! Don't be stupid by requesting a new command that is just a complete duplicate of an existing command.
__________________
Reply With Quote
  #19  
Old 08-12-2002, 12:17 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally posted by Warcaptain



no..
go on my server and type "/me test,test,test

only test will show up

and somewhere along the line, a line of only test will show up.

it uses #I()

which is same as tokenize2 without using command
#I() is for string arrays string arrays != tokenize2 :x
__________________
Reply With Quote
  #20  
Old 08-12-2002, 12:19 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Quote:
Originally posted by G_yoshi


#I() is for string arrays string arrays != tokenize2 :x

but its the same as if you did:

tokenize2 ,,#s(stringname);

[which is what i did untill i found out about #I()]
Reply With Quote
  #21  
Old 08-12-2002, 12:21 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally posted by Warcaptain



but its the same as if you did:

tokenize2 ,,#s(stringname);

[which is what i did untill i found out about #I()]
Still, if tokenize2 is not working then why have you not reported it? Use your head
__________________
Reply With Quote
  #22  
Old 08-12-2002, 12:30 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Quote:
Originally posted by G_yoshi


Still, if tokenize2 is not working then why have you not reported it? Use your head

tokenize2 is working....

its dividing things up into delims of spaces and also
NPC Code:

// NPC made by Warcaptain -Leader- (Abaddon)
if (created||timeout) {
setstring test,bob,had,sex today;
tokenize2 ,,#s(test);
for (i=0;i<tokenscount;i++; ){
showimg i,@Kristen ITC@c@Token #v(tokenscount-1-i): #t(tokenscount-1-i),playerx+1.5,playery-(i*1);
changeimgvis i,2;
showimg i+tokenscount,@Kristen ITC@c@Token #v(tokenscount-1-i): #t(tokenscount-1-i),playerx+1.5+.1,playery-(i*1)+.1;
changeimgcolors i+tokenscount,0,0,1,0;
changeimgvis i+tokenscount,1;
}
timeout=0.05;
}



try that out mister muster
Reply With Quote
  #23  
Old 08-12-2002, 12:32 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally posted by Warcaptain



tokenize2 is working....

its dividing things up into delims of spaces and also
NPC Code:

// NPC made by Warcaptain -Leader- (Abaddon)
if (created||timeout) {
setstring test,bob,had,sex today;
tokenize2 ,,#s(test);
for (i=0;i<tokenscount;i++{
showimg i,@Kristen ITC@c@Token #v(tokenscount-1-i): #t(tokenscount-1-i),playerx+1.5,playery-(i*1);
changeimgvis i,2;
showimg i+tokenscount,@Kristen ITC@c@Token #v(tokenscount-1-i): #t(tokenscount-1-i),playerx+1.5+.1,playery-(i*1)+.1;
changeimgcolors i+tokenscount,0,0,1,0;
changeimgvis i+tokenscount,1;
}
timeout=0.05;
}



try that out mister muster
*sigh* -_-

Get off your lazy ass and report it if its not working like it is supposed to!
__________________
Reply With Quote
  #24  
Old 08-12-2002, 12:53 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Now please, stop your complaining. I've done for you what you should've done when you first encountered the problem Next time, please think through all your options first. The last thing needed is a duplicate command
__________________
Reply With Quote
  #25  
Old 08-12-2002, 12:54 PM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
obviously you arent listening....

it IS working fine.

but i want a command that doesnt use spaces at all when tokenizing.

so you dont do "s around the token to use spaces
Reply With Quote
  #26  
Old 08-25-2002, 12:13 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
Argit. There isn't MUCH point to this... x.X If you feel it is necessary to do this, just use arrays!
setstring client.text,;
addstring client.text,bob;
addstring client.text,went to;
addstring client.text,the market;
That way you get the following:
client.text[0]=bob
client.text[1]=went to
client.text[2]=the market
Simple as that... there isn't a MAJOR purpose for your explanation of tokenize3 either... there are ways around it.
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #27  
Old 08-25-2002, 03:05 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
uhm, Variables can't hold characters. Atleast not in Gscript. I think you have a warped understanding of Graal string arrays.
__________________

subliminal message: 1+1=3
Reply With Quote
  #28  
Old 08-25-2002, 03:28 AM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Quote:
Originally posted by Falcor
uhm, Variables can't hold characters. Atleast not in Gscript. I think you have a warped understanding of Graal string arrays.
client.text[0]=int; for numerical arrays is the equivilant of
insertstring client.text,0,alphabetical;
i know i use it alot on enigma for msgsystem
Reply With Quote
  #29  
Old 08-26-2002, 01:03 AM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
LoL GYoshi, you look like a big ass.

tokenize2 does what it is supposed to. He wants a tokenize3 that does not use " " and "," as delimiters. tokenize2 does, but it is supposed to.

But like explained earlier, if you did

string as: Bob "went to the" market

and used tokenize2, it would come out as

token1: Bob
token2: went to the
token3: market

So that is what you wanted, wasn't it?
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #30  
Old 08-27-2002, 11:00 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Quote:
Originally posted by konidias
LoL GYoshi, you look like a big ass.

tokenize2 does what it is supposed to. He wants a tokenize3 that does not use " " and "," as delimiters. tokenize2 does, but it is supposed to.

But like explained earlier, if you did

string as: Bob "went to the" market

and used tokenize2, it would come out as

token1: Bob
token2: went to the
token3: market

So that is what you wanted, wasn't it?
Sorry...but this thread is a little stale, btw...I saw my error long ago
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:01 PM.


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