Results 1 to 5 of 5

Thread: Basic Alcher

  1. #1
    Join Date
    Mar 2010
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Basic Alcher

    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!
    Last edited by ForgotMyName; 03-19-2010 at 08:05 PM.
    Wow. I've been gone a very long time indeed. So much has changed.

  2. #2
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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

    SCAR Code:
    while (not (IsUpText('lche') and IsUpText('igh'))) do begin
    could be
    SCAR Code:
    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:
    SCAR Code:
    while (not IsUpTextMulti(['lche', itemName]) do begin

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

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

    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

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

  3. #3
    Join Date
    Mar 2010
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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.
    Wow. I've been gone a very long time indeed. So much has changed.

  4. #4
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ForgotMyName View Post
    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
    SCAR Code:
    If TimeFromMark(blabla) > ##### Then
     Break;
    just as a little failsafe
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  5. #5
    Join Date
    Jul 2008
    Posts
    179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    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;

    SCAR Code:
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •