Search the Community
Showing results for tags 'gameobject'.
-
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); } }
- 3 replies
-
- mining
- rune essence
-
(and 1 more)
Tagged with: