DylanSRT Posted September 26, 2018 Share Posted September 26, 2018 In my scripts, I have found that hover-clicking is much more reliable than interact when you want to use a left click action (primarily for an item in the inventory). I was just curious if anyone else has noticed this or knows why this happens. For example, let's say we are making a script for repeatedly using pestle and mortar on an Herblore secondary. inventory.interact("Use","Pestle & mortar"); inventory.interact("Use","Chocolate bar"); The code above, which seems the most straightforward will eventually misclick. The only way to stop it from misclicking is to put an unnecessarily long sleep in between (somewhere around 500ms). Whereas the code below never misclicks (even without sleeps) and runs extremely fast. inventory.getItem("Pestle & mortar").hover(); mouse.click(false); inventory.getItem("Chocolate bar").hover(); mouse.click(false); I was just curious as to why hover-click is more reliable? I would assume the interact method is derived from some sort of hover + click. Quote Link to comment Share on other sites More sharing options...
z10n Posted September 26, 2018 Share Posted September 26, 2018 (edited) Your correct, hover, then click ensures proper sleep within the hover itself. However, does mouse.click(false) doesnt that mean dont click? True = click yes? * inventory.getItem("Pestle & mortar").hover(); mouse.click(false); The transition from hover to click is the sleep. Edited September 26, 2018 by z10n Quote Link to comment Share on other sites More sharing options...
Juggles Posted September 26, 2018 Share Posted September 26, 2018 It will misclick because you're not checking if the item is selected before clicking next... if (!itemIsSelected) { inventory.interact("Use","Pestle and mortar"); sleepCondition return itemIsSelected(); } else { inventory.interact("Use","Pestle and mortar"); sleepCondition return inDialogue(); } This is the proper way to do it so that you won't misclick or bugs won't occur. If you don't check and have sleeps then it will misclick Quote Link to comment Share on other sites More sharing options...
Eagle Scripts Posted September 26, 2018 Share Posted September 26, 2018 38 minutes ago, z10n said: Your correct, hover, then click ensures proper sleep within the hover itself. However, does mouse.click(false) doesnt that mean dont click? True = click yes? * inventory.getItem("Pestle & mortar").hover(); mouse.click(false); The transition from hover to click is the sleep. The boolean value represents whether it should right-click or not. 2 Quote Link to comment Share on other sites More sharing options...