SRL Archive - OSR Help

Antiban Procedure


SlothScripts

2012-04-14 17:54:02

Hello everyone,

I hope this is the right section; if not someone let me know so I can have it moved or if a mod is reading this, that would be awesome!

Now before I get to my concern, I'd like to start off by saying that I am a novice scripter when it comes to Simba. These are just my observations, not meant to be spoken as though there is any more merit here than simple inquiry. I figured it was worth a post!

As a bot user in the past, and a present day scripter - even if you have only read tutorials - it is more than evident that the difference between a good script and a poor one is the scripts ability not to get you banned. Though there is much that goes into it, I'd like to specifically address one concern; the main Antiban procedure. What I mean by this is a frequently called procedure (or function) which has the sole purpose of performing random antiban procedures.

The clear reason for this is to make the bot appear more human, less bot-like. They will do things like, move the mouse around, mess with the camera angle, hover over the skill you are training, etc. In principle there is nothing wrong here. However, in terms of actual functionality it has come to my attention that perhaps the common way to do this is, less than ideal.

For sake of my example, I will be taking the antiban procedure used by Coh3n in this tutorial (http://villavu.com/forum/showthread.php?t=58935 check it out, it is excellent!)
procedure Antiban;
begin
case Random(60) of // Random(60) generates a random integer from 0 to 59
10: RandomRClick;
20: HoverSkill('Mining', False);
30: PickUpMouse;
40: RandomMovement;
50: BoredHuman;
59: ExamineInv;
end;
end;
I have looked through a few scripts around the forums and this is generally how the procedures look; catered to the direct needs on occasion.

My concern stems from the math of the situation. This procedure generates a number, 0 through to 59 and if it is one of six it will perform a task. This gives the same probability that the user will hover their skill as it does that they will move their mouse randomly. This clearly isn't the case; as humans there are some tasks which you will perform with higher frequencies than others. It would take a very strong argument to convince me that anyone examines items in their inventory as frequently as they say, move their mouse around or adjust their camera angle.

I went through the list quickly and ranked these six tasks in order that I perform them personally (frequency wise) for sake of example:

1. Random Movement.
2. Border Human.
3. RandomRClick.
4. Pick Up Mouse.
5. Hover Skill.
6. Examine Inventory

I then decided to create a check, which instead of merely being based on number generation; is based on frequency. My original code was something like this:
program AntibanMathTest;

var
x: Integer;

procedure Antiban;
var
i: Integer;
begin

i := Random(1000);
if (i > 99) and (i <= 1000) and (i mod 2 = 0) then
Writeln('RandomMovement [Most Common].')
else if(i <= 500) and (i mod 3 = 0) then
Writeln('BoredHuman [Second Most Common].')
else if(i <= 99) and (i mod 2 = 0) then
Writeln('RandomRClick [Third Most Common].')
else if(i > 99) and (i <= 500) and (i mod 5 = 0) then
Writeln('PickUpMouse [Fourth Most Common].')
else if i = 1 then
Writeln('HoverSkill [Fifth Most Common].')
else if i = 7 then
Writeln('ExamineInv [Fifth Most Common Also].')
else
Writeln('No Antiban');
end;



begin
repeat
Antiban;
until(false);
end.

Now, on paper, in 1000 tests, this would result in:

Case 1: 450 Times
Case 2: 100 Times
Case 3: 34 Times
Case 4: 14 Times
Case 5: 1 Time
Case 6: 1 Time

The actual results for 5532 tests were:

Case 1: 2533
Case 2: 579
Case 3: 168
Case 4: 145
Case 5: 3
Case 6: 5
None: 2102

Realizing that this still occurred with too much frequency, I changed the random number to 10,000; but capped all the number checks off at 1000. I then ran the loop 7200 times; this would simulate running it every 500ms for an hour.

program AntibanMathTest;

var
x: Integer;

procedure Antiban;
var
i: Integer;
begin

i := Random(10000);
if (i > 99) and (i <= 1000) and (i mod 2 = 0) then
Writeln('RandomMovement [Most Common].')
else if(i <= 500) and (i mod 3 = 0) then
Writeln('BoredHuman [Second Most Common].')
else if(i <= 99) and (i mod 2 = 0) then
Writeln('PickUpMouse [Fourth Most Common].*Should be third')
else if(i > 99) and (i <= 500) and (i mod 5 = 0) then
Writeln('RandomRClick [Third Most Common].*Should be fourth')
else if i = 7 then
Writeln('HoverSkill [Fifth Most Common].*Should not Occur')
else if i = 1 then
Writeln('ExamineInv [Fifth Most Common Also].')
else
Writeln('No Antiban')
end;



begin
for x := 1 to 7200 do
Antiban;
end.

It resulted in:

None: 6771
Case 1: 297 - Once every 12 Seconds
Case 2: 77 - Once every 47 Seconds
Case 3: 31 - Once every ~2 Minutes
Case 4: 22 - Once every ~3 Minutes
Case 5: 2 - Once every 30 Minutes
Case 6: 2 - Once every 30 Minutes

Now please note that some of my math may be off, it was rushed out quickly without the use of a calculator; however, the trial results are all done correctly.

The question that I am posing is; why run a basic, generic procedure when one can create a much more realistic one based on number frequency? Now my function clearly is not perfect, it would require touch-ups, and catering to specific needs (for instance, if you are power training a skill your focus all together will be higher, thus less antiban.)

I apologize in advance for the wall of a thread; but it is mainly codes and trial results.

Any input on this is lovely! Do people use Antiban procedures which take into account more than just randomness? Why or why not?

begginer

2012-04-14 17:56:03

Holy Crap, looks fabulous.

ShawnjohnSJ

2012-04-14 17:57:14

I believe his antiban procedure was just to get your feet wet into antiban, if you want your script more human-like, that's on you.

BraK

2012-04-14 18:04:14

That set of antibans have been around forever many people have created new antibans that generally are hidden around the forums people add these to there script and set the scripts up how they feel the timings should be on them but that a good observation. ;)

I think those are the same antiban we've had since like 2007ish with modifications for updates and compatibility.

Abu

2012-04-14 18:06:06

That's why I like to do:

procedure Antiban;
begin
case Random(20) of // Random(20) generates a random integer from 0 to 20
0: RandomRClick;
1: RandomRClick;
2: HoverSkill('Mining', False);
3: RandomRClick;
4: PickUpMouse;
5: RandomRClick;
6: RandomMovement;
7: RandomRClick;
8: BoredHuman;
9: RandomRClick;
10: ExamineInv;
end;
end;

It repeats a random right click much more often na dalso performs antibans more frequently :)

SlothScripts

2012-04-14 18:16:43

From: ShawnjohnSJ
I believe his antiban procedure was just to get your feet wet into antiban, if you want your script more human-like, that's on you.


That's what I had figured, but reading the scripts (in the area I can see mind you), I see many people using a very similar thing.
To clarify, this wasn't meant as a criticism either; his tutorial helped me loads and loads; I was just curious whether that antiban was standard or not!

From: BraK
That set of antibans have been around forever many people have created new antibans that generally are hidden around the forums people add these to there script and set the scripts up how they feel the timings should be on them but that a good observation. ;)

I think those are the same antiban we've had since like 2007ish with modifications for updates and compatibility.


Well that's a relief! I am glad that it has been my lack of findings rather than a lack of actual content!

From: abu_jwka
That's why I like to do:

procedure Antiban;
begin
case Random(20) of // Random(20) generates a random integer from 0 to 20
0: RandomRClick;
1: RandomRClick;
2: HoverSkill('Mining', False);
3: RandomRClick;
4: PickUpMouse;
5: RandomRClick;
6: RandomMovement;
7: RandomRClick;
8: BoredHuman;
9: RandomRClick;
10: ExamineInv;
end;
end;

It repeats a random right click much more often na dalso performs antibans more frequently :)


Exactly. Even something as simple as allowing for the extra cases is what I had in mind; well, it was a clarifying thought for me! Glad to hear that people are making antibans more human-like so-to-speak!

ShawnjohnSJ

2012-04-14 18:42:56

From: SlothScripts
That's what I had figured, but reading the scripts (in the area I can see mind you), I see many people using a very similar thing.
To clarify, this wasn't meant as a criticism either; his tutorial helped me loads and loads; I was just curious whether that antiban was standard or not!



Well that's a relief! I am glad that it has been my lack of findings rather than a lack of actual content!



Exactly. Even something as simple as allowing for the extra cases is what I had in mind; well, it was a clarifying thought for me! Glad to hear that people are making antibans more human-like so-to-speak!


Well I wouldn't say anti ban has a standard because there are so many ways to do it. You should make it realistic as possible, but not everyone focuses on that (in my opinion, a good deal of time writing a script should focus on anti ban).

By the way, you should be able to write case statements with dashes between numbers to tell it "any number between" for example:


program CaseTest;
var
aInt : Integer;
begin
aInt := 153;
case aInt of
100..300: begin
Writeln('aInt is between 100 and 300');
end;
end;
end.

*fixed*

masterBB

2012-04-14 18:50:43

From: abu_jwka
That's why I like to do:


fixed`

procedure Antiban;
begin
case Random(20) of // Random(20) generates a random integer from 0 to 20
0..5: RandomRClick;
6: HoverSkill('Mining', False);
7: PickUpMouse;
8: RandomMovement;
9: BoredHuman;
10: ExamineInv;
end;
end;

Also, if you want to have a very natural antiban you should look into math gauss. Let it be based on that line.

ShawnjohnSJ

2012-04-14 18:54:59

Ahh, masterBB got it right. You do ".." not "-".

SlothScripts

2012-04-14 19:00:38

Knowing the case shorthand just simplified a procedure quite a bit.

Decide on the ratio you'd like; to make it most human and just pick number based around that!

Definitely acquiring new ideas for how to make it work best!

Thanks!

Joe

2012-04-14 20:55:41

I always just do 3 skill checks, random right click, and examin inventory. I personally hate compass antiban as it takes forever to do the swirly movements.