PDA

View Full Version : ScrollFriends (antiban option)



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. :)

Flight
08-08-2012, 01:54 AM
That's pretty cool bud, nice job. :)

Nebula
08-08-2012, 01:56 AM
An antiban function like this would be nice to have.... But I see lots of things that could be improved on before it would be added to the SRL include. But yeah great work!

E: Sorry didn't realize this was snippets.

litoris
08-08-2012, 02:09 AM
You should probably add a check for the scroll bar before attempting a scroll.

Footy
08-08-2012, 02:14 AM
You should probably add a check for the scroll bar before attempting a scroll.

This, I have 4 friends on my bottling main!

Etrnl Fear
08-08-2012, 03:06 AM
@Flight
Thanks dude. :)

@Nebula
Anything in particular that you think should be improved or changed?

@litoris and Footy

(GetColor(728, 473-50) = 526601) The color is black, and the point is the area at the very bottom of the scrolling space. ;)
But yeah, I see where you're coming from. I thought about maybe adding functionality for just checking a friend's previous name, if found, but I figured that would be best as a separate function altogether, since this one is so long. Plus, if none of the friends have a name change icon, you'd be better off using just a plain ol' GameTab(tab_Friends); then a Wait(RandomRange(xxxx, xxxx)); afterward. For now, that's why I added "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."

But I'll definitely update this tomorrow; I've gatta get some sleep now. But, it won't take any more than just a simple copy/paste of "if not (GetColor(728, 473-50) = 526601) then" followed by "if (Check) then" :P

Nebula
08-08-2012, 03:12 AM
Well for starters these aren't needed since you could just use Breakchance/Checkchance throughout the script instead of a/b
a := BreakChance;
b := CheckChance;

I don't really want to go into deep detail about every little thing that can be changed. What you have now (probably) works fine, there are just ways to condense it more. As you learn more, you can improve on it.

Silentcore
08-08-2012, 03:52 AM
Haha, this is my personal antiban method i do when i check my bots.