SRL Archive - Help and Support

Using the Player Array.


WT-Fakawi

2006-02-16 18:45:33

Some guidelines for the Player Array.

1. Break out of every loop! This might seem not important, but it actually is the most important rule of SRL-scripting. Break out of every loop! SRL is entirely based around that philosophy. Why? Because if your program loops somewhere, it stops because the client logs you out, or worse, you find you have been moving around with the mouse for six hours clicking on nothing. So I usually do
if not LoggedIn then Break;
which is the easy way out. Or I use timers to break out of loops. SetMark(Mark) and TimeFromMark(Mark) do that trick well..

2. If you are not logged in…then you call
NextPlayer[Boolean]
True if the player has done its task well and is standing safely @ the bank, or False if our Player is lost. I place this line at the end of the script.

3. There is no 3. Thats all.

Check out for more info the SRL Template.scar inside SRL/scripts/