SRL Archive - First Scripts

Yew Chopper


shaman

2008-07-29 04:01:38

This is a basic program. If anyone can include a reapeat/loop at the end, could they please post one. All feedback is good. Thanks


const
Yew=4091268;

var;
x,y: Integer;

procedure FindTree;
if(FindColour(x,y,Yew,0,0,500,500)) then
begin
MoveMouseSmoothEx(x,y +random(100),20,40,45,25,20);
Wait(200+random(200));
ClickMouse(x,y,true);
end;

procedure AntiRandoms;
begin
If(FindFight) then
RunAway('N',True,1,15000);
FindNormalRandoms;
FindLamp('Woodcutting');
end;

end.

Ghostman

2008-07-29 09:07:32

what does it do after it chops the yew?

and i think it would be like this

begin
SetupSRL;
repeat
FindTree;
AntiRandoms;
end.

Illkillutill

2008-07-29 10:49:12

It's a good start to the script, here is what your looking for i think:

program YewChopper;
{.include srl/srl.scar}

const
Yew=4091268;

var
x,y: Integer;

procedure FindTree;
begin
if(FindColor(x,y,Yew,0,0,500,500)) then
begin
MoveMouseSmoothEx(x,y +random(100),20,40,45,25,20);
Wait(200+random(200));
ClickMouse(x,y,true);
end;
end;

procedure AntiRandoms;
begin
If(FindFight) then
begin
RunAway('N',True,1,15000);
FindNormalRandoms;
FindLamp('Woodcutting');
end;
end;


begin
SetupSRL;
FindTree;
AntiRandoms;
end.


A couple of extra things: Don't use MoveMouseSmooth or ClickMouse; Use MMouse and Mouse; Always include srl like i did at the top under the program name. also, if you noticed, i fixed your standards and you can learn them here Scar Script Official Standards.