Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Three problems with my script


    triblion

    Recommended Posts

    Posted

    I cannot get the script to bank, I have got a banking method set up and once its inventory is full it just sits there. I also cant get it to not run away from a rock if it isnt finished mining, after a set amount of time it will just leave it wether its done or not, I tried using animations to get it to stay there until its animation is stood still again. I also can't figure out how to get the bot to not mine Iron, I want it to mine copper and tin but it will mine iron, I can't find the API to get it to search for Irons ID and not mine that. I have tried w.getID c.getID and just getID, but non of them seem to be a thing any help would be much appreciated.

     

     

     

     

    CODE:

    http://pastebin.com/gsvAgEvG

    Posted

    I cannot get the script to bank, I have got a banking method set up and once its inventory is full it just sits there. I also cant get it to not run away from a rock if it isnt finished mining, after a set amount of time it will just leave it wether its done or not, I tried using animations to get it to stay there until its animation is stood still again. I also can't figure out how to get the bot to not mine Iron, I want it to mine copper and tin but it will mine iron, I can't find the API to get it to search for Irons ID and not mine that. I have tried w.getID c.getID and just getID, but non of them seem to be a thing any help would be much appreciated. [\quote]

     

    A. You have it set to run to mining area when inventory is not full. This should not be there.

    B. You never tell it to walk to bank area. Do this in the bank method in a similar way you walked to the mining area.

     

    I think these should solve the problems.

    Posted

    I cannot get the script to bank, I have got a banking method set up and once its inventory is full it just sits there. I also cant get it to not run away from a rock if it isnt finished mining, after a set amount of time it will just leave it wether its done or not, I tried using animations to get it to stay there until its animation is stood still again. I also can't figure out how to get the bot to not mine Iron, I want it to mine copper and tin but it will mine iron, I can't find the API to get it to search for Irons ID and not mine that. I have tried w.getID c.getID and just getID, but non of them seem to be a thing any help would be much appreciated. [\quote]

     

    A. You have it set to run to mining area when inventory is not full. This should not be there.

    B. You never tell it to walk to bank area. Do this in the bank method in a similar way you walked to the mining area.

     

    I think these should solve the problems.

    Hahaha, thanks I edited it to walk to the banking area I accidentally put miningArea instead of Bankingarea in the banking method. Do you know how I can get it to stop running away from ore and not mine iron?

    Posted

    Hahaha, thanks I edited it to walk to the banking area I accidentally put miningArea instead of Bankingarea in the banking method. Do you know how I can get it to stop running away from ore and not mine iron?

    Its running away because you have it walking to bank area at all times. Any time the inventory isnt full

    Posted

    Its running away because you have it walking to bank area at all times. Any time the inventory isnt full

    But it does not run to the bank it runs away from the ore to mine another ore

    Posted
            GameObject rock = getGameObjects().closest(GameObject -> GameObject != null && GameObject.getName().equals(nameOfRock));
    

    ur nameOfCock is set to "Rocks", so of course its gonna mine iron, since the name of it is Rocks, you can do getID == blah blah

    Posted
            GameObject rock = getGameObjects().closest(GameObject -> GameObject != null && GameObject.getName().equals(nameOfRock));
    

    ur nameOfCock is set to "Rocks", so of course its gonna mine iron, since the name of it is Rocks, you can do getID == blah blah

     

    I knew that it would mine Iron because it's called rocks. I didnt know how to use getID() as every time I used it it would say cannot be used with an int. I will try this thank you.

     

    EDIT: It still says whenever I try getID() in any form it will tell me you cant use this with an int

     

     

    Ones I have tried

     

     

    if(getID() == 7895) {

    !mineRock();

    }

     

    if(GameObject.getId() == 7895 {

    !mineRock();

    }

     

    if(GameObect.getId(==7895) {

    !mineRock();

    }

     

    if(GameObject.getID(7895) {

    !mineRock();

    }

     

    if(GameObject.getID(==7895) {

    !mineRock();

    }

     

    if(GameObject.getID(=7895) {

    !mineRock();

    }

     

     

    Posted

    I knew that it would mine Iron because it's called rocks. I didnt know how to use getID() as every time I used it it would say cannot be used with an int. I will try this thank you.

     

    EDIT: It still says whenever I try getID() in any form it will tell me you cant use this with an int

     

     

    Ones I have tried

     

     

    if(getID() == 7895) {

    !mineRock();

    }

     

    if(GameObject.getId() == 7895 {

    !mineRock();

    }

     

    if(GameObect.getId(==7895) {

    !mineRock();

    }

     

    if(GameObject.getID(7895) {

    !mineRock();

    }

     

    if(GameObject.getID(==7895) {

    !mineRock();

    }

     

    if(GameObject.getID(=7895) {

    !mineRock();

    }

     

     

    Well you aren't writing the code correctly, t hat syntax is wrong lol.

     

    Before you start writing script, look up some basic java syntax and watch a few videos on it.

    Posted


    GameObject rock = getGameObjects().closest(obj -> obj != null && obj.getId() != 12345); // insert iron ore ID here, you can use the debugger I believe to find the id. or just have a log statement to get the ID of it.

     

    Posted
    GameObject rock = getGameObjects().closest(obj -> obj != null && obj.getId() != 12345); // insert iron ore ID here, you can use the debugger I believe to find the id. or just have a log statement to get the ID of it.
    

    I shall try this when I get home thank you, just needed the syntax for it because I couldnt find it anywhere

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.