![]() |
Tokenize
OK I'm a fairly decent scripter but not super good at it, but I'm trying to learn and I have no idea what tokenize does or is used for, can someone give me a simple example of what it does and like a basic NPC that uses it, ANYTHING.
|
Re: Tokenize
Certainly.
Tokenizing a string separates it into units called tokens. For example: if a playerchats and says: warpto 30 30 onlinestartlocal.graal #t(1) would be the first 30 #t(2) would be the second 30 #t(3) would be onlinestartlocal.graal [ Tokens are called by using the form #t(ID) ] An example of this is: NPC Code:if (playerchats) { That is a small example of Tokenizing. |
Also...
Tokenize breaks up a string into sections, or tokens. Take this string for example:
Tokenize this string for me If you call tokenize with this string, it would create: #t(0)=tokenize #t(1)=this #t(2)=string #t(3)=for #t(4)=me There are some exceptions: Tokenize "this string" for me When tokenized: #t(0)=tokenize #t(1)=this string #t(2)=for #t(3)=me You can see that everything inbetween parenthesis are taken as 1 token. There you go. |
Well thanx alot you've helped out a bunch.
|
All times are GMT +2. The time now is 07:43 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.