BeepBoopBop 9 Share Posted June 4, 2022 I've been working on a blast mining script lately, but I'm getting extremely common misclicks even when my character/camera isn't moving. Any delay or re-interaction will slow the script down, potentially resulting in one of the blasts hitting my character. There are three cases that I've noticed a majority of the misclicks happening. First, the most common. Script is told to click on the rock in the green area, but it chooses to click on the hovered object about a third of the time: Second, also around a tenth of the time: And finally, the script will very frequently click on the man (while being told to click on the ore sack behind him) The issue isn't only here, though. In my private blast furnace script, it will commonly misclick the conveyor belt and click an NPC nearby, which is the exact same issue reported in Hashtag's script, despite being programmed by two entirely different people. I'm fine with programming redundancy and correcting, but it's really eating into the efficiency of some of my scripts. Let me know if videos would be better. Link to comment Share on other sites More sharing options...
Pandemic 2731 Share Posted June 4, 2022 How exactly are you interacting with the object? Could you show a minimal example that I could use to replicate? Link to comment Share on other sites More sharing options...
BeepBoopBop 9 Author Share Posted June 4, 2022 Just using the normal .interact. I would use getCenterPoint with custom logic, but it doesn't really work here with the model shape :(. Here's a minimal reproducible script for the first case. Every once in a while, you'll undershoot and hit the incorrect rock. Set up your guy in the NW corner of the blast mine, compass due north, around the angle of the screenshot in the OP. PM me if you need an acc. Don't mind sharing password and changing it, if you need one. import org.dreambot.api.input.Mouse; import org.dreambot.api.methods.MethodProvider; import org.dreambot.api.methods.interactive.GameObjects; import org.dreambot.api.methods.interactive.Players; import org.dreambot.api.methods.map.Tile; import org.dreambot.api.methods.walking.impl.Walking; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.wrappers.interactive.GameObject; import java.util.List; @ScriptManifest(name = "Acc Interactor Test", description = "Testing interact accuracy", author = "BeepBoopBop", version = 1.0, category = Category.MINING, image = "") public class Main extends AbstractScript { enum AccState { MOVING, CLICKING, WAITING, } Tile testingTile = new Tile(1468, 3883); AccState getState() { GameObject testingRock = getRockAtTile(getTileForRock(5)); if (!Players.localPlayer().getTile().equals(testingTile)) { return AccState.MOVING; } else if (testingRock == null || !testingRock.exists()) { return AccState.WAITING; } else { return AccState.CLICKING; } } @Override public int onLoop() { AccState state = getState(); if (state == AccState.CLICKING) { GameObject hoverRock = getRockAtTile(getTileForRock(3)); GameObject testingRock = getRockAtTile(getTileForRock(5)); if (hoverRock != null && testingRock != null) { Mouse.move(hoverRock.getClickablePoint()); MethodProvider.sleep(500); if (testingRock.interact("Excavate")) { MethodProvider.sleep(10000); MethodProvider.log("Excavate successful"); } else { MethodProvider.log("Failed"); } } } else if (state == AccState.MOVING) { Walking.walkOnScreen(testingTile); MethodProvider.sleepUntil(() -> Players.localPlayer().getTile().equals(testingTile), 3000); } else if (state == AccState.WAITING) { return 1000; } return 100; } // Overcomplicated functions below - copied from actual script. private Tile getTileForRock(int rockNumber) { if (rockNumber == 1) return new Tile(1473, 3885); else if (rockNumber == 2) return new Tile(1471, 3886); else if (rockNumber == 3) return new Tile(1467, 3883); else if (rockNumber == 4) return new Tile(1468, 3884); else if (rockNumber == 5) return new Tile(1470, 3886); else return new Tile(1469, 3885); } private GameObject getRockAtTile(Tile t) { List<GameObject> rocks = GameObjects.all(obj -> obj.getName().equals("Hard rock") && obj.getTile().equals(t)); if (rocks.size() == 0) return null; else return rocks.get(0); } } Link to comment Share on other sites More sharing options...
Pandemic 2731 Share Posted June 5, 2022 Before testing on your account, could you double check via logging that the rock you're interacting with is the one you're trying to and it's not accidentally trying to interact with the one it's clicking on? Also are you running at a limited FPS by chance? I believe that increases the chance of a misclick. Link to comment Share on other sites More sharing options...
BeepBoopBop 9 Author Share Posted June 5, 2022 (edited) See the interacted-with wall (now a cavity) that happens after attempting to interact with a rock at a different tile. Based on a very small amount of testing, it might be more likely the more zoomed-out you are. CPU saver is not on Edited June 5, 2022 by BeepBoopBop times in picture Link to comment Share on other sites More sharing options...
420x69x420 72 Share Posted June 5, 2022 I also find that the standard interact() API calls are prone to misclicks but I always run low FPS anyways. If I need fast and precise clicking then I do what you said earlier with redundancy and correcting, using other API calls getting convex hull, and checking the right-click menu etc: import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.dreambot.api.input.Mouse; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.MethodProvider; import org.dreambot.api.methods.container.impl.equipment.Equipment; import org.dreambot.api.methods.interactive.GameObjects; import org.dreambot.api.methods.interactive.Players; import org.dreambot.api.methods.map.Area; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.wrappers.interactive.Player; import org.dreambot.api.wrappers.widgets.Menu; import org.dreambot.api.wrappers.widgets.MenuRow; @ScriptManifest(name = "#360NoScope-paint-er", author = "Dreambotter420", version = 0.01, category = Category.MISC, image = "lFwvTuW.jpg") public class Tester extends AbstractScript { @Override public void onStart(String[] i) { MethodProvider.log("Script start!"); } String targetName = null; @Override public int onLoop() { if(Equipment.contains("Event rpg")) { if(GameObjects.closest("Altar") != null && GameObjects.closest("Incense burner") != null) { Area altarClose = GameObjects.closest("Altar").getTile().getArea(2); Player target = Players.closest(targetName); if(target == null || !target.exists() || targetName == null || !altarClose.contains(target)) { List<Player> closestPlayers = new ArrayList<Player>(); for(Player p : Players.all()) { if(altarClose.contains(p)) { closestPlayers.add(p); } } if(!closestPlayers.isEmpty()) { Collections.shuffle(closestPlayers); target = closestPlayers.get(0); } } if(target != null && target.exists()) { //Right-click menu is open if(Menu.isVisible()) { //Mouse is already positioned on correct MenuAction so just click if(Menu.isMouseOnAction("360NoScope-paint")) { Mouse.click(); } else { //at this point if the action is 360noscope-paint, I don't care if it is actually the target entity anymore so just click topmost instead if(Menu.contains("360NoScope-paint")) { for(MenuRow actionRow : Menu.getMenuRows()) { if(actionRow.getAction().contains("360NoScope-paint")) { Menu.clickAction(actionRow.getAction(),actionRow.getObject(),actionRow.getID()); return Calculations.random(55, 111); } } } else { Menu.close(); } } } else { //mouse is already inside hull bounds of target so just click if(target.getModel().getHullBounds().contains(Mouse.getPosition())) { Mouse.click(true); return Calculations.random(55, 111); } else { Mouse.move(target); return Calculations.random(55, 111); } } } } } return Calculations.random(55, 222); } } Link to comment Share on other sites More sharing options...
BeepBoopBop 9 Author Share Posted June 5, 2022 Ah, wasn't aware of "getHullBounds().contains()". I'll give that a shot in a custom interaction event. Thanks! 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