PDA

View Full Version : trying to learn



Scrapy
06-17-2006, 04:02 PM
ive been wanting to learn how to script for awhile now, and i decided to give it a shot. i want to start out by doing something as simple as cutting down a tree, ive been looking at (Surajd's willow smasher banker) to base my 1st script off of.. but im having problems, i cant seem to get the mouse to move over a tree, instead all it does is click every few seconds without moving the mouse.

eventualy i want to edit and build on this to turn it into a log cutter and burner.


program CutAndBurn;
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/Woodcutting.scar}

var
Loads: Integer;

const
Times = 2;
WaitTime = 5000;
TreeColor = 622696;

procedure SetupScript;
begin
SetChat('Hide', 1);
SetChat('Off', 2);
SetChat('Off', 3);
SetRun(true);
GameTab(4);
end;

procedure CutTrees;
begin
if (FindMainColor(x, y, TreeColor, 3, true)) then
begin
repeat
wait(1023 + random(323 * 5 / 2));
if (IsUpText('Chop down')) then
MMouse(x, y, 1, 2);
GetMousePos(x, y);
Mouse(x, y, 1, 2, true);
wait(WaitTime + Random(427 * 8 / 2 + 3 - 1));
until (InvFull);
Loads := Loads +1
end;
end;

procedure MainLoop;
begin
repeat
SetupScript;
CutTrees;
until (Times = Loads);
Logout;
Writeln('CutAndBurn Complete!');
end;

begin
Loads := 0
Writeln('CutAndBurn Scrapys TEST script');
SetupSRL;
DisguiseScar('Notepad');
MainLoop;
end.

Dankness
06-17-2006, 04:41 PM
try this



program CutAndBurn;
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/Woodcutting.scar}

var
Loads: Integer;

const
Times = 2;
WaitTime = 5000;
TreeColor = 622696;

procedure SetupScript;
begin
SetChat('Hide', 1);
SetChat('Off', 2);
SetChat('Off', 3);
SetRun(true);
GameTab(4);
end;

procedure CutTrees;
begin
if ( not ( LoggedIn )) then Exit;
if (FindMainColor(x, y, TreeColor, 3, true)) then
begin
MMouse(x, y, 1, 2);
if (IsUpText('Chop down')) then
begin
Mouse(x, y, 1, 2, true);
wait(WaitTime + Random(427 * 8 ));
end;
end;
end;

begin
Loads := 0
Writeln('CutAndBurn Scrapys TEST script');
SetupSRL;
SetUpScript;
DisguiseScar('Notepad');
repeat

repeat
CutAllLogs;
if ( not ( LoggedIn )) then Break;
DropAllLogs;
until ( Loads = Times );
LogOut;
until ( false );
end.

Scrapy
06-18-2006, 04:16 AM
thankyou so much

yoolegoole
10-09-2007, 08:43 PM
can i test it?

mat_de_b
10-09-2007, 08:51 PM
Another year old gravedig! you rule...

RAM
10-10-2007, 08:40 PM
Locked and Infracted x 3 in other posts.