SRL Archive - First Scripts

ZedsWillowChopper


Zeds

2013-04-11 21:06:51

First off, I know this is the rock bottom of scripts but I just wanted to post this and get some feedback/criticism/help. A majority of this script came from @Griff and his scripting tutorial and I examined Bud's Fisher to find out how to go about antiban.

 program ZedsWillowChopper;
{$DEFINE SMART8}
{$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;
var
i : Integer;
begin
i := random(600)
case i of
100: begin
HoverSkill('woodcutting', False);
end;
200: begin
PickUpMouse;
end;
300: begin
ExamineInv;
end;
400: begin
RandomRClick;
end;
500: begin
MMouseOffClient('random');
end;
end;
end;


procedure ChopWillow;
var x, y: integer;
begin
repeat
FindNormalRandoms;
if FindObj(x, y, 'hop', 2832440, 35) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('hop');
end;
repeat
Wait(400+random(250));
Until not IsUpText('illow') or (InvFull);
until (InvFull);
end;



begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
ChopMaple
end.

I will be adding more to this script as I receive more feedback and learn more. But could anyone tell me why it continues to right click and select the willow tree? I thought I had it written out so that it only clicks the tree once. Thank you :)

rj

2013-04-11 21:22:11

Can you at least change the name of the procedure lol it says chop maple

Zeds

2013-04-11 21:33:59

From: Officer Barbrady
Can you at least change the name of the procedure lol it says chop maple

Sorry ); haha I was originally going to have it bank maples but then I figured I'd start out smaller and maybe just make a chop and burn

t4q

2013-04-12 08:21:50

If you move to other tree then your cursor is moved away from tree it clicked and it tries to find new tree.
Try out pixelshift:

while IsCutting do
wait(100 + random(50));


function IsCutting: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195); //box where it searches motion
Result := (AveragePixelShift(PBox, 250, 500) > 120); // (box, loop time, max time to wait)> how many pixels must change to make it true
WriteLn('AveragePixelShift is : ' + IntToStr(AveragePixelShift(Pbox, 250, 500)));
end;

Change that 120 if it's too low or high