Results 1 to 6 of 6

Thread: [First Script] [RS3] [SRL6] SuperGlass Maker

  1. #1
    Join Date
    Aug 2016
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default [First Script] [RS3] [SRL6] SuperGlass Maker

    Hi everyone. I just got back into scripting after a multi-year break where I forgot almost everything.

    This is my first script after coming back. As you might imagine from the name, it makes molten glass using Lunar Magic.

    Instructions:

    1. Start with SMART running and logged in.
    2. Compass north and highest angle.
    3. Stand next to a grey banker NPC.
    4. Set your Bank Preset 2 to: equipped fire (or lava, steam, etc.) staff, holding 100 astral runes, 100 air runes, 13 seaweed, 13 buckets of sand.
    5. Put SuperGlass Make in action bar slot 2.
    6. Run script.

    This script is still in the very early stages. It's still missing a lot of failsafes, antibans, reporting, etc. However, it's already working, and I've already gotten a few k glass and a crafting level off of this. I'm already pretty happy with my progress so far.

    Script below. Please read and review and give feedback. Thanks!

    Simba Code:
    program SuperGlassMaker;
    {$DEFINE SMART}
    {$i srl-6/srl.simba}

    var loopCount: Integer;

    procedure openBank;
    begin
      bankScreen.open(BANK_NPC_GREY);
      wait(gaussRangeInt(1000, 2000));
    end;

    procedure bankPreset;
    begin
      bankScreen.clickButton(BANK_BUTTON_PRESET_2, false);
      wait(gaussRangeInt(1000, 2000));
    end;

    procedure castSuperGlassMake;
    begin
      actionBar.clickSlot(2);
      wait(gaussRangeInt(3000, 4000));
    end;

    procedure setUp;
    begin
      clearDebug();
      setupSRL();
    end;

    procedure mainLoop;
    begin
      openBank;
      bankPreset;
      castSuperGlassMake;
    end;

    begin
      setUp;
      for loopCount := 1 to 1000 do
      begin
        mainLoop();
        if (random(100) < 10) then
        begin
          wait(gaussRangeInt(5000, 10000));
        end;
      end
    end.
    Last edited by Thunderlord9741; 08-22-2016 at 05:18 AM.

  2. #2
    Join Date
    Dec 2013
    Location
    Pitcairn Island
    Posts
    288
    Mentioned
    20 Post(s)
    Quoted
    166 Post(s)

    Default

    Quote Originally Posted by Thunderlord9741 View Post
    Script below. Please read and review and give feedback. Thanks!
    The scripts looks really clean. There isn't really much feedback I can give you because it is super simple (which isn't a bad thing).

    From reading your post you are no doubt aware it lacks failsafes (the two necessary ones being: checking for all of the required items, and logging back in from a disconnect). It can be as simple as checking if the backpack is full after a withdrawal, AND slot 1 + 2 item count = 200. If not, you can safely terminate.

  3. #3
    Join Date
    Dec 2015
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    that a really good start here a few fail safes that could help

    in your banking method
    Code:
    procedure openBank;
    begin
      bankScreen.open(BANK_NPC_GREY);
      wait(gaussRangeInt(1000, 2000));
    end;
    we want to make sure that it one its logged in and two that we actualy find and click the banker so something like this could be usefull

    Code:
    procedure openBank;
    begin
        if not isLoggedIn() then
            exit;
        repeat
           bankScreen.open(BANK_NPC_GREY);
           wait(gaussRangeInt(1000, 2000));
        Until bankScreen.isOpen()
    end;
    is not logged in is a good fail safe to have when making loops that way it will exit if you are not logged in. then in the same manor we want to make sure that the bank is actually open before sending our hot key that way were not randomly pressing one
    Code:
    procedure bankPreset;
    begin
      if   bankScreen.isOpen(1000)  then
        begin
          repeat
            bankScreen.clickButton(BANK_BUTTON_PRESET_2, false);
            wait(gaussRangeInt(1000, 2000));
          until (not Bankscreen.isOpen) or (not isLoggedIn());
        end;
    end;
    again this checks that the bank is open before we send our key. for your setup you could include something like this
    Code:
    procedure setUp;
    begin
      clearDebug();
      setupSRL();
      minimap.setAngle(MM_DIRECTION_NORTH);  
      mainScreen.setAngle(MS_ANGLE_HIGH);
    end;
    this just makes the bot make sure that angle is high and map facing north as a fail safe. finally we can improve the logic of the main loop so that the script can be started in any situation.
    Code:
    begin
      setUp;
      if tabBackpack.isFull() then
          castSuperGlassMake()
        else if bank.isOpen() then
          bankPreset()
        else
      for loopCount := 1 to 1000 do
      begin 
        mainLoop();
        if (random(100) < 10) then
        begin
          wait(gaussRangeInt(5000, 10000));
        end;
      end
    end.
    this just makes the bot check on start up that the bank is not open or that the inventory is not full its those little bits of logic that can help make a good script be great and stable

  4. #4
    Join Date
    Aug 2016
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Thank you both for the feedback. I'm working on adding those recommendations as well as some antibans/failsafes to the script. At some point, when it's more polished, I'll work towards preparing a public release.

  5. #5
    Join Date
    May 2012
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Add a small failsafe for your castGlassMake() just in case
    Simba Code:
    repeat
       actionbar.clickSlot(2);
       wait(gaussRangeInt(200,500));
    until actionbar.isSlotActive(2);

  6. #6
    Join Date
    Nov 2016
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Going to try it :P

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
  •