SRL Archive - First Scripts

Dr Clemsip's Oak Tree Chopper & Depositor


Dr Clemsip

2014-08-20 00:57:57



2526 Oak logs were gained during the writing of this script.

Massive Shout Out To The Whole SRL Community and a special thanks to James Dean (The Mayor) for his BEASTY TUTORIALS! that I couldn't have done this without.

This is my first script so would appreciate all the feed back I can get, be it good or bad. The script is far from perfect. I will be updating it with anti ban features, lodestone recoveries and possibly an optional fire making feature as soon as I learn how to do that. Please keep me posted as to any bugs that you may and most probably will notice. The script has been laid out for the purpose of easy reading so if you feel like it needs a tweak here and there do so and let me know if its worth adding to the script and I'll be sure to add it. Other than that all I can say is enjoy.

People whose scripts I took small snippets of code from are as follows. Please forgive me ;) It wouldn't work with out them.

@The Mayor
[thread=108775]The Mayors VEB Miner[/thread]

@Spaceblow
[thread=109885]Spaceblow's redberries gatherer[/thread]

@Coh3n
[thread=47111]Draynor Chop N' Bank | By Coh3n[/thread]

@Incurable
[thread=109910]Inc's Onion Collector[/thread]

Setup

Known bug: Sometimes has difficulties finding deposit box (if this happens to you try world 81).
Known bug: Player wonders off (this shouldn't happen to often, if it does disable smart and relocate half way between lodestone and bank).

[LEFT]

    [*]Make sure your player is wearing the Cape of Validation that can be acquired from Diango next to Draynor Bank or alternatively choose your player colour using the colour picker within the Simba window.
    [*]Place SPS Map in correct folder. (C:/Simba/Includes/SPS/IMG/Runescape_other)
    [*]Set compass angle north.
    [*]Set camera angle to highest.
    [*]Move subcribe button to bottom right corner.
    [*]Move Xp counter to bottom right corner.
    [*]Make chat window as small as possible.
    [*]Start script halfway between Draynor lodestone and bank. Same as setup picture for best results.
    [*]Normal botting graphics settings apply.
    [*]Declare desired amount of loads to do.
    [*]Declare player to be used
    [*]Choose DirectX or OpenGL (DirectX has yet to be tested by myself due to limitaions).
    [*]Run script (I suggest watching it for a few moments to make sure everything is well).
    [*]Post progress report here upon completion.
    [*]Post any bugs that you notice also. I will do my best to fix the them.
[/LEFT]

[spoiler=Setup picture][/spoiler]


========================================================
/\/\/\/\_Dr Clemsip's Oak Tree Chopper_/\/\/\/\
========================================================
Time Run: 52 Minutes and 14 Seconds
Logs: 280
Loads Done: 10 of 10
Profit Made: 71400gp
Per Hour: 81995gp
========================================================
========================================================


========================================================
/\/\/\/\_Dr Clemsip's Oak Tree Chopper_/\/\/\/\
========================================================
Time Run: 52 Minutes and 17 Seconds
Logs: 280
Loads Done: 10 of 10
Profit Made: 71400gp
Per Hour: 81932gp
========================================================


[spoiler=Bugs that have been fixed]
DirectX issue has now been resolved.
[/spoiler]

Dr Clemsip

2014-08-20 01:01:10

:sasmokin:

Clarity

2014-08-20 01:19:46

Congratulations on release :)

Dr Clemsip

2014-08-20 01:30:04

From: Clarity
Congratulations on release :)


Thank you. Really appreciate it. ;)

The Mayor

2014-08-20 02:55:56

Nice first script. I.m going to give it a test now. One thing you should do though is make sure you put the smartPlugins before setupSRL or else it will load openGL no matter what.

Dr Clemsip

2014-08-20 03:10:30

From: The Mayor
Nice first script. I.m going to give it a test now. One thing you should do though is make sure you put the smartPlugins before setupSRL or else it will load openGL no matter what.


Thanks. Yeah I was wondering why I was having difficulty getting DirectX to work :duh:. Thanks for the advice I'll edit it now and re-upload it.

Incurable

2014-08-20 03:45:10

My script is barely a few days and already it has been used to help someone, I feel honoured. :p I'll check it out when I get home from work.

Dr Clemsip

2014-08-20 03:59:15

From: Incurable
My script is barely a few days and already it has been used to help someone, I feel honoured. :p I'll check it out when I get home from work.


I'm glad you don't mind. Certain aspects of your script were of great use to me. Look forward to you testing my script. Be sure to post a progress report.;)

The Mayor

2014-08-20 04:06:40

OK, you use tabBackpack.waitForShift here. This is no good as you actually get more than 1 log. What you need to do is wait until the player had stopped moving before clicking the next tree. This can easily be done with pixelshift. The problem is that your player might not be visible as the oak trees will be blocking it. What you can do it rorate the compass until your player is visible, and then wait until your player isn't moving.

You would need to let the user pick the colour of their player though. Something like:


const
PLAYER_COL = 10101878; //color of your player
PLAYER_TOL = 46; // tolerance



{ Returns true if the player is visible on screen (> 50 pixels of color) }
function isPlayerVisible(): boolean;
var
tpa: TPointArray;
begin
smartImage.drawBox(mainScreen.playerbox, false, clRed);

findColorsTolerance(tpa, PLAYER_COL, mainscreen.playerBox, PLAYER_TOL);
result := length(tpa) > 50;

if result then
writeLn('Player is visible')
else
writeLn('Player is not visible');
end;

{ Results true if the pixel shift inside the player box is > 180 }
function isPlayerMoving(): boolean;
var
shift: integer;
begin
shift := getPixelShiftAverage(mainscreen.Playerbox, 100, 500);
writeLn('Player pixel shift: ' + toStr(shift));
result := shift > 180;
end;

{ Wait until the player is not moving, or it's been 'maxTime' }
procedure waitPlayerMoving(maxTime: integer);
var
t: TTimeMarker;
begin
t.start

repeat
wait(100);
until not isPlayerMoving() or (t.getTime() > maxTime);
end;


//Chop oak tree procedure

procedure chopTrees();
var
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
treeTimer: TTimeMarker;

begin
if not isLoggedIn() then
exit;

treeTimer.start();

repeat
findColorsSpiralTolerance(x, y, TPA, 1909794, mainScreen.getBounds(), 2, colorSetting(2, 3.58, 1.14));

if (Length(TPA) < 1) then
exit;

ATPA := TPA.cluster(10, 10);
ATPA.filterBetween(0, 10);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);

for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
wait(randomRange(100, 200));
if isMouseOverText(['Oak', 'ak']) then
begin

fastClick(MOUSE_LEFT);
smartImage.clear();
break;
end;
end;

while not isPlayerVisible() do // after we click a tree, if player isn''t
begin // visible them rotate cpmpass
randomCompass(0, 360, false);
wait(500);
end;

wait(randomRange(1000, 1500));
waitPlayerMoving(10000); // wait for player to stop moving, or up to 10000 sec

until tabBackpack.isFull() or (treeTimer.getTime() > 300000);

end;


Dr Clemsip

2014-08-20 05:18:33

From: The Mayor
What you can do it rorate the compass until your player is visible, and then wait until your player isn't moving.
You would need to let the user pick the colour of their player though.


NICE ONE!:wowzers: Thanks for taking the time to go through the script. I'm going to implement it now and see what I come out with. This is a major learning curve for me and your advice is invaluable to the process.

Spaceblow

2014-08-20 06:49:41

You don't know how honored I feel that you've used something from my first script. :p Yours looks really great, I'm actually even a little bit jealous. :) Keep up the good work!

Dr Clemsip

2014-08-20 10:26:44

From: The Mayor

You would need to let the user pick the colour of their player though.


Cape of Validation.


From: Spaceblow
You don't know how honored I feel that you've used something from my first script. :p Yours looks really great, I'm actually even a little bit jealous. :) Keep up the good work!


I'm glad you like it;)

Dr Clemsip

2014-08-22 00:37:44

@The Mayor quick question, is there a way to search for the trees after the player has reached its SPS position as sometimes the player starts searching before it gets there which results in it getting lost. Thanks in advance.

The Mayor

2014-08-22 18:12:43

From: Dr Clemsip
@The Mayor quick question, is there a way to search for the trees after the player has reached its SPS position as sometimes the player starts searching before it gets there which results in it getting lost. Thanks in advance.


if you make sure your SPS path is working efficiently (I noticed it would get a bit confused going through the middle of the buildings) and then you just wait until your player has finished moving after walking the path, then it should be fine. You could also create a box around those couple of trees on your SPS map, and check that your player is inside that box.

Dr Clemsip

2014-10-29 13:54:56

@lendaz

Download the new script update and new SPS Map. ;)

lendaz

2014-10-29 22:05:41

From: Dr Clemsip
@lendaz

Download the new script update and new SPS Map. ;)


Thanks i will test it.

croberger

2014-11-30 02:58:32

Are you still working on updating your script? It runs pretty well and has made me some nice profit. Thanks for your work, and I look forward to seeing more! :)

(I would post a proggy but I forgot to save them)

Jagex Mod

2014-11-30 23:51:50

========================================================
/\/\/\/\_Dr Clemsip's Oak Tree Chopper_/\/\/\/\
========================================================
Time Run: 3 Hours, 2 Minutes and 16 Seconds
Logs: 1316
Loads Done: 47 of 50
Profit Made: 335580gp
Per Hour: 110469
========================================================

GRIM

2014-12-03 05:54:37

Using this for my iron currently, thanks man!
- Will edit with proggie once it's finished up-

bigmoney

2014-12-17 13:53:42

Great script ive ran it on a new account and it has gotten me 15-70 wc
========================================================
/\/\/\/\_Dr Clemsip's Oak Tree Chopper_/\/\/\/\
========================================================
Time Run: 7 Hours, 41 Minutes and 37 Seconds
Logs: 4200
Loads Done: 150 of 150
Profit Made: 1071000gp
Per Hour: 139204
========================================================



a 7 hour proggy for ya :) once you get the player colors right it works pretty well great first script!

Dr Clemsip

2014-12-17 15:52:59

From: bigmoney
Great script ive ran it on a new account and it has gotten me 15-70 wc
========================================================
/\/\/\/\_Dr Clemsip's Oak Tree Chopper_/\/\/\/\
========================================================
Time Run: 7 Hours, 41 Minutes and 37 Seconds
Logs: 4200
Loads Done: 150 of 150
Profit Made: 1071000gp
Per Hour: 139204
========================================================



a 7 hour proggy for ya :) once you get the player colors right it works pretty well great first script!



Thanks for the feedback. Better proggie than I got :P

The Mayor

2014-12-17 18:04:44

140k/h not bad for f2p ;)