SRL Archive - First Scripts

Pheter's Auto Dropper


Pheter

2009-02-14 21:34:40

Hi,

Was power woodcutting and was getting fed up with having to drop each individual item so I opened up SCAR and wrote a script to do it for me.

I know that I could use a SRL procedure that already exists but I couldn't be bothered to find what procedure to use and also wanted to have the fun of writting my own script.

Originaly the script had a list of x and y co-ordinate pairs and I had repeated lots of code so I changed it to use fewer variables by using individual x and y co-ordinates and combining them together to target all inventory slots, instead of using absolute variables. I then changed the script to use a loop reducing the code significatly (something that I should have done in the first place).

Anyway, I don't really see how this will be of any use to anyone other than me when I want to autodrop items.. this code could be built into a power leveling script but it would make more sence to use an existing SRL procedure.

I thought I would let you guys take it appart and criticise it anyway :P

{ + -- Pheter's AutoDropper  --------------------------------- + }
{ + ========================================================== + }
{ + + }
{ ++ Description: ------------------------------------------- + }
{ + - Drops all items in inventory. + }
{ + - Inventory must be open. + }
{ + - EVERYTHING will be dropped.. + }
{ + - Therefore tools MUST be wielded. + }
{ + ========================================================== + }
{ + ---------------------------------------------------------- + }

program AutoDropper;
{.include srl/srl.scar}

var
x : array [1..4] of integer;

y : array [1..7] of integer;

xcol :integer;

yrow :integer;

k :integer;

procedure DropItems;

begin

x[1] := 1520; { coords of 1st column of inventory }
x[2] := 1560; { coords of 2st column of inventory }
x[3] := 1600; { coords of 3st column of inventory }
x[4] := 1640; { coords of 4st column of inventory }

y[1] := 750; { coords of 1st row of inventory }
y[2] := 785; { coords of 2st row of inventory }
y[3] := 820; { coords of 3st row of inventory }
y[4] := 855; { coords of 4st row of inventory }
y[5] := 890; { coords of 5st row of inventory }
y[6] := 925; { coords of 6st row of inventory }
y[7] := 965; { coords of 7st row of inventory }



xcol := 1;
yrow := 1;

k := 1;

repeat

ClickMouse(x[xcol], y[yrow], False);
wait(130+random(20));
ChooseOption('rop');
wait(60+random(20));

Inc(k);

Inc(xcol);
if (xcol = 5)then xcol := 1;
if (yrow * 4 + 1 = k)then Inc(yrow);

until(yrow = 8)

end;

begin
setupsrl;
ClearDebug;
Writeln('Starting Item Dropping');
Writeln('Please Wait..');
Writeln('');
DropItems;
Writeln('Items Dropped!');
end.

Please suggest any ways in which I can optimise this code.
Thanks!

Edit: I just want to say that it works in RuneScape HD.. not that it wouldn't seeing how it is just a co-ordinate clicker essentially lol. I needed it to work in HD mode as it is intended to save me a few seconds clicking when playing and NOT auto'ing.

ian.

2009-02-14 22:32:27

this is pretty complicated =X and don't use clickmouse.. use Mouse(mousex, mousey, ranx, rany: Integer; left: Boolean);

so it would be Mouse(x[xcol], y[yrow], 3, 3, False);

and all this can just be done by..

DropAll;

:) but amazing at what you did for first script :D

Pheter

2009-02-15 04:51:13

Thanks, I was planning on using a more 'human-like' mouse function but hadn't got round to checking out which one I should use.

Does DropAll; work with HD RuneScape? I tried it when writing the script but couldn't get it working so I wrote this instead!

Torrent of Flame

2009-02-15 05:04:50

or this works too..

Procedure DropAll;
var i, x, y: Integer;
begin
For i := 1 to 28 do
If ExistsItem(i) then
Begin
Mouse(x, y, 1, 1, false);
ChooseOption('rop')
end;
end;

Pheter

2009-02-15 05:13:51

Thanks but again, does this support RS HD?

Da 0wner

2009-02-15 06:35:26

RS HD = phail it lags because Runescape's server is slow. Trust me it's not my computer/internet ;).

But most likely not as SRL is for autoing and autoing should only be done in low detail.

Pheter

2009-02-15 07:37:29

Ok thanks.
Yeh this script isn't really intended for full out autoing as I said earlier. It's more of a 'tool' for when I'm not autoing.

But the feedback is really usefull anyway so thanks. I'll definatly use this information when writting a power-leveler.

SRL-Forums is deffinately a nice, welcoming community ;)

Smarter Child

2009-02-15 10:53:56

or just use DropAll; ….. but very advanced for a first script:)

sirlaughsalot

2009-02-15 12:33:12

Impressive, arrays are very impressive. Keep at it and im sure you can get members. There are easier ways of doing this as other people have said but this shows initiative and im proud.

Pheter

2009-02-15 13:24:06

Thanks for the great feedback. I have experience with using other programing languages so the only thing that I am struggling with is what procedures I should use.