Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Dumb String Array Question (https://forums.graalonline.com/forums/showthread.php?t=30707)

zallus-k 06-03-2002 04:47 AM

Dumb String Array Question
 
NPC Code:

function destroyBoxes() {
if(strtofloat(#I(clientr.boxes,0))>=1 && mousedown && leftmousebutton && !noclose) {
for(this.i=1;this.i<=strtofloat(#I(clientr.boxes,0 ));this.i++) {
if(mousescreenx in |strtofloat(#I(clientr.boxes,this.i*2-1))+189,strtofloat(#I(clientr.boxes,this.i*2-1))+198| && mousescreeny in |strtofloat(#I(clientr.boxes,this.i*2))+3,strtoflo at(#I(clientr.boxes,this.i*2))+16|) {
set noclose;
deletestring clientr.boxes,strtofloat(#I(clientr.boxes,this.i*2-1));
deletestring clientr.boxes,strtofloat(#I(clientr.boxes,this.i*2-1));
replacestring clientr.boxes,0,#v(strtofloat(#I(clientr.boxes,0))-1);
unset noclose;
}
}
}
}



Can anyone suggest what this code needs, besides cleaning up? Currently, it'll only work (to delete a box object) if there is something at the x,y coordinates specified, and even then it'll only delete the end box. Anyone have an idea? Also, the strings are a necessity, as the script is multi-level.

zallus-k 06-03-2002 05:49 AM

It's not incorporated yet, but there's also a third part to it, a string message to go into the box... I guess that could be seperated... ahh, n/m. I'll fix it up and try it.

Ohh. Umm... whoops. I forgot, the boxes also need to be remembered when the user logs off, so that cancels out that idea.


All times are GMT +2. The time now is 08:22 AM.

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