Results 1 to 11 of 11

Thread: First runescape script ever help :P

  1. #1
    Join Date
    Nov 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default First runescape script ever help :P

    So, here is my current script, I know it's probably sloppy as hell and not the best way to do what I'm trying to do, but my current goal is to get it to do a full inventory of potions(I'm making a herblore script)

    So far it can open the bank, empty inventory, withdraw 14 vials of water and 14 herbs, close bank, then use the vial of water on herb. What's the best way of clicking the make all button? And maybe a better way of withdrawing from the bank?

    Simba Code:
    program New;
    {$DEFINE SMART}
    {$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;
    end;

    Procedure BankChest;
    var
    x, y: Integer;
    begin
      begin
        OpenBankChest(SRL_BANK_SW);
        Wait(1000+random(200));
        DepositAll;
        Wait(1000+random(200));
        if FindObj(x, y, 'ithdraw-1', 11763319, 5) then
        Mouse(x, y, 3, 3, false);
        ChooseOption('ithdraw-14');
        Wait(500+random(100));
        if FindObj(x, y, 'ithdraw-1', 607786, 1) then
        Mouse(x, y, 3, 3, false);
        ChooseOption('ithdraw-14')
        CloseBank;
        Wait(1000+random(200));
        InvMouse(1, 1);
        Wait(20+random(200));
        InvMouse(15, 1);
      end;
    end;


    begin
      SetUpSRL;
      ActivateClient;
      DeclarePlayers;
      LoginPlayer;
      BankChest;
    end.
    Last edited by wolffang92; 09-01-2012 at 09:33 AM. Reason: Made some improvements to the banking

  2. #2
    Join Date
    Dec 2011
    Location
    Holland
    Posts
    545
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    To click on one of the items in your inventory, you could use:
    Simba Code:
    InvMouse(1, LeftClick);
    To combine them, you could use this:
    Simba Code:
    InvMouse(1, LeftClick); // Clicks on the first item in your inventory
    Wait(20 + random(200)); // Little antiban
    InvMouse(15, LeftClick); // Clicks on the 15th item

    To adjust the camera and to face south, this is what you can do:
    Simba Code:
    SetAngle(SRL_ANGLE_HIGH); // Adjusts the camera all the way up
    MakeCompass('S'); // Makes you face south

    Edit:
    Simba Code:
    if OpenBankChest(SRL_BANK_SW) then
    Last edited by Chris; 09-01-2012 at 09:16 AM. Reason: OpenBankChest

  3. #3
    Join Date
    Nov 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Thank you for the help, I actually found the OpenBankChest option from searching around a bit, so I might not even need the camera angle change anymore. This script is getting better and better by the second. I'm assuming there's a better way to withdraw items from the bank, any help with that?

    EDIT: Updated my script up top with more improvements.
    Last edited by wolffang92; 09-01-2012 at 09:29 AM.

  4. #4
    Join Date
    Dec 2011
    Location
    Holland
    Posts
    545
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Yup, we have this: "function Withdraw(col, row, amount): Boolean;" which you can use like:
    Simba Code:
    Withdraw(0, 0, 14); // Withdraws 14 of the item in the top left corner of your bankscreen

  5. #5
    Join Date
    Feb 2012
    Location
    UK
    Posts
    909
    Mentioned
    10 Post(s)
    Quoted
    191 Post(s)

    Default

    Looks good. Maybe you could look at a tutorial that goes over standards though to make it a little easier to read.
    Solar from RiD.

  6. #6
    Join Date
    Nov 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Thanks for the advice! I want to learn how to do walking paths, and see if I can get this script to make runs to the GE to buy more mats when it runs out.

  7. #7
    Join Date
    Nov 2011
    Location
    United States
    Posts
    815
    Mentioned
    6 Post(s)
    Quoted
    284 Post(s)

    Default

    You can also withdraw via bank slots if you are having problems with it mixing items up in a pretty full bank (often happens)
    Simba Code:
    MouseBankSlot(1, mouse_Right); //Moves the Slot, then right clicks
             if(WaitOption('ithdraw-1', 500)) then //Clicks which uptext you want.

  8. #8
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    To click the box, search for the color of the little cork on top of the bottle in the chatbox.

  9. #9
    Join Date
    Nov 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by NKN View Post
    To click the box, search for the color of the little cork on top of the bottle in the chatbox.
    Thanks, I needed that, the script is pretty much flawless now, awesome! Now all I need to do is make it look more organized, and maybe add on some new features and antiban.

  10. #10
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    418
    Mentioned
    2 Post(s)
    Quoted
    86 Post(s)

    Default

    A more accurate way of finding items in the bank is using SRL's search bank function, apart from that most of the others have posted most of my suggestions. WaitOption is a better failsafe than ChooseOption by the way.

  11. #11
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    If you end up making it run to the GE and back to purchase more supplies you should check out my OpenGE function

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
  •