SRL Archive - First Scripts

Randoms WillowChopper


Randoms

2012-06-12 17:31:30

Version 2.0 : Fixed mass clicking

:redface: So anyways guys, first day here at SRL, still learning to script. I did make a basic script and I want to see how it is. Would really appreciate it if someone tests it out and proggies.
99% of the credits goes to Griff for his thread about how to make a simple rs script tree. I modified it to cut willow trees and improved (i think) the antiban so it should at least function. As I said, this is my first day here so don't expect this script to be a miracle!
Version 2.0:
program Randoms_WillowChopper;
{$DEFINE SMART}
{$i srl/srl.simba}

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

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;

procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;
case Random(100) of
0:
begin
HoverSkill('Woodcutting', false);
wait(2453+Random(432));
end;
1: BoredHuman;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
FindNormalRandoms;
end;
end;
end;
function IsWoodcutting: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 250, 500) > 750);
end;

procedure ChopTree;
var x, y: integer;
begin
repeat
FindNormalRandoms;
While IsWoodcutting Do Wait(200+Random(50));
if FindObj(x, y, 'hop', 2239532, 40) then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
end;
repeat
wait(400+random(250));
AntiBan;
Until not IsUpText('ew') or (InvFull);
until(InvFull);
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
ChopTree;
end.
Bugs that I know of:
-Mass clicking on Willow trees. Anyone know a fix for this?

(s)okkr7

2012-06-12 18:10:37

Do a Procedure for pixel shift to fix the spam clicking. Something like..

function IsWoodcutting: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 250, 500) > 750);
end;


then before "Procedure ChopTree"

Put this:

While IsWoodcutting Do Wait(200+Random(50));

Basically what I just said is here: http://villavu.com/forum/archive/index.php/t-82977.html

Randoms

2012-06-12 18:43:45

From: Sokkr7
Do a Procedure for pixel shift to fix the spam clicking. Something like..

function IsWoodcutting: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 250, 500) > 750);
end;


then before "Procedure ChopTree"

Put this:

While IsWoodcutting Do Wait(200+Random(50));

Basically what I just said is here: http://villavu.com/forum/archive/index.php/t-82977.html

Ahh ok, I will add that when I get home. Where should I put this in my script? I'm new at this (like 5 hours after I have heard of Simba :P)? I'm talking about he function you mentioned by the way.

Endzior

2012-06-12 19:11:09

You can do smth like :


procedure ChopTree;
var x, y: integer;
begin
repeat
FindNormalRandoms;
while(IsWoodcutting) do wait(200+random(100))
if FindObj(x, y, 'hop', 2239532, 40) then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
end;
repeat
wait(400+random(250));
AntiBan;
Until not IsUpText('ew') or (InvFull);
until(InvFull);
end;

(s)okkr7

2012-06-12 19:13:52

From: Randoms
Ahh ok, I will add that when I get home. Where should I put this in my script? I'm new at this (like 5 hours after I have heard of Simba :P)? I'm talking about he function you mentioned by the way.


Do you have teamviewer? I could try to explain it (by showing) a little bit better through that.

Randoms

2012-06-12 19:47:25

From: Sokkr7
Do you have teamviewer? I could try to explain it (by showing) a little bit better through that.

Never mind :P got it to work thanks