Neks 0 Share Posted March 15 (edited) 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 March 15 by Neks Added code Link to comment Share on other sites More sharing options...
Neks 0 Author Share Posted March 15 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 More sharing options...
xyz111 9 Share Posted March 15 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 Neks 1 Link to comment Share on other sites More sharing options...
Neks 0 Author Share Posted March 18 (edited) Alright. Thank you very much! Edit: Tested your solution. Works as expected 👌 Edited March 18 by Neks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now