SRL Archive - Outdated Tutorials

A Quick lesson on Failsafes!


ronny.m.p

2007-04-14 16:18:33

Hey again srl community, i'm back with another guide. This one is much more important then previous ones when it comes to scripting. This will teach you how to use failsafes in your scripts.

What is a failsafe?

A failsafe is a part of your script that will kick-in at the right time to save your ass from being banned ;)

What kind of failsafes are there?

There are 2 basic forms of failsafes and they are listed below, there are more but these are the most common.

1 : The Counter Failsafe:

This failsafe is used by more begginer scripters but is still used by advanced scripters alike. A counter failsafe does something a certain amount of times then checks for something else. A good example is like this:


var
c : integer; //The counter

begin
repeat
Mouse(1,1,0,0,true);
c := c + 1;
until(c = 3);//will click 3 times
end.

2 : The LoggedIn failsafe:

This is a neccesity for any runescape script. This failsafe will check if you are logged in and will do the appropriate function if you are/arn't. A good example is this:


if (LoggedIn = false) then NextPlayer(false);

Where to put your failsafes:

Put failsafes into all your loops and put a LoggedIn failsafe in the main repeat statement of your main loop.

Credits:

WT Fakawi for showing me about failsafes in one of his scripts.


Feel free to + rep me if you like and post feedback.

-Ronny

lordsaturn

2007-04-14 16:25:13

Good Tut. Thx!

Kinda lacking though…

ronny.m.p

2007-04-14 16:30:22

It's a QUICK lesson. I'm busy so i thought i'd write a quick guide then build a big one later ;)

Stevee

2007-06-29 12:46:16

small, but useful

BobboHobbo

2007-06-29 17:06:23

Ye very smal but its helpful.