n3ss3s
2007-08-01 11:24:01
AntiRandoms
You've got a fresh working script?
It does all you've ever dreamed of?
W-W-W-W00t you aut0z0er!!!1!111!
But, then you face problem… A damn random event comes and happens?
You feel like raping that sandwich lady?
Eating that frog?
Heres the answer for your problems…
AntiRandoms :O
In this tutorial I will teach you how to use SRL antirandoms in your scripts.
Lets start with a "empty" script which has only Program new, begin and end and SRL included.
You only need to include SRL/SRL.scar because SRL.scar contains the other includes in SRL, so you DONT have to include the antirandoms like
Now, we can use them, but how?
Lets start to put some things in our template.
and FindNormalRandoms to check for randoms.
SRL has the solve for most of the randoms, but some randoms like ScapeRune, Surpise Exam and so on are still unsolved.
FindNormalRandoms loggs out if any of those unsolvable randoms appear.
The reason why we have SetupPlayers there is that when a random appears, SRL antirandoms set your current players location to the random.
for example
But, ofcourse you can avoid that by using
try - except technique which I wont be explaining now, Ill make a tut for that lol.
SetupPlayers calls a procedure from PlayerForm.scar which displays a form, where you can set your players. Nothing hard, just empty text boxes to type your username and pass and so on in.
When to call an AntiRandom procedure?
Ofcourse you cannot just call your Antirandom procedure just once or all the time. You need to find a right place for it.
for example:
That example would not work since any of those arent real procedures or functions.
But, if they were, and that piece of code would be in some script, it would be repeating doing an antirandoms procedures until not mining a rock. Simple, isnt it?
An antirandoms procedure is for example:
Happy and safe autoing!
p.s: Rate 1..5
You've got a fresh working script?
It does all you've ever dreamed of?
W-W-W-W00t you aut0z0er!!!1!111!
But, then you face problem… A damn random event comes and happens?
You feel like raping that sandwich lady?
Eating that frog?
Heres the answer for your problems…
AntiRandoms :O
In this tutorial I will teach you how to use SRL antirandoms in your scripts.
Lets start with a "empty" script which has only Program new, begin and end and SRL included.
Program new;
{.include SRL/SRL.scar}
begin
SetupSRL;
end.
You only need to include SRL/SRL.scar because SRL.scar contains the other includes in SRL, so you DONT have to include the antirandoms like
{.include SRL/SRL/Core/Antirandoms.scar}Now, we can use them, but how?
Lets start to put some things in our template.
Program new;
{.include SRL/SRL.scar}
{.include SRL/SRL/Misc/PlayerForm.scar}
begin
SetupSRL; // Includes the srl include :D
SetupPlayers;
ActivateClient; // This "activates" the client.
FindNormalRandoms; // Solves the randoms.
end.
There we have activate client to "activate" our runescapeand FindNormalRandoms to check for randoms.
SRL has the solve for most of the randoms, but some randoms like ScapeRune, Surpise Exam and so on are still unsolved.
FindNormalRandoms loggs out if any of those unsolvable randoms appear.
The reason why we have SetupPlayers there is that when a random appears, SRL antirandoms set your current players location to the random.
for example
Players[CurrentPlayer].loc := 'No GameTab';If we havent set our players, the script will stop because of:[Runtime Error] : Out Of Range in line (the error line) in scriptSo the script'd stop there.But, ofcourse you can avoid that by using
try - except technique which I wont be explaining now, Ill make a tut for that lol.
SetupPlayers calls a procedure from PlayerForm.scar which displays a form, where you can set your players. Nothing hard, just empty text boxes to type your username and pass and so on in.
When to call an AntiRandom procedure?
Ofcourse you cannot just call your Antirandom procedure just once or all the time. You need to find a right place for it.
for example:
repeat
MyAntiRandomsProcedure;
until(not(MiningARock));
That example would not work since any of those arent real procedures or functions.
But, if they were, and that piece of code would be in some script, it would be repeating doing an antirandoms procedures until not mining a rock. Simple, isnt it?
An antirandoms procedure is for example:
procedure MyAntiRandomsProcedure;
begin
FindNormalRandoms;
SolveBox;
end;
SolveBox checks if a new box has appeared to your inventory, and if has, solves the box.Happy and safe autoing!
p.s: Rate 1..5