SRL Archive - OSR Help

Banned! I could use some suggestions so it doesn't happen again.


L3g3nd4ryH4ck3r

2014-07-30 13:12:48

Hi guys!
I just started playing around with Simba two days ago, and made my own Bow String spinning bot. Now, maybe this was a bit too ambitious for a first project, but I made a new account to test it on, so I wasn't really concerned if it got banned. Anyways, I wake up this morning to find it has indeed been banned, after spinning ~14,000 bow strings and getting to around 56 crafting. As I said, no big loss, but I am interested to know what got me banned. I know people say that Jagex monitors freshly made accounts more, don't know if that's what got me… More than anything, I'd just like some suggestions on my code so that I can improve it and learn some things for future projects. Yeah, I know, it's pretty crappy/buggy, and I'm sure I have overcomplicated some pieces of it just because I didn't know the function/command to do what I was trying to do. So if you'd like to leave some coding suggestions, I'll leave my code down below and you can tell me how crappy it is yourself ;)

EDIT: I'm thinking it could be something to do with the finding of the door. findObjCustom() makes the mouse behave in a very non human way for this situation, as there are a lot of objects almost identical to the color of the top of the door visible by the spinning wheel.


program BowStringSpinner;
{$DEFINE SMART}
{$i SRL-OSR/SRL.simba}

//A crappy code by L3g3nd4ryH4ck3r
//I don't advise you to use this, as I got banned from using it...

{
*****************************************************************************************************************
IMPORTANT: Start next to the South stairs on the top floor of the Lumbridge castle with a full inventory of Flax!
*****************************************************************************************************************
}

Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ''; // ***Username***
Players[0].Pass := ''; // ***PW***
Players[0].WorldInfo := []; // ***Desired World, leave blank if random***
Players[0].Nick := ''; // ***Portion of display name, IMPORTANT FOR RANDOMS***
Players[0].LampSkill := Skill_Crafting;
Players[0].Active := True;
End;

procedure climbDownStairs();
var
Stairs,x,y: integer;
begin
writeln('Going downstairs');
Stairs:=DTMFromString('mbQAAAHicY2VgYHgMxKyMDAxfGBD4KhBfhtJ3gfg8EBvLMYOxrYkBg76eJoOJgRYDK0gvGmbEgsEAADKrCm8=');
FindDTM(Stairs,x,y,MSX1,MSY1,MSX2,MSY2);
MMouse(x+16,y+10,5,5);
wait(50);
MMouse(x+16,y+10,5,5);
FreeDTM(Stairs);
wait(RandomRange(379,580));
GetMousePos(x,y);
HoldMouse(x,y,1);
wait(RandomRange(29,77));
ReleaseMouse(x,y,1);
end;

procedure goToDoor();
var
x,y: integer;
begin
MMouse(270,21,10,10);
wait(RandomRange(40,900));
MMouse(270,21,10,10);
GetMousePos(x,y);
wait(RandomRange(37,250));
HoldMouse(x,y,1);
wait(RandomRange(29,77));
ReleaseMouse(x,y,1);
wait(RandomRange(975,1250));
end;

Function openDoor(): Boolean;
var
x,y : Integer;
begin
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
If findObjCustom(x, y, ['Open Door'], [1191244], 5) then
begin
Wait(randomRange(100, 250));
clickMouse2(Mouse_Left);
result := didRedclick;

if result then
begin
Writeln('Opened the door.');
Wait(RandomRange(3000, 4000));
end;
end;

case result of
False: Writeln('Door is open already.');
end;
end;

procedure clickWheel();
var
wheel,x,y: integer;
begin
writeln('Starting crafting');
wheel:=DTMFromString('mWAAAAHicY2FgYPBiZGDwBWI3KH0JKHYbiK8B8XUQfeECQ6IVK4OvLhNDoAErAxdQDBkzomEQAAD3fAjR');
wait(RandomRange(1082,1397));
PickupMouse();
FindDTM(wheel,x,y,MSX1,MSY1,MSX2,MSY2);
MMouse(x,y,1,1);
wait(100);
FreeDTM(wheel);
GetMousePos(x,y);
HoldMouse(x,y,1);
wait(RandomRange(29,77));
ReleaseMouse(x,y,1);
PickupMouse();
wait(RandomRange(1097,1780));
end;

procedure craftString();
var
craftScreen,x,y: integer;
begin
craftScreen := DTMFromString('mggAAAHicY2NgYKgG4iogbgRiFkYGhhogZgLidCA/F4rzgTgHiKcD8a1Lpxge3brIsHvjaobJTREMszpjGBj+MTBwMWDHjDgwBAAA6WUP+w==');
FindDTM(craftScreen,x,y,MSX1,MSY1,MSX2,MSY2);
FreeDTM(craftScreen);
if(x=0) then
begin
writeln('Uh oh! We''re not crafting yet. Let''s try again...');
openDoor();
clickWheel();
craftString();
end else
begin
MMouse(270,110,10,10);
GetMousePos(x,y);
HoldMouse(x,y,0);
wait(RandomRange(29,77));
ReleaseMouse(x,y,0);
wait(RandomRange(209,678));
MMouse(x-15,y+68,20,5);
wait(RandomRange(209,678));
GetMousePos(x,y);
HoldMouse(x,y,1);
wait(RandomRange(29,77));
ReleaseMouse(x,y,1);
PickupMouse();
wait(RandomRange(809,1078));
KeyDown(57);
wait(RandomRange(1607,1998));
KeyUp(57);
wait(RandomRange(507,698));
PickupMouse();
TypeByte(VK_ENTER);
end;
end;

procedure checkCraftingXP();
var
x,y: integer;
begin
HoverSkill('Crafting',false);
wait(RandomRange(1209,2306));
MMouse(640,190,20,20);
wait(RandomRange(245,760));
GetMousePos(x,y);
HoldMouse(x,y,1);
wait(RandomRange(29,77));
ReleaseMouse(x,y,1);
end;

procedure idle();
var
LevelDTM,x,y: integer;
begin
if FindNormalRandoms() then //If we just found a random, get back to crafting...
begin
clickWheel();
craftString();
end;
LevelDTM := DTMFromString('mbQAAAHicY2VgYPAB4gAgDgNiNyD2AuIqRgaGOiBuAuJ2IG4GYk9nRwZfNzcGdwd7BmtlJjDmAqpFx4xYMBgAABbuB3Q=');
FindDTM(LevelDTM, x,y, MCX1, MCY1, MCX2, MCY2);
FreeDTM(LevelDTM);
if(x>0) then
begin
clickWheel();
craftString();
end;
if(RandomRange(1,15)=5) then
checkCraftingXP();
wait(RandomRange(987,5049));
if(RandomRange(1,15)=14) then
BoredHuman();
SetAngle(SRL_ANGLE_HIGH);
MakeCompass('N');
end;

procedure waitForStrings();
var
x,y: integer;
begin
while not(SimilarColors(4152681,GetColor(715,450),10)) do
idle();
end;

procedure goToLadder();
var
ladderDTM,x,y: integer;
NullT2DEA: T2DExtendedArray;
LadderPoints: TPointArray;
begin
writeln('Going to stairs');
ladderDTM:=DTMFromString('mggAAAHicY2NgYBBmZGCQAmIhIOYGYkkoLgPKVQNxLRCXA3EOECcDcbSdPAMyiAsNAWMRBlTABcWMODAEAADwjQYx');
FindDTMsRotatedSE(ladderDTM, LadderPoints, MMX1, 60, MMX2, MMY2, -20.0, 20.0, 1.0, NullT2DEA);
MMouse(LadderPoints[0].x,LadderPoints[0].y+10,5,5);
FreeDTM(ladderDTM);
GetMousePos(x,y);
HoldMouse(x,y,1);
wait(RandomRange(49,97));
ReleaseMouse(x,y,1);
wait(RandomRange(6720,8560));
end;

procedure climbStairs();
var
stairs,x,y: integer;
begin
writeln('Going upstairs');
stairs:=DTMFromString('mWAAAAHicY2FgYHgGxF+B+AYQvwTiu1D8BIi9GRkYjOWZGSxNDBhMDLQY4lMEGLiA4siYEQ2DAAA+xAkK');
FindDTM(stairs,x,y,MSX1,MSY1,262,MSY2);
MMouse(x,y+10,5,5);
wait(RandomRange(900,1450));
FreeDTM(stairs);
if(RandomRange(1,4)=2) then
begin
GetMousePos(x,y);
HoldMouse(x,y,1);
wait(RandomRange(49,97));
ReleaseMouse(x,y,1);
wait(RandomRange(300,690));
PickupMouse();
MMouse(300+RandomRange(-30,20),400,0,4);
GetMousePos(x,y);
HoldMouse(x,y,1);
wait(RandomRange(49,97));
ReleaseMouse(x,y,1);
wait(RandomRange(300,690));
end else
begin
GetMousePos(x,y);
HoldMouse(x,y,0);
wait(RandomRange(49,97));
ReleaseMouse(x,y,0);
MMouse(x+RandomRange(-30,30),y+40,0,0);
GetMousePos(x,y);
wait(RandomRange(200,346));
HoldMouse(x,y,1);
wait(RandomRange(49,97));
ReleaseMouse(x,y,1);
end;
end;

procedure goToBank();
var
bankIcon,x,y: integer;
begin
writeln('Going to bank');
wait(RandomRange(300,690));
bankIcon:=DTMFromString('mQwAAAHicY2ZgYHBhZGBwBmJXIG4H8puhmIGBkeHfP2EwZgXyuKCYEQkDAQABwwab');
FindDTM(bankIcon,x,y,MMX1,MMY1,MMX2,MMY2);
FreeDTM(bankIcon);
MMouse(x,y+10,2,2);
wait(RandomRange(200,346));
GetMousePos(x,y);
HoldMouse(x,y,1);
wait(RandomRange(49,97));
ReleaseMouse(x,y,1);
wait(RandomRange(5000,6500));
end;

procedure bank();
var
bankBooth,bankAll,x,y: integer;
begin
writeln('Banking');
bankBooth := DTMFromString('mQwAAAHicY2ZgYHBlZGDwA2I7II4F8uOguK4onKEkN5EhKyWSgQvIh2FGJAwEAOaSBcI=');
FindDTM(bankBooth,x,y,MSX1,MSY1,MSX2,MSY2);
FreeDTM(bankBooth);
MMouse(x+10,y,2,2);
GetMousePos(x,y);
wait(RandomRange(200,346));
HoldMouse(x,y,1);
wait(RandomRange(49,97));
ReleaseMouse(x,y,1);

wait(RandomRange(5940,7150));
bankAll := DTMFromString('mbQAAAHicY2VgYNjPyMBwHIg3AfE+KLaAYhsgtgNiIyB2UuJm4OXhZnC448pQ7CzF0OQry8AK1I+OGbFgMAAAj7gIrg==');
FindDTM(bankAll,x,y,MSX1,MSY1,MSX2,MSY2);
FreeDTM(bankAll);
MMouse(x,y,2,2);
wait(RandomRange(200,346));
HoldMouse(x,y,1);
wait(RandomRange(49,97));
ReleaseMouse(x,y,1);
wait(randomRange(523,780));
end;

procedure withdrawFlax();
var
flax,x,y: integer;
begin
flax:=DTMFromString('mggAAAHicY2NgYNgGxHuB+AAQbwLizUC8BogvAvFpIL4CxNeB+AwQnwdiBlVmBqdN2xlsFi6Hs+1XrmfgAkphw4w4MAQAAHaHEDA=');
FindDTM(flax,x,y,MSX1,MSY1,MSX2,MSY2);
MMouse(x,y,5,5);
wait(RandomRange(345,673));
HoldMouse(x,y,0);
wait(RandomRange(49,97));
ReleaseMouse(x,y,0);
wait(randomRange(523,780));
MMouse(x+RandomRange(-30,30),y+85,0,2);
GetMousePos(x,y);
HoldMouse(x,y,1);
wait(RandomRange(49,97));
ReleaseMouse(x,y,1);
wait(randomRange(523,780));
end;

begin
DeclarePlayers();
SetupSRL();
setupRandomTool(10000, 5, 'C:/Simba/Sounds/alert.wav');
MouseSpeed:=7;
while (1=1) do
begin
SetAngle(SRL_ANGLE_HIGH);
MakeCompass('N');
climbDownStairs();
wait(530+RandomRange(50,900));
goToDoor();
wait(3200+RandomRange(53,96));
openDoor();
clickWheel();
wait(RandomRange(1097,1780));
craftString();
wait(RandomRange(967,1690));
waitForStrings();
openDoor();
goToLadder();
climbStairs();
wait(RandomRange(1097,1780));
goToBank();
bank();
withdrawFlax();
goToLadder();
end;
end.

Thanks in advance,
L3g3nd4ryH4ck3r

Not sure if this should go here or in the "Banned from RS" forum. If it's in the wrong place, feel free to move it…

Unfold

2014-07-30 14:04:53

Your script seems to do the same over and over again with no fail safes.

In addition, there are no randomizing in any of your mouse movement. The max you've randomized was 1, 1 which is 1 on the x axis and 1 of the y axis. you're clicking on the exact same place where the DTM is.

You should also add an antiban. which moves the mouse randomly and take breaks in your script.

L3g3nd4ryH4ck3r

2014-07-30 14:14:41

From: Unfold
Your script seems to do the same over and over again with no fail safes.

In addition, there are no randomizing in any of your mouse movement. The max you've randomized was 1, 1 which is 1 on the x axis and 1 of the y axis. you're clicking on the exact same place where the DTM is.

You should also add an antiban. which moves the mouse randomly and take breaks in your script.

Thanks for the fast reply/feedback! I did add a bit of antiban in the idle() procedure, namely checking Crafting XP and the BoredHuman() procedure, but I guess this was not enough. The problem as far as mouse movement randomization is that some of the clicks had to be pretty precise or there was a risk of not clicking the object.

Unfold

2014-07-30 14:30:54

From: L3g3nd4ryH4ck3r
Thanks for the fast reply/feedback! I did add a bit of antiban in the idle() procedure, namely checking Crafting XP and the BoredHuman() procedure, but I guess this was not enough. The problem as far as mouse movement randomization is that some of the clicks had to be pretty precise or there was a risk of not clicking the object.


Yup that's why there are fail safes.
Here i'll give you a few tips.
-> Free your DTM's on when you terminate your script otherwise there will be a lot of memory leaks. https://villavu.com/forum/showthread.php?t=78418

-> Try to use color, using ACA.exe (there are a lot of advance color tutorials in the tut section)

-> You can use reflection to make your script amazing

-> Use al_functions.simba, much better mouse movement.

Harrier

2014-07-30 14:58:11

I would assume you got banned because you'll of gotten stuck in a random or tele'd by a random and there is no fail safes in your script for it.

L3g3nd4ryH4ck3r

2014-08-03 15:18:51

I know it's been a few days, but thanks for the feedback. I think part of the reason I got banned was simply the fact that bow string spinning is a highly botted activity? Anyways, I have made a new script to do with woodcutting, and have been running it for a few days now. No ban yet! I'll probably release it on the forums shortly, after tweaking it some more…