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
  • Rune essence leaving


    Neks

    Recommended Posts

    Hey,

    I'm currently working on my own little essence rune miner.

     

    Sadly i'm struggling about the portal usage.

    Most of the time GamoObjects.closest will not detect the Portal.

     

    I tried debugging with .all(item -> item.getName().equal(Portal))

     

    But the portal does not exists. If i'm walking manual and restart the script the detection works as well.

    My idea is to store all 4 Tiles and calculate the minimal distance to improve my object range.

     

    But ... it sounds really nasty.

     

    If anyone know a better way i will be happy to hear. Thanks.

     

     

    Edit:

     

    This is my current implementation of leaving runeessence.

     

    Portal canot be found randomly. If the script are not able to find the portal i'm also not able to find the portal on GameObjects.all().

     

    Could it be a bug?

    package DBMiner;
    
    import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.methods.container.impl.Inventory;
    import org.dreambot.api.methods.dialogues.Dialogues;
    import org.dreambot.api.methods.interactive.GameObjects;
    import org.dreambot.api.script.TaskNode;
    import org.dreambot.api.wrappers.interactive.GameObject;
    
    import javax.swing.text.html.parser.Entity;
    
    public class LeaveEssenceMine extends TaskNode {
    
        @Override
        public int priority() {
            return 4;
        }
        @Override
        public boolean accept() {
            return Inventory.isFull() && GameObjects.closest("Rune Essence") != null;
        }
    
        @Override
        public int execute() {
            if(Dialogues.canContinue()){
                Dialogues.continueDialogue();
            }
            GameObject portal = GameObjects.closest(item -> item.getName().equals("Portal"));
            if(portal == null)
            {
                portal =GameObjects.closest(item -> item.hasAction("Use"));
            }
            if(portal != null)
            {
                String[] action = portal.getActions();
                portal.interact();
            }
            return Calculations.random(3000);
        }
    }

     

    Edited by Neks
    Added code
    Link to comment
    Share on other sites

    I have now run the script longer and noticed that the error occurs sporadically in different instances of Rune Mine. GameObjects just doesn't seem to contain the elements.

    Link to comment
    Share on other sites

    2 hours ago, Neks said:

    I have now run the script longer and noticed that the error occurs sporadically in different instances of Rune Mine. GameObjects just doesn't seem to contain the elements.

    That's right.  These portals can be found as NPC when not a GameObject

    Link to comment
    Share on other sites

    Alright. Thank you very much!

     

    Edit: Tested your solution. Works as expected 👌 

    Edited by Neks
    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
    ×
    ×
    • 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.