SRL Archive - First Scripts

My first unf pots/herb cleaning script


Nufineek

2014-02-14 13:41:38

Hey, I have recently taken interest in scripting and mainly thanks to Mayor's all-in-one guide I made a simple unf pots making and herb cleaning script. Even though I included some antiban and all the clicks are of course random, it got me banned on 2 accounts already. Could you have a look and critize what in the script is still "bot like"? Thanks!
program GEunfPots;

{$DEFINE SMART} // Always have this to load smart
{$I SRL-6/SRL.simba} // To load the SRL include files
{$I SPS/lib/SPS-RS3.Simba} // To load the SPS include files

const
whatToDo = 'Pots';
playerNumb := 5;

var
runsDone: integer;
outOfHerbsCheck: integer;
var
AntiB, MouseB: integer;
procedure declarePlayers();
begin
setLength(players, 0);
with players[0] do
begin
loginName := '';
password := '';
isActive := true;
isMember := true;
end

currentPlayer := playerNumb;
end;


Function Antiban: Boolean;
Var
I: Integer;
Begin
I := Random(600);
Case I Of
1..3:
begin
boredHuman(true);
minimap.clickCompass();
end;
4..31:
Begin
hoverSkill(Skill_crafting);
Wait(GaussRangeInt(1000,2000));
End;
32..70: mouseMovingObject;
71..115: SleepAndMoveMouse(RandomRange(100,MouseB));
116..350:
Begin
MouseOffClient(Random(4));
Wait(RandomRange(2000, MouseB));
End;
501..600: Wait(RandomRange(1000, 2000));

End;
Wait(GaussRangeInt(0, AntiB));
End;


procedure openGEbank;
var
x, y, i, c: integer;
TPA: TPointArray;
ATPA: T2DPointArray;

begin
if (not bankScreen.isOpen()) then
begin
repeat
if (bankScreen.isOpen()) then
exit;
productionScreen.clickStart;
findColorsSpiralTolerance(x, y, TPA, 818592, mainScreen.getBounds(), 13, colorSetting(2, 0.12, 0.83));
ATPA := TPA.toATPA(30, 30);
atpa.sortFromFirstPoint(point(289, 40));
smartImage.debugATPA(ATPA);

if length(TPA) < 1 then
continue;
mouse(287, 82, 5, 30, MOUSE_MOVE);
inc(c);
writeln(intToStr(c));
if isMouseOverText(['anker'], 500) then
begin
fastClick(MOUSE_RIGHT);
wait(100 + random(100));
try
chooseOption.select(['ank']);
wait(800 + random(200));
except
continue;
end;
end else
begin
if (bankScreen.isOpen()) then
exit;
mouse(middleTPA(ATPA[0]), MOUSE_MOVE);
writeln('Something block us from clicking the chest. Clicking the head..');
if isMouseOverText(['anker'], 500) then
begin
fastClick(MOUSE_RIGHT);
wait(100 + random(100));
try
chooseOption.select(['ank']);
wait(random(4000 + random(5000)));
except
continue;
end;
end;

if (c > 3) then
begin
if (bankScreen.isOpen()) then
exit;
writeln('--- Cannot find banker, resetting angle. ---');
minimap.clickCompass();
wait(1000 + random (2000));
end;
end;
until (c = 30);
if c = 30 then
begin
Writeln('Failed to find the banker. Shutting down.');
TerminateScript;
end;
end;
end;

procedure bankDeposit;
var
c: integer;
begin
if not isLoggedIn() then
exit
else
if (bankScreen.isOpen()) then
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
end;

procedure withdrawPots;
begin
if not isLoggedIn() then
exit
if (not bankScreen.isOpen()) then
begin
Writeln('We are not at bank');
openGEbank;
end else
if random(75) > 73 then
begin
writeln('Pretending to looking at another website');
mouseOffClient(OFF_CLIENT_RANDOM);
wait(randomRange(5000, 25000));
end;
try
begin
bankScreen.withdraw(9, 14, ['']); //withraw 14 vials
bankScreen.withdraw(10, -1, ['']); //withraw "all" (the -1) clean herbs //close the bank...
end;
except
bankDeposit;
end;
end;

procedure withdrawCleans;
begin
if not isLoggedIn() then
exit
if (not bankScreen.isOpen()) then
begin
Writeln('We are not at bank');
openGEbank;
end else
if random(75) > 73 then
begin
writeln('Pretending to looking at another website');
mouseOffClient(OFF_CLIENT_RANDOM);
wait(randomRange(5000, 25000));
end;
try
begin
bankScreen.withdraw(8, 28, ['']); //withraw 14 vials //close the bank...
end;
except
bankDeposit;
end;
end;


procedure blueButtom;
var
x, y, i, blueButtonDTM: integer;

begin
if not isLoggedIn() then
exit;
wait(1500 + random(500))
if (productionScreen.isOpen(500)) then
productionScreen.clickStart;
wait(1500 + random(500))
if (productionScreen.isOpen(500)) then
productionScreen.clickStart;

end;


procedure checkForTickets; //checks for Squeal of Fortune tickets and claims them
var
ticketDTM, x, y: integer;
begin
ticketDTM := DTMFromString('mlwAAAHicY2dgYNBlZ2BQAWIrILYGYh0glgdiOSCWZGJgEARiPiBWBmIVKC0BxD1JdkDdTFDMCMUQviQDbsCIB0MBAIV0A4Y=');
if findDTM(ticketDTM, x, y, tabBackPack.getBounds()) then
begin
mouse(x, y, 3, 3, MOUSE_MOVE);
sleep(30+random(64));
fastClick(mouse_left);
end else
Exit;
end;



procedure Pots;
var
vialDTM, x, y, c: integer;
begin
vialDTM := DTMFromString('mwQAAAHic42RgYFjJwsCwAog3AfFaKAbxlwDxAig2ZGJgsAFiCyDWA2JVIJYDYk0gNgJiKyDOKlwINA3IYGCE0phYkoEwYCQCwwEAyS0JgQ==');
if not isLoggedIn() then
exit
else
writeln('Withrawed wrongly ' + IntToStr(outOfHerbsCheck) + ' times');
openGEbank;
bankDeposit;
withdrawPots;
repeat
bankScreen.close();
wait(400 + random(400));
inc(c);
until findDTM(vialDTM, x, y, tabBackPack.getBounds()) or (c =6);
if ( not findDTM(vialDTM, x, y, tabBackPack.getBounds())) then
begin
writeln('--- Could not find Vial of water in your backpack. ---');
exit;
end else
if (tabBackpack.isFull) then
begin
wait(200 + random(200));
if (Random(20) < 6) then
mouse(771, 413, 5, 5, MOUSE_MOVE)
else
mouse(733, 449, 5, 5, MOUSE_MOVE);
wait(50 + random(30));
if isMouseOverText(['lea'], 1000) then
begin
fastClick(MOUSE_LEFT);
wait(200 + random(200));
mouse(729, 416, 5, 5, MOUSE_MOVE);
mouse(729, 416, 5, 5, MOUSE_LEFT);
end else
begin
inc(outOfHerbsCheck);
case outOfHerbsCheck of
1..2:
begin
writeln('--- The second ingredient in your backpack is not clean herb. Trying to bank once again. ---');
exit;
end;

3:
begin
openGEbank;
bankDeposit;
mouse(491, 109, 5, 5, MOUSE_MOVE);
if isMouseOverText(['lea'], 1000) then
begin
exit;
outOfHerbsCheck := 0;
end else
begin
writeln('Out of herbs. There is no clean herb in bank slot 10. Terminating.');
TerminateScript;
end;
end;
end;
end;
blueButtom;
antiban;
tabBackpack.waitSlotPixelChange(14,16000);
tabBackpack.open();
checkForTickets;
if (random(50) > 44) then
wait(randomRange(3000, 10000)) //antiban
else
wait(300 + random(800))
end else
begin
Writeln('You dont have full backpack. Trying again.');
Exit;
end;
end;

procedure Cleaner;
var
vialDTM, x, y, c: integer;
begin
vialDTM := DTMFromString('mwQAAAHic42RgYFjJwsCwAog3AfFaKAbxlwDxAig2ZGJgsAFiCyDWA2JVIJYDYk0gNgJiKyDOKlwINA3IYGCE0phYkoEwYCQCwwEAyS0JgQ==');
if not isLoggedIn() then
exit
else
openGEbank;
bankDeposit;
withdrawCleans;
bankScreen.close();
wait(2000 + random(600));
inc(c);
if (tabBackpack.isFull) then
begin
wait(200 + random(200));
mouse(727, 451, 5, 5, MOUSE_MOVE)
if isMouseOverText(['rimy'], 500) then
begin
fastClick(MOUSE_LEFT);
wait(200 + random(200));
end;
end else
begin
Writeln('You dont have full backpack. Trying again.');
Exit;
end;
end;

// main loop
procedure MainLoop;
begin
clearDebug();
disableSRLDebug := true; // Clear the debug box
smartEnableDrawing := true; // So we can draw on SMART
setupSRL();
MouseSpeed := randomRange(40, 46);
declarePlayers(); // Set up your username/pass
repeat
if not isLoggedIn() then // If player isn't logged in then
begin
players[currentPlayer].login(); // Log them in
wait(4000 + random(3000));
exitSquealOfFortune();
minimap.clickCompass();
tabBackpack.open();
end;
if WhatToDo = 'Pots' then
begin
Pots;
end;
if WhatToDo = 'Cleans' then
begin
Cleaner;
end;

inc(runsDone);
writeln('--------' + (Timerunning) + '--------');
writeln('-------------Made ' + IntToStr(runsDone) + ' runs----------------');
smartImage.clear();
until(false) or (not isLoggedIn());
end;

begin
MainLoop;
end.

flarde

2014-02-15 06:54:53

Sorry for 1st post, i looked only at code ;_;

sdf

2014-02-15 09:24:57

The only thing I really picked up on was your rediculous mouse speed (slow it down, and vary it after each completed loop). If you don't mind me asking, were you goldfarm macro banned or macro majoring banned?

Nufineek

2014-02-15 10:43:11

From: sdf
The only thing I really picked up on was your rediculous mouse speed (slow it down, and vary it after each completed loop). If you don't mind me asking, were you goldfarm macro banned or macro majoring banned?


Macroing goldfarmer. What does it mean to me?

sdf

2014-02-15 11:23:05

From: Nufineek
Goldfarm. What does it mean?


Goldfarm introduces the possibility that it was a targeted activity.

Nufineek

2014-02-15 11:50:48

From: sdf
Goldfarm introduces the possibility that it was a targeted activity.


You mean like pursuant to ip flag or something like that?

Solar

2014-02-15 12:07:59

He means to ask what sort of ban were the accounts given, as stated on the accounts status page of the runescape website? Were they all given the same type of offence, and were they "Macroing Major" or "Macroing Goldfarmer"?

Nufineek

2014-02-15 12:38:59

Yes I answered him - macroing goldfarmer.

flarde

2014-02-15 15:32:09

From: Nufineek
Yes I answered him - macroing goldfarmer.

How many hrs daily did u run it? Did u use powerbot on those accounts? Maybe u were flagged.

Solar

2014-02-15 15:52:36

From: Nufineek
Yes I answered him - macroing goldfarmer.


Sorry. Didn't read that post.

Nufineek

2014-02-15 16:40:25

Never used powerbot on any of them. About 15hrs a day.

Nufineek

2014-02-16 08:18:22

Anybody else has an idea what should I improve/what I got banned for this?

Kyle

2014-02-16 12:22:30

From: Nufineek
Anybody else has an idea what should I improve/what I got banned for this?


I would definitely say that the main reason would be the mouse speed as previously stated. But your anti ban isn't setup how it should be. The way you have it, every time it is called, there is a antiban "procedure" that is called. You also don't call it very often in the script, only at one spot. So here is how I would like to see it:
Function Antiban: Boolean;
Var
I: Integer;
Begin
I := Random(600);
Case I Of
1..3:
begin
boredHuman(true);
minimap.clickCompass();
end;
4..15:
Begin
hoverSkill(Skill_crafting);
Wait(GaussRangeInt(1000,2000));
End;
16..25: mouseMovingObject;
26..39: SleepAndMoveMouse(RandomRange(100,MouseB));
40..64:
Begin
MouseOffClient(Random(4));
Wait(RandomRange(2000, MouseB));
End;
65..80: Wait(RandomRange(1000, 2000));

End;
End;

So now, you want to call this throughout your script, and it will only perform an action when the random number is within the numbers listed in the case. This makes it much more human like. When you try it, if it isn't doing an action often enough, or not enough, just change the number in the random(600) more or less! Also, you have a procedure that has it's own antiban within it, that is redundant and you should just call AntiBan;

Let me know if you didn't understand something or need any help!

Congrats on the script and hope you keep going!

Nufineek

2014-02-16 18:10:57

From: sdf
Goldfarm introduces the possibility that it was a targeted activity.


Got goldfarm ban again on another one fresh account. With mousespeed 20, 25 instead of 40, 46. Do you think it's just the activity or just all the IPs I use have to be flagged?

sdf

2014-02-16 18:58:15

From: Nufineek
Got goldfarm ban again on another one fresh account. With mousespeed 20, 25 instead of 40, 46. Do you think it's just the activity or just all the IPs I use have to be flagged?


There are too many possibilities for us to be certain on why you're being banned. Could be anything from your VPN's all being IP flagged/detecting MAC spoofing/having same MAC addresses/activity targeting.