SRL Archive - First Scripts

First Script: Yet Another Draynor Cutter!


guinner

2009-06-28 17:08:13

I joined last year at some point when I first started my journey as a autoer (Woah! Doesn't this sound mystical :P) But after a few months got bored and returned to being a good boy!

Yesterday I decided I should start autoing again and I decided to write my own scripts (I didn't really decide it was more cycrosism's idea) anyways, first tut I came across was a woodcutting one so I started that, added a few of my own ideas and TaaDaa!

Yes I know, it's really really bad! But, if there is anything wrong with it, speak up and tell me! Glad if you could also give a soultion. Even if it's a really small thing.

How to use:
~ Have axe equiped or in first slot of inventory.
~ Start in Draynor Bank.


SPECIAL THANKS ~ Cycrosism, for telling me all about scripting and putting up with my stupid question. Oh and for not getting annoyed when I did! And for lending me his account, whilst he was using mine xD :D


V1.0
~ Basic Anti-Ban.
~ Basic Banker.
~ Auto-Login
~ S.M.A.R.T
~ Seems to work fine.

cycrosism

2009-06-28 17:10:07

Your welcome :)

Caotom

2009-07-11 06:54:35

Simple but Beautiful first script, it's very nice.
I haven't tested (may do this later) but it compiled without a bug and proceeded to load up SMART.

[BUG/HINT]
This is what I received but is of no concern, you may just want to know ;)
Line 18: [Hint] (20:1): Variable 'P' never used in script C:\Program Files\SCAR 3.20\includes\SRL/SRL/Misc/Smart.scar
NVM :redface: my mistake ^^^^^^^^^^^^

[SUGGESTIONS]
Just maybe add more players to the player setup list (mainly as there is a number of players setup and it is set to 4 but there is no other player forms) and maybe think about anti-randoms (but then again it's a first script).

A very commendable effort (couldn't do it better myself).

EDIT
Whoopsy, thanks Dark.
Tried a few other scripts and all had the same [hint] :redface:

~Caotom

Dark Arcana

2009-07-11 07:00:55

From: Caotom

[BUG/HINT]
This is what I received but is of no concern, you may just want to know ;)
Line 18: [Hint] (20:1): Variable 'P' never used in script C:\Program Files\SCAR 3.20\includes\SRL/SRL/Misc/Smart.scar


Thats hint is not in his script, it is in your Smart.scar

All that is man

2009-07-11 07:59:48

Great for a first script couple of things though.

You have:

if FindObj(x, y, 'hop',3429725,35)then
Mouse(x, y, 0, 0, true);
ChooseOption('hop');
The

Mouse(x, y, 0, 0, true);
is going to make it right click so you'd ethier have to make it.

if FindObj(x, y, 'hop',3429725,35)then
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
or

if FindObj(x, y, 'hop',3429725,35)then
Mouse(x, y, 0, 0, true);
And the other thing is your standards a bit off ;)
Here they are fixed:

program New;
{.include SRL/SRL/Misc/Smart.scar}
{.Include SRL\SRL.SCAR}
{.include srl/srl/misc/Reports.scar}

{Thanks to cycrosism for all his help!!!}

var
X, Y, Logs: integer;

procedure DeclarePlayers;
begin
NumberOfPlayers(4);
Players[0].Name := ''; //Username
Players[0].Pass := ''; //Password
Players[0].Nick := ''; //2-3 Letters Of Your Username
Players[0].Active :=True; //Using This Account?
if(not(loggedin)) then loginplayer;
end;
procedure AntiBan;
begin
if(not(loggedin)) then Exit;
FindNormalRandoms;
case Random(40) of
0: begin
HoverSkill ('Woodcutting',false);
wait(2453+Random(432))
end;
1:PickUpMouse;
2: begin
RandomMovement;
end;
end;
end;

procedure ChopTree;
begin
repeat
FindNormalRandoms;
if FindObj(x, y, 'hop',3429725,35) then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
repeat
wait(1600+random(500));
Antiban;
Until not IsUpText('illo') or (InvFull);
end;
Until(InvFull);
Logs := Logs + 28;
end;

Procedure Bank;
begin
SetRun(True);
Antiban;
symbolAccuracy := 0.7;
if (FindSymbol(X, Y, 'bank')) then
Begin
Mouse(X, Y, 5, 5, True);
FFlag(7);
OpenBank('db', true, true);
repeat
wait(10);
until(bankscreen)
Deposit(2, 28, True);
end;
end;

Procedure WalkToWillows;
begin
MakeCompass('N');
RadialWalk (FindWaterColor, 180, 228, 65, -1, 0);
end;

Procedure ProgressReport;
begin
writeln('Chopped for '+TimeRunning);
writeln('chopped '+IntToStr(logs)+' logs');
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
Repeat
WalkToWillows;
Choptree;
Bank;
ProgressReport;
until(not(loggedin))
end.

Great job overall!!! Keep it up!

Smarter Child

2009-07-11 08:26:37

Ahh, a nice first script. Indeed, there is a lot of reasons i wouldn't actually use this script myself. But, I can give you a few pointers on how to achieve a more proper script. For example, the procedure that walks to the willows can be heavily improved.

You may add a failsafe, in case it takes the wrong route. OR, simply use another method, such as FindSymbol/DTM/Bitmaps.

Your standards are not really a big thing, but, it makes us users evaluate or read your script easily.

Good Luck~

Smarter Child___

JPHamlett

2009-07-11 16:29:32


Procedure Bank;
begin
SetRun(True);
Antiban;
symbolAccuracy := 0.7;
if (FindSymbol(X, Y, 'bank')) then
Begin
Mouse(X, Y, 5, 5, True);
FFlag(7);
OpenBank('db', true, true);
repeat
wait(10);
until(bankscreen)
Deposit(2, 28, True);
end;
end;

if someone is standing on the bank symbol it will not work then



Procedure WalkToWillows;
begin
MakeCompass('N');
RadialWalk (FindWaterColor, 180, 228, 65, -1, 0);
end;

useless lines add failsafes such as


if not radialwalk(balh,x,234,,5,234) then
radialwalk(blah,234,234,234,234,234);

also id learn ddtms and make one of the willow tree and then use that as a failsafe



all and all awesome first script wouldnt use it myself caus i dont cut willows any more but nice first script

Griff

2009-07-12 00:41:35

As said above, great first script. You need to add some failsafes to your script, though. For example, in your walk to tress procedure, try making it a function.

Function WalkToWillows: boolean;
begin
MakeCompass('N');
if not (RadialWalk (FindWaterColor, 180, 228, 65, -1, 0)) then
begin
if (FindSymbol(X, Y, 'fish')) then
begin
Mouse(X, Y, 5, 5, True);
FFlag(7);
end;
end;
end;

So if it doesn't get the water color, then it will try to find the fishing symbol next to the tress.

guinner

2009-07-13 03:40:45

Thanks for all the help guys, I myself thought it was a pretty bad script and after no one commented for quite a while I stopped scripting, outta boredom I came here, So thanks for all the lovely comments.

I'll start working on it now. I'll add some failsafes and I'm reading Allthatisman's link now, aiming to update by today or tommorow =D

P1nky

2009-07-13 10:56:01

wow this looks like mine when i started :)
Good job, your getting there!

keep working on this 1 script and improve it and you'll get srl members :)

Coh3n

2009-07-14 07:37:00

From: ~~Joker~~
wow this looks like mine when i started :)
Good job, your getting there!

keep working on this 1 script and improve it and you'll get srl members :)


+ 1

This is exactly what I did. Built up a first script, made it better, and applied. :)

There isn't much wrong with your script that hasn't been mentioned already. I would say to add plenty of failsafes and neat little features like hatchet finding, breaking, etc.

Try looking around at other Willow bankers, and see what other people have done, it will give you plenty of ideas. :)

Not bad for a first script, keep up the good work.

Cheers. :)

guinner

2009-07-14 17:22:35

Thanks again for all the constructive criticism, didn't get round to updating it so i'm doing it thursday :S! I would totally be your best friend or something if you could post some proggies?

appolo13

2009-09-26 13:48:43

i love this script

Dervish

2009-09-26 16:29:18

From: appolo13
i love this script


Could you explain what you love about it ? I'm saying this because I think you want post count more than helping others ;).

How did it work and such ? :)