Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   #e (https://forums.graalonline.com/forums/showthread.php?t=3084)

_Shoey_Fighter_ 05-17-2001 09:46 PM

#e
 
OK, here is what I want to do. Let's say I have a string that looks like this: "test test1 test2 test3", and can be added to simply by chatting (so basically it is a dynamic string). Because I can add to it, I would also like to remove. I know that #e is what I should do for it, but I am having trouble with it. Here is what I have so far:

//#t(1) in this case is equal to the string that wants to be extracted
setstring this.temp,#t(1);
//this is where we have "test test1 etc"
tokenize mystring;
this.fine=0;
this.temp2=0;
/*this for loops supposed to add a strings length+1(for spaces) to this.temp2 until it gets to the string that wants to be removed, where it stops adding. But, it no worky.*/
for(i=0;i<tokenscount;i++){
if(strcontains(this.temp,#t(i))){this.fine=1}
if(this.fine==0){this.temp2+=1+strlen(#t(i));}
}
//this actually set the string at the end
setstring mystring,#e(this.temp2,strlen(#s(this.temp)),#s(se rver.playerhouse1allowed));


Probably pretty confusing to look at, but I thought I might as well ask ;)


All times are GMT +2. The time now is 07:25 AM.

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