SRL Archive - First Scripts

Basic Alcher


ForgotMyName

2010-03-19 16:03:06

This is more like my second script since coming back to RS. It's also a magic script, but this time I don't have to worry about banks for the time being.

This script casts high alchemy on noted items in your inventory. You should set it up as follows.

Noted items to alch somewhere around top of inventory. Spot 3 is best. (Right under alch icon if you only display misc. spells.)
Wield fire staff. Natures and gp somewhere out of the way around bottom of inventory.
Fill in item name, how many to alch, and character nickname.

Current features:
Finds high alch icon and notes regardless of location
Basic failsafes to make sure we found our icons
A small bit of antiban

I recommend using this somewhere without randoms for simplicity, but it still checks for them just in case.

Future plans:
More antiban
Progress reports
Banking???

Please have fun with this script. Help me improve it by telling me what works or doesn't work, and what I can change. Thanks!

Bionicle

2010-03-19 16:50:17

Looks extremely good for a first script :)

Here are my suggestions..
Make it multi player.
Instead of having the player vars:
    casted
  • found
  • failures
  • bigFailures
i would make them into:
    Players[CurrentPlayer].Integers[0]
  • Players[CurrentPlayer].Booleans[0]
  • Players[CurrentPlayer].Integers[1]
  • Players[CurrentPlayer].Integers[2]
That way you won't need to reset them every time it switches players (if you add multiplayer), and you can add them into a detailed progress report for each individual character ;)

while (not (IsUpText('lche') and IsUpText('igh'))) do begin
could be
while (not IsUpTextMulti(['lche', 'igh']) do begin

But that whole first part of the ClickHighAlch procedure..it doesn't make sense to me. It looks like it'll click the magic tab, wait while the uptext is lche and igh, which it shouldn't be unless something happened, but instead of waiting 10 rounds and adding one to bigFailures, shouldn't you go back to the inventory tab and click another note? But also if the script is running right, it would not find the uptext, and add one to bigFailures? How is that a failure? O_o Also then it would only run 10 times if the script is working, being in your mainloop it will break and end when bigFailures is equal to 10.

In ClickAlchNote, you used the same method, but it works there as far as i can see ;) but you can use the Multi uptext function there too:
while (not IsUpTextMulti(['lche', itemName]) do begin

    if (GetCurrentTab() <> tab_Inv) then begin
Wait(500+Random(500));
Continue;
end;
I think you mean Exit instead of Continue.

line 64:
IsUpText('lchem')
think you mean 'lche' :p

also, i don't know if you know or not, but the procedure Inc(I: Integer); adds one to any integer, so you can use that instead of I := I + 1 like you used a lot, its not a big deal at all, i like using the old way most of the time, but im just saying in case you didn't know :p

Good job, i can't wait to see where this will go ;)

ForgotMyName

2010-03-19 17:19:16

Oh cool, didn't know IsUpTextMulti before. Thanks!

The idea is to keep trying to find and hover over the alch icon until we get there. We click the magic tab, and then keep repeating the loop that tries to find the icon, until we find the appropriate uptext. There's probably a nicer looking way of going about it, though. The wait and continue are intentional. It accounts for when RS lags slightly after you click alch and the inventory pane isn't up yet.

I didn't originally intend for this to be multi player, but that could be a nice improvement for the future, when I get around to it. I'd actually make banking more of a priority though.

Bionicle

2010-03-19 17:26:07

From: ForgotMyName
Oh cool, didn't know IsUpTextMulti before. Thanks!

The idea is to keep trying to find and hover over the alch icon until we get there. We click the magic tab, and then keep repeating the loop that tries to find the icon, until we find the appropriate uptext. There's probably a nicer looking way of going about it, though. The wait and continue are intentional. It accounts for when RS lags slightly after you click alch and the inventory pane isn't up yet.

I didn't originally intend for this to be multi player, but that could be a nice improvement for the future, when I get around to it. I'd actually make banking more of a priority though.


I thought that the end on line 54 broke out of the while do loop, my bad, i see what you're getting at.
Just a suggestion with the continue, put in a MarkTime in the mainloop right before the ClickAlchNote procedure, then in the procedure the first line of the while..do loop put an
If TimeFromMark(blabla) > ##### Then
Break;
just as a little failsafe :)

radiclerobby

2010-03-31 13:30:48

procedure RandomAntiban;
begin
if (Random(100) < 10) then begin
FindNormalRandoms;
i := Random(10);
case i of
1: Wait(1000+Random(1000));
2: PickUpMouse;
3: HoverSkill('random', False);
4: HoverSkill('magic', False);
5: ClickNorth(true);
6: SleepAndMoveMouse(2000 + random(1000));
end;
end;
end;


procedure RandomAntiban;
begin
case random(100) of
1: Wait(1000+Random(1000));
2: PickUpMouse;
3: HoverSkill('random', False);
4: HoverSkill('magic', False);
5: ClickNorth(true);
6: SleepAndMoveMouse(2000 + random(1000));
end;
end;

then you can take out the "i" variable will add more suggestions