LordJashin Posted November 25, 2012 Share Posted November 25, 2012 (edited) Still could be shorter. Working on that . [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 November 25, 2012 by LordJashin Quote Link to comment Share on other sites More sharing options...
LordJashin Posted December 9, 2012 Author Share Posted December 9, 2012 Part 2 of this will not be out anytime soon. Need to write more code for it, and experiment with some things...I want a new DTM system for map walking if there is going to be any map walking in this. Quote Link to comment Share on other sites More sharing options...
TroisVerites Posted December 11, 2012 Share Posted December 11, 2012 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. Quote Link to comment Share on other sites More sharing options...
Janilabo Posted December 11, 2012 Share Posted December 11, 2012 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! (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... Quote Link to comment Share on other sites More sharing options...
TroisVerites Posted December 11, 2012 Share Posted December 11, 2012 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 Quote Link to comment Share on other sites More sharing options...
LordJashin Posted December 11, 2012 Author Share Posted December 11, 2012 Just watch the video, it goes step by step through the code. In some cases commenting helps, but in this one it shouldn't really matter IMO. Quote Link to comment Share on other sites More sharing options...