PDA

View Full Version : Variable and Save usage



Schultry
03-08-2005, 11:51 AM
Could anyone possible explain to me the use of Variable's and Save in scripts. Would be nice if a example was given with a explaination too.

Thank you!!

Latrinsorm
03-08-2005, 12:24 PM
The only important variables are %c, %s, and %0 through %9.
%c uses the counter commands (counter add, subtract, set #)

counter set 0
start:
waitfor Bobmuhthol
counter add
echo %c
goto start

Counts how many times you see Bobmuhthol.

%s uses the save command, useful for treasure pickup or anything where you do the same thing to different items.

emerald:
save emerald
goto get

diamond:
save diamond
goto get

get:
put get %s
put stow %s

%1 through %9 are stuff you put after the script name in the buffer. Say the script name is kill.

put gird
put stance off
waitfor %1
put kill %1

".kill jerk" would wait for Jerk to walk in the room or do something and kill him. You can use if_1 through if_9 with these if you want to make sure the variable is there before you do stuff to it. This is only really important if you have "save %1" in there and you don't have a %1. Then the Wizard crashes.

Schultry
03-08-2005, 12:46 PM
Is there any complete documentation on the available commands for scripting?

Latrinsorm
03-08-2005, 02:09 PM
http://forum.gsplayers.com/viewthread.php?tid=382

Jonty
03-08-2005, 07:18 PM
http://www.play.net/playdotnet/play/stormfront_scripting.asp