SRL Archive - OSR Outdated Tutorials

How to make an AntiBan procedure!


Bionicle

2009-09-13 19:47:30

'Ello and welcome to my second tut!

In this tut I'm going to show you how to make antiban procedures. AntiBan's are a necessity for scripts. They keep your character from looking like what it is, a bot. They simulate human behavior so people don't get suspicions. The reason I'm making this tut is because there are very few of these out there, and when i was new to scar this was my main problem in wrighting scripts.

SRL AntiBan's

before i teach you how to set up antiban procedures, I'm going to show you all of the different ones, and how to make your own. Here is all of the SRL antibans (you can find all of these in the file 'Includes\srl\SRL\core\AntiBan'):

1: RandomRClick; What this one does is randomly right clicks anywhere on the runescape window.
2: HoverSkill(Skill: String; Click: Boolean); You have to specify the skill, and when you do, it goes to the skill game tab and literally hovers over the skill.
3: PickUpMouse; This one simulates you picking up your mouse.
4: SayCurrentLevels(which: String); You have to specify the skill, and when you do, it says your level in that skill in public chat.
5: RandomMovement; This ones pretty self explanatory :p
6: BoredHuman; Simulates a bored human :D
7: ExamineInv; This goes to your inventory game tab and examines items in your inventory.
8: RandomAngle(HowToEnd : Variant); This changes the angle of the compass and finishes depending on the HowToEnd. Can be either 1, 'up', True = Highest angle or 2, 'down', False = Lowest angle.
9: LevelUp; This one checks to see if you leveled up, and clicks continue if you did.

There you have it, those are the 9 basic SRL AntiBans.

How To Make Your Own AntiBans

I can't really teach you how to do this, this is just something you have to figure out, but what i can do is give you some examples:

1:
begin
Gametab(21+Random(16));
Wait(1000 + Random(2000));
Gametab(Tab_inv);
end;

What this one will do is pick a random tab (e.g. magic tab, prayer tab, skill tab etc.) wait a little, and go back to the inventory tab.

2:
begin
case random(6) of
0: TypeSend('Ugh this is borin :P');
1: TypeSend('Wc lvl?');
2: TypeSend('ello');
3: begin
TypeSend('rofl :D');
Wait(400 + random(100));
TypeSend('oops ment to be in clan :P');
end;
4: TypeSend('Woodcuttin lvl?');
5: TypeSend('Booooringgg');
end;
This one just randomly types one of those and sends them into the public chat.

How To Set Up AntiBan Procedures

Now I'm going to teach you how to set up AntiBan procedures. This is my favorite way of doing it:

procedure AntiBan;
begin
case random(50) of
0: RandomRClick;
1: HoverSkill('Woodcutting', False);
2: RandomMovement;
3: BoredHuman;
4: PickUpMouse;
end;
end;

The Random(50) means that it will randomly pick a number between 0 and 50 and does the specified action. You want your script to do an antiban about one in every 10 times. Because i have 5 cases, random(50) is perfect.

Here's another example:

procedure AntiBan;
begin
case random(500) of
0...10: RandomRClick;
100...110: HoverSkill('Fishing', False);
200...210: RandomMovement;
300...310: BoredHuman;
400...410: PickUpMouse;
end;
end;

The 0…10 in this example means that that case is number 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10 at the same time. So if random(500) picks a number between one and ten, it will do the RandomRClick case.

Incorperating Your AntiBans Into the AntiBan Procedure

This is simple, and like the old saying, a picture is worth 1000 words, ill just give you the picture ;)

procedure AntiBan;
begin
case random(700) of
0..10: RandomRClick;
100..110: HoverSkill('Woodcutting', False);
200..210: begin
Gametab(21+Random(16));
Wait(1000 + Random(2000));
Gametab(Tab_inv);
end;
300..310: RandomMovement;
400..410: begin
case random(6) of
0: TypeSend('Ugh this is borin :P');
1: TypeSend('Wc lvl?');
2: TypeSend('ello');
3: begin
TypeSend('rofl :D');
Wait(400 + random(100));
TypeSend('oops ment to be in clan :P');
end;
4: TypeSend('Woodcuttin lvl?');
5: TypeSend('Booooringgg');
end;
500..510: BoredHuman;
600..610: PickUpMouse;
end;
end;

There you have it, now you can make your AntiBan procedures :D thanks for reading, if you want to know how to make a certain antiban, just leave a comment of what you want it to do and i'll try to make one for you. Thanks R1ch for adding and correcting a few things in this script ;) Any questions, comments or corrections, please leave a comment below. :p and if you like my tut, use the blue check mark at the top corner of this box ;)!

Rich

2009-09-13 19:55:45

Two more functions have been added to Antiban.scar:

{*******************************************************************************
procedure RandomAngle(HowToEnd : Variant);
By: R1ch
Description: Randomly changes the angle of the compass. Finishes depending on
HowToEnd:
1, 'up', True = Highest angle
2, 'down', False = Lowest angle
Put '' to leave it as it is.
*******************************************************************************}

procedure RandomAngle(HowToEnd : Variant);
var
Key : Byte;
B : Boolean;

begin
B:= RBoolEx(2);
if B then
Key:= 38
else
Key:= 40;
SetAngle(B);
Wait(RandomRange(500, 1000));
KeyDown(Key);
Wait(RandomRange(500, 1100));
KeyUp(Key);
Wait(RandomRange(500, 1000));
case (HowToEnd) of
1, 'up', True : SetAngle(True);
2, 'down', False : SetAngle(False);
end;
end;

{*******************************************************************************
function LevelUp : Boolean;
By: R1ch
Description: Checks if you've leveled up - click Continue and returns True.
*******************************************************************************}

function LevelUp : Boolean;
var
X, Y : Integer;

begin
if (not(FindColor(X, Y, 0, 7, 460, 69, 474))) then
Result:= FindNPCChatText('gratu', Nothing);
if Result then
begin
while ClickContinue(True, True) do
Wait(50 + Random(50));
WriteLn(Players[CurrentPlayer].Name + ' leveled up');
end;

This:

    0: GameTab(1);
Wait(400 + random(200));
GameTab(5);
1: GameTab(2);
Wait(400 + random(200));
GameTab(5);
2: GameTab(3);
Wait(400 + random(200));
GameTab(5);
3: GameTab(4);
Wait(400 + random(200));
GameTab(5);
4: GameTab(6);
Wait(400 + random(200));
GameTab(5);
5: GameTab(7);
Wait(400 + random(200));
GameTab(5);
6: GameTab(8);
Wait(400 + random(200));
GameTab(5);

Won't work. For each of them, it needs to be:

0: begin
GameTab(1);
Wait(400 + random(200));
end;

Also, your Waits there are too short. I suggest just doing:

begin
GameTab(Random(13));
Wait(1000 + Random(2000));
GameTab(Tab_inv);
end;

Richard.

Bionicle

2009-09-13 20:09:15

From: R1ch
Two more functions have been added to Antiban.scar:

{*******************************************************************************
procedure RandomAngle(HowToEnd : Variant);
By: R1ch
Description: Randomly changes the angle of the compass. Finishes depending on
HowToEnd:
1, 'up', True = Highest angle
2, 'down', False = Lowest angle
Put '' to leave it as it is.
*******************************************************************************}

procedure RandomAngle(HowToEnd : Variant);
var
Key : Byte;
B : Boolean;

begin
B:= RBoolEx(2);
if B then
Key:= 38
else
Key:= 40;
SetAngle(B);
Wait(RandomRange(500, 1000));
KeyDown(Key);
Wait(RandomRange(500, 1100));
KeyUp(Key);
Wait(RandomRange(500, 1000));
case (HowToEnd) of
1, 'up', True : SetAngle(True);
2, 'down', False : SetAngle(False);
end;
end;

{*******************************************************************************
function LevelUp : Boolean;
By: R1ch
Description: Checks if you've leveled up - click Continue and returns True.
*******************************************************************************}

function LevelUp : Boolean;
var
X, Y : Integer;

begin
if (not(FindColor(X, Y, 0, 7, 460, 69, 474))) then
Result:= FindNPCChatText('gratu', Nothing);
if Result then
begin
while ClickContinue(True, True) do
Wait(50 + Random(50));
WriteLn(Players[CurrentPlayer].Name + ' leveled up');
end;

This:

    0: GameTab(1);
Wait(400 + random(200));
GameTab(5);
1: GameTab(2);
Wait(400 + random(200));
GameTab(5);
2: GameTab(3);
Wait(400 + random(200));
GameTab(5);
3: GameTab(4);
Wait(400 + random(200));
GameTab(5);
4: GameTab(6);
Wait(400 + random(200));
GameTab(5);
5: GameTab(7);
Wait(400 + random(200));
GameTab(5);
6: GameTab(8);
Wait(400 + random(200));
GameTab(5);

Won't work. For each of them, it needs to be:

0: begin
GameTab(1);
Wait(400 + random(200));
end;

Also, your Waits there are too short. I suggest just doing:

begin
GameTab(Random(13));
Wait(1000 + Random(2000));
GameTab(Tab_inv);
end;

Richard.


k, ill add them into my tut, my computer is downloading updates, so i haven't downloaded SRL #38 yet. (would be way to laggy to do anything :p)

and the gametab antiban, thanks ill fix it up :)

~bionicle~

Baked0420

2009-09-13 20:36:11

From: R1ch


begin
GameTab(Random(13));
Wait(1000 + Random(2000));
GameTab(Tab_inv);
end;

Richard.


Look in GameTab.Scar, you will see the Tabs constants aren't 0-12 (random(13)) they are from 21 to 37 skipping 29. So it would be GameTab(21+random(17)); since it'll pick a random number from 0-16, and 21+16 is the highest, although I think 37 is the logout button, and not many people do that when they really play I don't think, so I'd do GameTab(21+random(16));.

Rich

2009-09-13 21:43:18

From: Baked0420
Look in GameTab.Scar, you will see the Tabs constants aren't 0-12 (random(13)) they are from 21 to 37 skipping 29. So it would be GameTab(21+random(17)); since it'll pick a random number from 0-16, and 21+16 is the highest, although I think 37 is the logout button, and not many people do that when they really play I don't think, so I'd do GameTab(21+random(16));.


My bad. Sorry :o

Also,

    400...410: begin
case random(6) of
0: TypeSend('Ugh this is borin :P');
1: TypeSend('Wc lvl?');
2: TypeSend('ello');
3: TypeSend('rofl :D');
Wait(400 + random(100));
TypeSend('oops ment to be in clan :P');
4: TypeSend('Woodcuttin lvl?');
5: TypeSend('Booooringgg');
end;

Should be:

    400...410: begin
case random(6) of
0: TypeSend('Ugh this is borin :P');
1: TypeSend('Wc lvl?');
2: TypeSend('ello');
3: TypeSend('rofl :D');
Wait(400 + random(100));
TypeSend('oops ment to be in clan :P');
4: TypeSend('Woodcuttin lvl?');
5: TypeSend('Booooringgg');
end;
end;

Each begin needs an end and so does each case, hence the second end.

Richard.

ABC.def.GHI

2009-09-13 21:45:32

3: TypeSend('rofl :D');
Wait(400 + random(100));
TypeSend('oops ment to be in clan :P');


3: begin
TypeSend('rofl :D');
Wait(400 + random(100));
TypeSend('oops ment to be in clan :P');
end;


400...410


400..410

(It has to have '..' for all of them instead of '…')

marpis

2009-09-13 22:40:58

You should use gamtab constants
GameTab(tab_Inv)
GameTab(tab_Equip)
GameTab(tab_Stats)
etc.

Smarter Child

2009-09-14 01:21:21

You can do:

//Smarter Child
Function RandomTab: boolean;
begin
Result := GameTab(RandomRange(1, 15)); //replace 15 with highest gametab number, idk the numbers by heart :p
end;

Also, their is another method you could use, such as:

Procedure Antiban;
begin
Case Random(5) of
1,2: RandomRClick;
end;
end;

Good luck~