Etrnl Fear
08-08-2012, 01:39 AM
After deciding to put my main script (a Wood Cutter/Burner) on hold due to being a nooby programmer, I decided to review all the beginner tutorials to freshen up on my statements, usage, techniques, etc. When I was all done and had a more clear understanding of SRL, I thought "Okay, so I'mma test myself by making an antiban feature." I was actually very impressed with myself, seeing as I had very little knowledge of programming in general. Some of you may say "Wow, I can do that in ten minutes." Well you know what? .. :fiery: :P
Anyway.. I came up with an antiban feature that scrolls through your friends list (by looping a click+hold and a wait) with a few custom options:
-Boolean for checking a friend's previous name, if the name-change icon is found
-% chance to break out of the 'scroll down' loop
-% chance to check a random name-change (if the boolean is true, of course)
Here's the snippet:
procedure ScrollFriends(Check: Boolean; BreakChance, CheckChance: Integer);
var
startTab, startMS, a, b, c, xx, yy: Integer;
exists: TPointArray;
d: Boolean;
begin
startTab := GetCurrentTab;
startMS := MouseSpeed;
a := BreakChance;
b := CheckChance;
if (CheckChance > 95) then
begin
Writeln('ScrollFriends: Please don''t use a chance higher than 95, it''ll likely just keep mousing over every name.');
Writeln('ScrollFriends: Setting chance to 95% for now.');
b := 75;
end;
GameTab(tab_Friends);
Wait(RandomRange(500, 1500));
MouseSpeed := 10;
if not (FindColor(xx, yy, 8231332, MIX1, MIY1, MIX2, MIY2)) then
begin
MouseSpeed := startMS;
GameTab(startTab);
Writeln('ScrollFriends: This antiban would be useless on this account, as it has no friends.');
Exit;
end;
if not (Check) then
if (GetColor(728, 473-50) = 526601) then
begin
MMouse(729, 483-50, 2, 2);
GetMousePos(xx, yy);
repeat
HoldMouse(xx, yy, 1);
Wait(RandomRange(250, 750));
ReleaseMouse(xx, yy, 1);
Wait(RandomRange(750, 2250));
Case Random(100) of
0..(a-1):
begin
Break;
end;
end;
Until not (GetColor(728, 473-50) = 526601);
end;
if (GetColor(728, 473-50) = 526601) and (Check) then
begin
MMouse(729, 483-50, 2, 2);
GetMousePos(xx, yy);
repeat
d := False;
HoldMouse(xx, yy, 1);
Wait(RandomRange(250, 750));
ReleaseMouse(xx, yy, 1);
Wait(RandomRange(750, 2100));
Case Random(100) of
0..(b-1):
begin
if FindColor(xx, yy, 9654281, MIX1, MIY1+100, MIX2, MIY2-10) then
begin
FindColorsTolerance(exists, 9654281, MIX1, MIY1+100, MIX2, MIY2-10, 15);
c := Random(GetArrayLength(exists));
MoveMouse(exists[c].x+(RandomRange(20, 50)), exists[c].y);
Wait(RandomRange(2500, 3800));
d := True;
end;
end;
end;
Case Random(100) of
0..(a-1): Break
end;
if (d) then
begin
MMouse(729, 483-50, 2, 2);
GetMousePos(xx, yy);
end;
until (not (GetColor(728, 473-50) = 526601));
end;
FindColors(exists, 3911923, MIX1, MIY1, MIX2, MIY2);
c := Random(GetArrayLength(exists));
MouseSpeed := 15;
DragMouse(exists[c].x, exists[c].y, 1, 1, 706, 273-50, 20, 20);
Wait(RandomRange(250, 500));
MouseSpeed := startMS;
GameTab(startTab);
Exit;
end;
Usage:
ScrollFriends(True/False, BreakChance(%), CheckChance(%));
IE: ScrollFriends(True, 20, 60);
Please feel free to tweak it any way you please. :)
Also, if you have any suggestions for improvement/perfection, do tell!
NOTE: I don't recommend using this, if you have less than 20 friends on the account, since 16 (or 13?) friends is one page.
P.S.
If you'd like a heavily commented version for learning purposes, by all means.. ask. :)
Anyway.. I came up with an antiban feature that scrolls through your friends list (by looping a click+hold and a wait) with a few custom options:
-Boolean for checking a friend's previous name, if the name-change icon is found
-% chance to break out of the 'scroll down' loop
-% chance to check a random name-change (if the boolean is true, of course)
Here's the snippet:
procedure ScrollFriends(Check: Boolean; BreakChance, CheckChance: Integer);
var
startTab, startMS, a, b, c, xx, yy: Integer;
exists: TPointArray;
d: Boolean;
begin
startTab := GetCurrentTab;
startMS := MouseSpeed;
a := BreakChance;
b := CheckChance;
if (CheckChance > 95) then
begin
Writeln('ScrollFriends: Please don''t use a chance higher than 95, it''ll likely just keep mousing over every name.');
Writeln('ScrollFriends: Setting chance to 95% for now.');
b := 75;
end;
GameTab(tab_Friends);
Wait(RandomRange(500, 1500));
MouseSpeed := 10;
if not (FindColor(xx, yy, 8231332, MIX1, MIY1, MIX2, MIY2)) then
begin
MouseSpeed := startMS;
GameTab(startTab);
Writeln('ScrollFriends: This antiban would be useless on this account, as it has no friends.');
Exit;
end;
if not (Check) then
if (GetColor(728, 473-50) = 526601) then
begin
MMouse(729, 483-50, 2, 2);
GetMousePos(xx, yy);
repeat
HoldMouse(xx, yy, 1);
Wait(RandomRange(250, 750));
ReleaseMouse(xx, yy, 1);
Wait(RandomRange(750, 2250));
Case Random(100) of
0..(a-1):
begin
Break;
end;
end;
Until not (GetColor(728, 473-50) = 526601);
end;
if (GetColor(728, 473-50) = 526601) and (Check) then
begin
MMouse(729, 483-50, 2, 2);
GetMousePos(xx, yy);
repeat
d := False;
HoldMouse(xx, yy, 1);
Wait(RandomRange(250, 750));
ReleaseMouse(xx, yy, 1);
Wait(RandomRange(750, 2100));
Case Random(100) of
0..(b-1):
begin
if FindColor(xx, yy, 9654281, MIX1, MIY1+100, MIX2, MIY2-10) then
begin
FindColorsTolerance(exists, 9654281, MIX1, MIY1+100, MIX2, MIY2-10, 15);
c := Random(GetArrayLength(exists));
MoveMouse(exists[c].x+(RandomRange(20, 50)), exists[c].y);
Wait(RandomRange(2500, 3800));
d := True;
end;
end;
end;
Case Random(100) of
0..(a-1): Break
end;
if (d) then
begin
MMouse(729, 483-50, 2, 2);
GetMousePos(xx, yy);
end;
until (not (GetColor(728, 473-50) = 526601));
end;
FindColors(exists, 3911923, MIX1, MIY1, MIX2, MIY2);
c := Random(GetArrayLength(exists));
MouseSpeed := 15;
DragMouse(exists[c].x, exists[c].y, 1, 1, 706, 273-50, 20, 20);
Wait(RandomRange(250, 500));
MouseSpeed := startMS;
GameTab(startTab);
Exit;
end;
Usage:
ScrollFriends(True/False, BreakChance(%), CheckChance(%));
IE: ScrollFriends(True, 20, 60);
Please feel free to tweak it any way you please. :)
Also, if you have any suggestions for improvement/perfection, do tell!
NOTE: I don't recommend using this, if you have less than 20 friends on the account, since 16 (or 13?) friends is one page.
P.S.
If you'd like a heavily commented version for learning purposes, by all means.. ask. :)