Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-13-2006, 06:10 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Tokenize option to return delims

I've definitely touched on this in a lot of other threads, but the tokenize function should have the ability to return specified delimiters.
There are several functions that it can serve.
Let's say you have a staff chat command.
Let's say you wanted to be able to have the staff do multiple commands in one event call?
ASSUMING:
this.commandtoken = "/"; //(would be returned by tokenize())
player.chat == "/heal/heal jake13jake";


player.chat.tokenize("/");
//let's assume the "/" was returned as a delim.
for (i=0;i<tokens.size();i+=2) {
if (tokens[i] == "/") {
parsecommands(tokens[i+1]);
}
}
pos() only finds the first one
starts() only finds the first one
unless you want to cycle through and find all of the places it says /, it really defeats the purpose of tokenize.

The amount of functionality this would add is only limited to the extent of the scripter's imagination.
Reply With Quote
 


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 09:50 PM.


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