SRL Archive - First Scripts

Power cutter First script


dallas574

2008-04-29 18:10:55

This is my fist script :) :) :)
Please post bugs.
Tell me what to add or fix in my script.
Thanks

Nava2

2008-04-29 21:40:50

First off, sorry about being harsh, but you didn't put a lot of work into that.

I will still give you some pointers though!

Firstly, constants should be declared before variables. Only because there are usually a lot of both, and the user generally changes the constants.

The cuttree procedure should probably been done differently. Try using:
FindColorTolerance(x, y, Color, x1, y1, x2, y2, tol); or
FindColorSpiralTolerance(x, y, Color, x1, y1, x2, y2, tol);
Both of the above allow the tree to be found with some change in color as JaGeX likes todo that to us :)
You will need to create a CutTillDown procedure. This would check to see if the tree is still there, and if its not, then it would repeat the cut tree.
Also, you need more FailSafes in this function; just using:
until InvFull;
is not enough. You need more just incase something goes wrong.

In your Drop procedure, you need to make it a function. This would be so that the user can input how far to drop. If someone can't wield their axe, then they shouldn't drop from 1 to 28 eh? That would mean they lose their axe!
Also, you should make the wait shorter, as waiting up to 1600 ms is a long time and would make dropping inhumanly slow.

Your mainloop is basic, but would get the job done. You used until (false) though! That is a HUGE mistake! Infinite loops are NOT allowed. Use something like:
begin
SetupSRL;
MarkTime(RunTime)
repeat
cutree;
drop;
until (TimeFromMark(RunTime) > MaxTime); // MaxTime would be a const declared earlier in the script.
end.

As some end notes, make more failsafes. Also, add antiban, and antirandom. There are many guides on all three of those, read up! :) Even a simple:
if not LoggedIn then Exit;

Makes your script safer, and more likely to run longer.

Well I hope you can learn from what I wrote considering it took me over 20 mins.

Hope you improve!

Nava2