krypt1c 3 Posted February 20, 2021 public void makeUncookedPizza() { if (Inventory.interact("Tomato", "Use")) { sleep(Calculations.random(5000, 10000)); if (Inventory.slotInteract(1, "Use")) { sleep(Calculations.random(5000, 10000)); Keyboard.type(" "); sleep(Calculations.random(10000, 15000)); if (Inventory.interact("Cheese", "Use")) { sleep(Calculations.random(5000, 10000)); if (Inventory.slotInteract(1, "Use")) { sleep(Calculations.random(5000, 10000)); Keyboard.type(" "); sleep(Calculations.random(10000, 15000)); } } } } } Title says pretty much all, sometimes the bot will eat the tomato instead of using it. I assume its because either the "Use" is really close to the "Eat" interaction, or the bot is going too fast. Is there anyway to make it so the bot doesn't eat the tomato? been driving me crazy lol
krypt1c 3 Author Posted February 20, 2021 2 hours ago, Hashtag said: There is no "Use" action on items. You need to use Item#useOn what do you mean by there is no "Use" action on items?
Hashtag 9071 Posted February 20, 2021 Oh, sorry about that. I just woke up, lol. Regardless, you should use the useOn method in Item class.
NovaGTX 106 Posted February 20, 2021 if(Inventory.get("Tomato").useOn(Inventory.get("Cheese"))) { sleepUntil(() -> Widgets.getWidgetChild(0,0) != null && Widgets.getWidgetChild(0,0).isVisible(), Calculations.random(2000, 5000)); } Replace the zeros with the correct widgets for the make all interface and handle the wait for making the rest. I'd recommend looking into onItemChange function from the Inventorylistener class if it's not depreciated. I haven't scripted since DB2 lol
krypt1c 3 Author Posted February 20, 2021 2 hours ago, NovaGTX said: if(Inventory.get("Tomato").useOn(Inventory.get("Cheese"))) { sleepUntil(() -> Widgets.getWidgetChild(0,0) != null && Widgets.getWidgetChild(0,0).isVisible(), Calculations.random(2000, 5000)); } Replace the zeros with the correct widgets for the make all interface and handle the wait for making the rest. I'd recommend looking into onItemChange function from the Inventorylistener class if it's not depreciated. I haven't scripted since DB2 lol Gotcha, thanks man
Recommended Posts
Archived
This topic is now archived and is closed to further replies.