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
  • Try asking for help in the chatbox
  • Having trouble with a couple things please help


    LordOfWar1275
     Share

    Recommended Posts

    I’m trying to code a f2p rune essence mining script one of the problems I’m running into is the damn portal. It goes from being a gameObject to a NPC, I’ve tried using getNames and getID’. I’ve tried looking all over for prior forums, there’s a few here and there but nothing really specific. 
     

    Also, I’m unable to interact with the GameObject “Rune Essence” another pain in the ass. I’ve Also tried using the objects Tile #, ID#, RealD#, Flag# even Index#. I am fairly new but I do a lot of research before am reaching out to the community I’m at a standstill here lmfao. Thanks for the help in advance :)

    Link to comment
    Share on other sites

    What happens when you look at the rune essence block through the game debugger? It's possible there's a different game object that you're supposed to be interacting with.
    For the portal, when I made one (a really, really long time ago) I just checked for the game object, if it was null or not visible, I checked for the npc.
    Just make sure you're checking within a small distance, so you're not grabbing one in a different section. I believe tiles change in rune essence mine (not positive on that)

    Link to comment
    Share on other sites

    1 hour ago, Nuclear Nezz said:

    What happens when you look at the rune essence block through the game debugger? It's possible there's a different game object that you're supposed to be interacting with.
    For the portal, when I made one (a really, really long time ago) I just checked for the game object, if it was null or not visible, I checked for the npc.
    Just make sure you're checking within a small distance, so you're not grabbing one in a different section. I believe tiles change in rune essence mine (not positive on that)

    I ended up using the GameObject runeEsscence getID==#, strange I did that before asking for help. Lol. The script is working but it acts up on the Portal again tho, I checked if npc!=null and isOnScreen(); it just right clicks the portal and rotates the camera very violently. I even tried checking —

    if(npc!=null){
    getWorldHopper.hopWorlds(worlds[random]);

    /*^^^(worlds[random]) is a array stored with all f2p non requirements worlds, chosen randomly.*/

    }

    —even with that code,  the cursor will right click the portal but move just slightly down and misclick. It repeats that a few times swings the camera again and loops. 
     

    Link to comment
    Share on other sites

    I did see someone post this but idk how to use that 

    getWalking().getAStarPathFinder().addObstacle(new PassableObstacle("Obstacle name", "Action", null, null, null));
    Link to comment
    Share on other sites

    7 hours ago, LordOfWar1275 said:

    I did see someone post this but idk how to use that 

    getWalking().getAStarPathFinder().addObstacle(new PassableObstacle("Obstacle name", "Action", null, null, null));

    That doesnt work anymore.

    Link to comment
    Share on other sites

    39 minutes ago, Nex said:

    That doesnt work anymore.

    NPC portalNPC1 = getNpcs().closest(portal -> portal.getName().contains("<col=00efef>Portal</col>"));
    NPC portalNPC2 = getNpcs().closest(portal -> portal.getName().contains("<col=00ffff>Portal</col>"));
    if (portalNPC1 != null) {
        portalNPC1.isOnScreen();
        if (portalNPC1.distance()<1){
            getWalking().walk(portalNPC1);
            if (portalNPC1.hasAction("Use")){
                portalNPC1.interact("use");
            }
            else if (portalNPC1.hasAction("Exit")){
                portalNPC1.interact("Exit");
            }
        }
    }else if((portalNPC2!=null)){
        portalNPC2.isOnScreen();
        if(portalNPC2.distance()<1){
            getWalking().walk(portalNPC2);
            if(portalNPC2.hasAction("use")){
                portalNPC2.interact("use");
            }else if(portalNPC2.hasAction("Exit")){
                portalNPC2.interact("Exit");
            }
        }
    }

    This is my code, I have tried using a NPC filter as well but does the same thing. The "<col=00efef>Portal</col>" is what the GameDebugging menu gave me, although there are two different names when i jump servers hence the portalNPC2.  The GameObject portals work fine(they also have different #id)one portal is white the other is yellowish.

    I hate to be a burden, but if its possible someone can check this out and see if its just me or if its a bug in general?

    Link to comment
    Share on other sites

    1 hour ago, LordOfWar1275 said:
    NPC portalNPC1 = getNpcs().closest(portal -> portal.getName().contains("<col=00efef>Portal</col>"));
    NPC portalNPC2 = getNpcs().closest(portal -> portal.getName().contains("<col=00ffff>Portal</col>"));
    if (portalNPC1 != null) {
        portalNPC1.isOnScreen();
        if (portalNPC1.distance()<1){
            getWalking().walk(portalNPC1);
            if (portalNPC1.hasAction("Use")){
                portalNPC1.interact("use");
            }
            else if (portalNPC1.hasAction("Exit")){
                portalNPC1.interact("Exit");
            }
        }
    }else if((portalNPC2!=null)){
        portalNPC2.isOnScreen();
        if(portalNPC2.distance()<1){
            getWalking().walk(portalNPC2);
            if(portalNPC2.hasAction("use")){
                portalNPC2.interact("use");
            }else if(portalNPC2.hasAction("Exit")){
                portalNPC2.interact("Exit");
            }
        }
    }

    This is my code, I have tried using a NPC filter as well but does the same thing. The "<col=00efef>Portal</col>" is what the GameDebugging menu gave me, although there are two different names when i jump servers hence the portalNPC2.  The GameObject portals work fine(they also have different #id)one portal is white the other is yellowish.

    I hate to be a burden, but if its possible someone can check this out and see if its just me or if its a bug in general?

    GameObject portal = getGameObjects().closest(p -> p != null && p.getName().contains("Portal"));
    
    if (portal != null && portal.isOnScreen()) {
        if (portal.distance(getlocalplayer()) < 5) {                                  
            if (portal.hasAction("Use") && portal.interact("use")) {
               //sleep...
            } else {
                if (portal.interact("Exit")) {
                  // sleep..
                }
            }
        } else {
            if (m.getwalking().shouldWalk() {
                m.getwalking().walk(portal);
            }
        }
    }

    ^Didnt have IDE near so make sure to test it xD but u gonna want something like that

    Edited by Nex
    Link to comment
    Share on other sites

    48 minutes ago, Nex said:
    GameObject portal = getGameObjects().closest(p -> p != null && p.getName().contains("Portal"));
    
    if (portal != null && portal.isOnScreen()) {
        if (portal.distance(getlocalplayer()) < 5) {                                  
            if (portal.hasAction("Use") && portal.interact("use")) {
               //sleep...
            } else {
                if (portal.interact("Exit")) {
                  // sleep..
                }
            }
        } else {
            if (m.getwalking().shouldWalk() {
                m.getwalking().walk(portal);
            }
        }
    }

    ^Didnt have IDE near so make sure to test it xD but u gonna want something like that

    Still it’ll right click the portalNPC and slightly misclick underneath the widget header a few times 

    Link to comment
    Share on other sites

    On 5/10/2020 at 7:28 AM, Nex said:

    That doesnt work anymore.

    What do you mean that doesn't work anymore

     

    On 5/10/2020 at 11:06 AM, LordOfWar1275 said:

    Still it’ll right click the portalNPC and slightly misclick underneath the widget header a few times 

    Could you post a gif of what you're talking about?

    Link to comment
    Share on other sites

    1 hour ago, Nuclear Nezz said:

    What do you mean that doesn't work anymore

     

    Could you post a gif of what you're talking about?

    We spoke about that awhile ago about adding obstacles to walker n it was bork :^)

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    ×
    ×
    • 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.