Results 1 to 14 of 14

Thread: Here is a VERYYYYYYY basic Guilded altar script

  1. #1
    Join Date
    Aug 2014
    Posts
    172
    Mentioned
    2 Post(s)
    Quoted
    77 Post(s)

    Default Here is a basic Guilded altar script (will get better)

    Hey, I need 95 prayer, and so I decided to try a bit more scripting. This script is INCREDIBLY bare. However it does do the job.... kinda. I would love for more feedback on this.


    These are the requirements for this to work however.........


    • Have completed Elder Kiln Quest for the ToKkul ring
    • Have preset like I show
    • Have altar North of your house entrance like I show
    • Make sure your action bar looks like mine
    • Make sure you have enough Bones, clean Marrentill and House Teletabs


    Action bar must have the ring in slot 2 and the teletab in slot 3 (forget about the summoning in slot 1, that's just there in case I am able to implement summoning in the future)



    The preset must have the inventory with those items (Of course change to whichever bones you are using) The equipment MUST have the ring there, or no teleporting back



    Set you House to look like this. your altar must be north of the entrance and the incense burners must be on each side like that.



    (v0.2) Few little tweaks, inserted player form (still no antiban though, will bring that out once i fix it sometimes not clicking the banker because he moves around) ¬_¬
    (v0.3) should last a little longer, will still mess up if the banker moves when trying to click him, if anyone can help with that. Let me know if there is a way to repeat that specific section until the banker is found etc. Also, when clicking altar, it now uses colour for it and the mouse randomly goes off the screen, as a very tiny antiban. :P
    Attached Files Attached Files
    Last edited by nero_dante; 06-04-2015 at 03:43 AM.

  2. #2
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    Yay, congrats on your first script! It's pretty well done for a first script, but here are some pointers if you'd like them.

    For your "SwitchtoNorthHigh" procedure, there's no need to make your own method to click the compass as there is one already defined as minimap.clickCompass() which accomplishes the same thing.

    I see that you have a decent grasp of scripting so far, but you should try to use some sort of coding convention in your scripting style. Personally, I use the Java style as I picked that up when I learned comp sci so something like "SwitchtoNorthHigh" would instead be "switchToNorthHigh." This can also be applied to variables. Java would change "resetcamera" to "resetCamera." It's all up to you, and people range greatly on their styles, but its good practice to be consistent.

    While we are on the topic of conventions, I see that some of the spacing is iffy. Some procedures haven't been indented at all, and some spacing is a little weird. I learned the particular conventions for Lape while reading some other people's scripts on this forum. Again, the code works, but it's just easier to read for other people and is good practice to practice the little things.

    Lastly, it's also quite important in scripting for Runescape in general to use a random range for wait times as static waiting times is repetitive and suspicious to Jagex. Some people choose to use randomRange(x, y) to generate a random number between x and y for their wait times, other like to use gaussRangeInt(x, y) for a slightly different distributed number range.

  3. #3
    Join Date
    Aug 2014
    Posts
    172
    Mentioned
    2 Post(s)
    Quoted
    77 Post(s)

    Default

    Quote Originally Posted by yourule97 View Post
    Yay, congrats on your first script! It's pretty well done for a first script, but here are some pointers if you'd like them.

    For your "SwitchtoNorthHigh" procedure, there's no need to make your own method to click the compass as there is one already defined as minimap.clickCompass() which accomplishes the same thing.

    I see that you have a decent grasp of scripting so far, but you should try to use some sort of coding convention in your scripting style. Personally, I use the Java style as I picked that up when I learned comp sci so something like "SwitchtoNorthHigh" would instead be "switchToNorthHigh." This can also be applied to variables. Java would change "resetcamera" to "resetCamera." It's all up to you, and people range greatly on their styles, but its good practice to be consistent.

    While we are on the topic of conventions, I see that some of the spacing is iffy. Some procedures haven't been indented at all, and some spacing is a little weird. I learned the particular conventions for Lape while reading some other people's scripts on this forum. Again, the code works, but it's just easier to read for other people and is good practice to practice the little things.

    Lastly, it's also quite important in scripting for Runescape in general to use a random range for wait times as static waiting times is repetitive and suspicious to Jagex. Some people choose to use randomRange(x, y) to generate a random number between x and y for their wait times, other like to use gaussRangeInt(x, y) for a slightly different distributed number range.
    The reason i made my own switchtoNorthHigh procedure, is because the already defined one, doesn't make put it completely north for some reason.

  4. #4
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    minimap.clickCompass() is not the same as minimap.setAngle(MM_DIRECTION_NORTH) which is what I think you are thinking of. I don't like to use the latter method as well.

    It literally clicks the compass, which is exactly what your procedure does.

  5. #5
    Join Date
    Aug 2014
    Posts
    172
    Mentioned
    2 Post(s)
    Quoted
    77 Post(s)

    Default

    Quote Originally Posted by yourule97 View Post
    minimap.clickCompass() is not the same as minimap.setAngle(MM_DIRECTION_NORTH) which is what I think you are thinking of. I don't like to use the latter method as well.

    It literally clicks the compass, which is exactly what your procedure does.
    ohhh, I get you. Yeah I'll implement that now then I'll bring out my next little tweaked version :P

  6. #6
    Join Date
    Aug 2014
    Posts
    172
    Mentioned
    2 Post(s)
    Quoted
    77 Post(s)

    Default

    Guys I have attempted to implement
    Code:
    if (tabBackpack.isEmpty) then
    this into the script so that I don't have to make it wait a random time when finishing off an inventory, however, as soon as it clickes to offer the altar it just instantly goes to the next step in the script. Any reason for this?


    Simba Code:
    , 200)
      end;

    procedure OfferBones();
      begin
        mouseOffClient(OFF_CLIENT_RANDOM);
        if (tabBackpack.isEmpty) then
      end;

    procedure TeleportToBank();
      begin
        typeSend('2', false);
        wait(1000);
        conversationBox.selectOption(2);
        wait(gaussRangeInt(3000,3400));
      end;                           ]

  7. #7
    Join Date
    May 2014
    Posts
    633
    Mentioned
    8 Post(s)
    Quoted
    322 Post(s)

    Default

    You're not looping in OfferBones so it sees that the backpack isn't empty and says "great, I'm done! Next step"

    you need to replace the if with:
    Simba Code:
    repeat
    wait(xxxx); //can do other antiban here if you want
    until(tabbackpack.isempty);
    so that your script keeps looping until the backpack is empty and doesn't exit immediately

  8. #8
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by nero_dante View Post
    Guys I have attempted to implement
    Code:
    if (tabBackpack.isEmpty) then
    this into the script so that I don't have to make it wait a random time when finishing off an inventory, however, as soon as it clickes to offer the altar it just instantly goes to the next step in the script. Any reason for this?


    Simba Code:
    , 200)
      end;

    procedure OfferBones();
      begin
        mouseOffClient(OFF_CLIENT_RANDOM);
        if (tabBackpack.isEmpty) then
      end;

    procedure TeleportToBank();
      begin
        typeSend('2', false);
        wait(1000);
        conversationBox.selectOption(2);
        wait(gaussRangeInt(3000,3400));
      end;                           ]
    As J_R said, there is no loop and nothing written after then, so it will just run right though it. I prefer while do over repeat until in this situation
    Simba Code:
    procedure offerBones();
    begin
      mouseOffClient(OFF_CLIENT_LEFT);
      while (not tabBackPack.isEmpty()) do wait(500);
    end;
    You can improve your teleport function by replacing the static wait() with conversationBox.isOpen(waitTime)
    Simba Code:
    if conversationBox.isOpen(1000) then
      if conversationBox.selectOption(2) then
        wait(gaussRangeInt(3000, 3400);

  9. #9
    Join Date
    Aug 2014
    Posts
    172
    Mentioned
    2 Post(s)
    Quoted
    77 Post(s)

    Default

    Quote Originally Posted by J_R View Post
    You're not looping in OfferBones so it sees that the backpack isn't empty and says "great, I'm done! Next step"

    you need to replace the if with:
    Simba Code:
    repeat
    wait(xxxx); //can do other antiban here if you want
    until(tabbackpack.isempty);
    so that your script keeps looping until the backpack is empty and doesn't exit immediately

    Soooo I could put

    Simba Code:
    [U]until[/U][/B](tabBackpack.isEmpty) then
      end;

    procedure TeleportToBank();
      begin
        typeSend('2', false);
        wait(1000);
        conversationBox.selectOption(2);
        wait(gaussRangeInt(3000,3400));
      end;]

    or would that not solve it?

  10. #10
    Join Date
    Aug 2014
    Posts
    172
    Mentioned
    2 Post(s)
    Quoted
    77 Post(s)

    Default

    Quote Originally Posted by evilcitrus View Post
    As J_R said, there is no loop and nothing written after then, so it will just run right though it. I prefer while do over repeat until in this situation
    Simba Code:
    procedure offerBones();
    begin
      mouseOffClient(OFF_CLIENT_LEFT);
      while (not tabBackPack.isEmpty()) do wait(500);
    end;
    You can improve your teleport function by replacing the static wait() with conversationBox.isOpen(waitTime)
    Simba Code:
    if conversationBox.isOpen(1000) then
      if conversationBox.selectOption(2) then
        wait(gaussRangeInt(3000, 3400);
    Thanks .... I'll change the conversation box teleport in next lot of fixes

    Still need to find a way to repeat the steps of finding the banker if it misses to find it. Any help on that?

  11. #11
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by nero_dante View Post
    Soooo I could put

    Simba Code:
    procedure OfferBones();
      begin
        mouseOffClient(OFF_CLIENT_RANDOM);
        until tabBackpack.isEmpty) then
      end;

    or would that not solve it?
    No, there is still no loop. You have until but no repeat. You also don't need a then after until, just something equivalent to true or false.

    As for banking, I usually make it a function that returns a boolean and use if bank() then ... in my mainLoop

    There's something weird going on with your simba tags. Just put 'simba' in brackets and '/simba' also in brackets (no quotes)

  12. #12
    Join Date
    Mar 2015
    Posts
    189
    Mentioned
    3 Post(s)
    Quoted
    73 Post(s)

    Default

    Gratz on your first, script, looks nice for your first script maynn

  13. #13
    Join Date
    Aug 2014
    Posts
    172
    Mentioned
    2 Post(s)
    Quoted
    77 Post(s)

    Default

    Quote Originally Posted by evilcitrus View Post
    As J_R said, there is no loop and nothing written after then, so it will just run right though it. I prefer while do over repeat until in this situation
    Simba Code:
    procedure offerBones();
    begin
      mouseOffClient(OFF_CLIENT_LEFT);
      while (not tabBackPack.isEmpty()) do wait(500);
    end;
    You can improve your teleport function by replacing the static wait() with conversationBox.isOpen(waitTime)
    Simba Code:
    if conversationBox.isOpen(1000) then
      if conversationBox.selectOption(2) then
        wait(gaussRangeInt(3000, 3400);
    Can't seem to get the conversation box way your saying to work at all.

  14. #14
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    It should be something like
    Simba Code:
    procedure TeleportToBank();
    begin
      typeSend('2', false);
      if conversationBox.isOpen(1000) then
        if conversationBox.selectOption(2) then
          wait(gaussRangeInt(3000, 3400);
    end;

    Also, indentation should be

    Simba Code:
    procedure doSomething
    var
      i : integer;
    begin
      //code
    end;

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
  •