crazykid080 14 Share Posted December 19, 2020 So a problem I've been having with the script I'm building is that it doesn't seem to want to move the mouse at all. I've verified that the code flow is correct and does try to interact with the NPC, but the mouse does not move at all, I do have the easeMouse class in my project but I've tried it with and without it implemented. Not sure what other issue may be causing this Link to comment Share on other sites More sharing options...
Neffarion 486 Share Posted December 19, 2020 Without any code I doubt anyone can help you Link to comment Share on other sites More sharing options...
crazykid080 14 Author Share Posted December 19, 2020 There seems to be no code related to mouse movement except Client.getInstance().setMouseMovementAlgorithm(new EaseMouse()); After that the flow of code I have goes through steps that haven't caused issues in the past, but I've tried it commented and uncommented. One thing to mention though is that my main class also implements MouseListener for other purposes as well as extending TaskScript, but that didn't seem to cause any issues on my previous script. The last part of the code flow is NPC target = NPCs.closest(npc -> npc != null && !npc.isInCombat() && npc.getLevel() < getLocalPlayer().getLevel() && npc.hasAction("Attack")); if (target == null) { utils.debugString("Target not found."); sleepUntil(() -> Walking.walk(currArea.getRandomTile()), 15000); return utils.getSleepTime(); } utils.debugString("Has action \"attack\": " + target.hasAction("Attack")); utils.debugString("Trying to attack"); sleepUntil(() -> target.interact("Attack"), 5000); I have made sure to check that target is not null as well so that is not causing an issue Link to comment Share on other sites More sharing options...
Neffarion 486 Share Posted December 21, 2020 On 12/19/2020 at 11:30 PM, crazykid080 said: There seems to be no code related to mouse movement except Client.getInstance().setMouseMovementAlgorithm(new EaseMouse()); After that the flow of code I have goes through steps that haven't caused issues in the past, but I've tried it commented and uncommented. One thing to mention though is that my main class also implements MouseListener for other purposes as well as extending TaskScript, but that didn't seem to cause any issues on my previous script. The last part of the code flow is NPC target = NPCs.closest(npc -> npc != null && !npc.isInCombat() && npc.getLevel() < getLocalPlayer().getLevel() && npc.hasAction("Attack")); if (target == null) { utils.debugString("Target not found."); sleepUntil(() -> Walking.walk(currArea.getRandomTile()), 15000); return utils.getSleepTime(); } utils.debugString("Has action \"attack\": " + target.hasAction("Attack")); utils.debugString("Trying to attack"); sleepUntil(() -> target.interact("Attack"), 5000); I have made sure to check that target is not null as well so that is not causing an issue I wouldn't use sleepUntil's that way if I was you. Use an if on the interact and then use the sleepUntil until you are interacting with the npc Other than that, I would check if the npc exists before using the interact (target.exists()) If you already tried removing the mouse algorithm to the default then I suggest you clear the game cache (sometimes it can do weird stuff to the game). Should try to also debug using an IDE if everything else fails after that Link to comment Share on other sites More sharing options...
crazykid080 14 Author Share Posted December 21, 2020 Yeah seemed to be a cache problem, it was fixed when I decided to test it again today it worked. Trying to work on the logic to fix other issues I'm having, I'll keep your suggestions in mind Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.