steve498 Posted October 17, 2015 Share Posted October 17, 2015 (edited) As part of the Osbot Item API: public boolean hover() Description copied from interface: Interactable Attempts to hover the mouse over the next click needed to interact with this Interactable. This method will never click the mouse, so it can be used to speed up scripts while they are idling. Could somebody give me an example of how you would implement this? I am trying to make the script hover the user's mouse over the next log to increase the script's burn speed. This is my current item interaction method. private boolean interactItems(String itemOne, String itemTwo) throws InterruptedException { if (inventory.getItem(itemOne).interact("use")) { sleep(random(600,700)); return inventory.getItem(itemTwo).interact(); } return false; } Thanks. Edit: I'm assuming I'll be needing the mouse method so I will change my interact method accordingly. Edited October 17, 2015 by steve498 Quote Link to comment Share on other sites More sharing options...
Woody Posted October 17, 2015 Share Posted October 17, 2015 Item item = getInventory().getItem("blah"); item.hover(); You could do some checks to see if the mouse is within the item's bounding box; if not do hover else already hovering item. 1 Quote Link to comment Share on other sites More sharing options...
steve498 Posted October 17, 2015 Author Share Posted October 17, 2015 Item item = getInventory().getItem("blah"); item.hover(); You could do some checks to see if the mouse is within the item's bounding box; if not do hover else already hovering item. Thanks exactly what I was looking for. Quote Link to comment Share on other sites More sharing options...
steve498 Posted October 17, 2015 Author Share Posted October 17, 2015 (edited) Sorry for double post, so just an update, I currently have this: if(getInventory().contains(itemOne) && getInventory().contains(itemTwo)) { // Inventory locations of both items Item firstItem = getInventory().getItem(itemOne); Item secondItem = getInventory().getItem(itemTwo); // Use items on eachother firstItem.interact("use"); sleep(random(300, 430)); secondItem.interact(); // If a fire is below us then we need drop control of the mouse. Otherwise, a mouse conflict will occur. However, if a fire is not below us then we can pre-hover over the next item. if (IsFireBelowUs() == false) { sleep(random(550, 600)); firstItem.interact("use"); } } Although this it works fine, half way through an inventory of interacting it will stop pre-hovering on the next item. Any ideas? Thanks Edited October 17, 2015 by steve498 Quote Link to comment Share on other sites More sharing options...
Joseph Posted October 17, 2015 Share Posted October 17, 2015 The logic is wrong Quote Link to comment Share on other sites More sharing options...
steve498 Posted October 17, 2015 Author Share Posted October 17, 2015 The logic is wrong I was thinking this too. I will plan it out later and revise it. Quote Link to comment Share on other sites More sharing options...
Woody Posted October 17, 2015 Share Posted October 17, 2015 (edited) Yea, your logic is wrong. Try to learn what boolean really is and you should do some null checks (check if item != null etc.). You should also learn how to use dynamic sleep instead of static sleep. How do you know that the script should sleep between 300 and 430 ms. Why 130 ms in difference? For dynamic sleep use api's ConditionalSleep. Edited October 17, 2015 by Woody Quote Link to comment Share on other sites More sharing options...
steve498 Posted October 17, 2015 Author Share Posted October 17, 2015 Yea, your logic is wrong. Try to learn what boolean really is and you should do some null checks (check if item != null etc.). You should also learn how to use dynamic sleep instead of static sleep. How do you know that the script should sleep between 300 and 430 ms. Why 130 ms in difference? For dynamic sleep use api's ConditionalSleep. Thanks I appreciate the help Quote Link to comment Share on other sites More sharing options...