Jump to content
LordJashin

Runescape Woodcutter Tutorial - Basic Script/Bot Creation

Recommended Posts

Still could be shorter. Working on that xD.

 

[video=youtube_share;kVL-ZSieuR0]

 

The script used in this tutorial:

 

[scar]

// Woot - By LordJashin

 

program WoodCuttingTutorial;

 

const

TimeToRunScript = 60 * 60; // in seconds

 

var

x, y, Width, Height, TimesClicked: Integer;

 

procedure SetupClient;

begin

GetClient.Activate;

GetBoxSize(GetClient.ImageArea, Width, Height);

end;

 

procedure ChopTree;

begin

MoveMouse(214, 185);

ClickMouse(214, 185, mbLeft);

Inc(TimesClicked);

end;

 

procedure DropLog;

begin

MoveMouse(575, 228);

wait(100);

ClickMouse(575, 228, mbRight);

wait(300);

MoveMouse(575, 228 + 45);

wait(100);

ClickMouse(575, 228 + 45, mbLeft);

end;

 

procedure Loop;

begin

repeat

ChopTree;

wait(5000);

DropLog;

until (GetTimeRunning > (TimeToRunScript * 1000));

end;

 

procedure MainLoop;

begin

ClearDebug;

SetupClient;

WriteLn('Script Started!');

Loop;

end;

 

begin

MainLoop;

end.

[/scar]

Edited by LordJashin
Link to comment
Share on other sites

I have modified the script , We need to be more strict with code , and strict to teach to the others

 

And I put some comments in the code , perhaps the creator will fill more.

 

Sorry to talk in this tutorial , but I would cry when I see code without comments.

 


// Woot - By LordJashin

program WoodCuttingTutorial;

const
 TimeToRunScript = 60 * 60; // in seconds

var
 x, y, Width, Height, TimesClicked: Integer;    

procedure SetupClient;
begin
 GetClient.Activate;
 GetBoxSize(GetClient.ImageArea, Width, Height);
end;

procedure ChopTree;
begin
 MoveMouse(214, 185);
 ClickMouse(214, 185, mbLeft); 
 Inc(TimesClicked);
end;

procedure DropLog;
var
 Pt1 , Pt2 : TPoint;
begin
 // What is Pt1 et Pt2
 Pt1 := Point(575,228);
 Pt2 := Point(575, 228 + 45);

 MoveMouse(Pt1.x, Pt1.y);
 wait(100);
 ClickMouse(Pt1.x, Pt1.y, mbRight);
 wait(300);
 MoveMouse(Pt2.x, Pt2.y);
 wait(100);
 ClickMouse(Pt2.x, Pt2.y, mbLeft); 
end;           

procedure Loop;
begin
 repeat                  
   ChopTree;
   // Why to wait 5000 millisec ?
   wait(5000);
   DropLog;                 
 until (GetTimeRunning > (TimeToRunScript * 1000));
end;

procedure MainLoop;
begin
 ClearDebug;             
 SetupClient;
 WriteLn('Script Started!');
 Loop;  
end;

begin
 MainLoop;
end.

Link to comment
Share on other sites

Sorry to talk in this tutorial , but I would cry when I see code without comments.
WARNING: It's better you don't take a look at any of my scripts! xD (just joking).

Yeah you have a good point there! I know commenting is important part of coding, so wish I would comment my code, damn it. :\ I'll probably never learn to do it...

Link to comment
Share on other sites

Yes I took a look at any of yours scripts, not only yours. If you know well the subject it is easy to follow the code :) but when you are new !!!!! Sometimes in some scripts , I say what is this color ? What does the creator want todo ? :)

 

And sometimes I say , damned too many global variables without correct name :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...