SRL Archive - OSR Help

Help!


Footy

2012-06-30 11:24:42

So I made my first properly working script, a headless arrow maker, gets 40k xp/h, no req's, and makes a profit. How can I make the script end when Im out of supplies. Right now, my supplies are in inv spot 2 and 3. thanks!

program HeadlessArrowMaker;
{$i srl/srl.simba}

procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := '';
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
End;

Procedure Maker;
begin
findnormalrandoms;
Mouse(623, 226, 4, 4, 1);
wait(randomrange(200, 320));
Mouse(660, 230, 4, 4, 1);
wait(randomrange(900, 1200));
case random(100) of
1..10: begin Pickupmouse; Mouse(256, 433, 10, 10, mouse_right); end;
11..100: begin Mouse(256, 433, 10, 10, mouse_right); end;
end;
ChooseOption('ake');
wait(randomrange(100, 200));
case random(10) of
0..3: begin SleepAndMoveMouse(randomrange(9000, 12000)); end;
4..5: begin sleepandmovemouse(randomrange(3000, 3550)); wait(randomrange(7000, 8000)); end;
6..10: begin wait(randomrange(9000, 12000)); end;
end;
end;



begin
SetupSRL
Declareplayers
Loginplayer
Activateclient
repeat
Maker
until(false);
end.

E: Fixed up standards a little

Sir Ducksworthy

2012-06-30 12:07:21

You can use
If(InvCount<2)then TerminateScript; ;)

Based Lord

2012-06-30 12:13:20

You should probably remove your log in info :)

Footy

2012-06-30 12:19:06

Oh god, I feel like such an idiot… lol. Just changed my info, all good. and thanks leetsxc! Think this script is worthy of being published? I think theres one other like this, but this is a little faster.

P1ng

2012-06-30 13:48:21

  if ExistsItem(2) then
InvMouse(2, mouse_Left) else
begin
WriteLn('no items in second slot');
TerminateScript;
end;

And replace the 2s with 1s for the first item? That way it checks every time it goes to click the item? leet's will work equally as well, though.

Metagen

2012-06-30 20:12:55

Looks fine to me, simple scripts are nice :)

Although, I'd suggest adding a proggy.

Footy

2012-07-01 08:40:26

I'll work on adding a Proggy today! Thanks for the help guys!

Benny

2012-07-01 09:05:47

Well done on the release bud, i take it this is quicker than the H.A.M script a that only gets 29k per hour?

Footy

2012-07-01 09:27:49

Thanks! I finally feel part of the community! :D This one is faster then H.A.M, I tested this for 2 hours, got an average of 39.8k xp/h.