April 22, 20178 yr I have used this syntax before but for some reason this isn't working. It never gets beyond the second interact and then it loops back and starts again never making any shells. script.inventory.getItem("Pie dish").interact("Use"); Script.sleep(Script.random(2000, 3000)); script.inventory.getItem("Pastry dough").interact("Use"); Script.sleep(Script.random(800, 1500)); script.log("debug 1"); It never gets to writing to the log (or any other action I put there). Any idea what I am doing wrong?
April 22, 20178 yr Author 1 minute ago, raijin said: interact item1 if inventory.isitemselected interact item 2 try that I should have added that the second interact is definitely working, the "How many would you like to make?" window appears. But after that nothing, the debug never shows in the log it just waits till the next loop and starts the interacts again.
April 22, 20178 yr 16 minutes ago, sudoinit6 said: I should have added that the second interact is definitely working, the "How many would you like to make?" window appears. But after that nothing, the debug never shows in the log it just waits till the next loop and starts the interacts again. dont u gotta like, make it do the window
April 22, 20178 yr Try and write your script such that they are never relying on a method to execute correctly - as you're writing scripts for a live game, issues like latency drops and disconnects mean you can never fully rely on a method to correctly execute fully every time. To combat this, try and make your script more conditional, i.e if this then do that etc. Hopefully then it will be easier to debug
April 28, 20178 yr On 4/22/2017 at 6:23 PM, sudoinit6 said: I have used this syntax before but for some reason this isn't working. It never gets beyond the second interact and then it loops back and starts again never making any shells. script.inventory.getItem("Pie dish").interact("Use"); Script.sleep(Script.random(2000, 3000)); script.inventory.getItem("Pastry dough").interact("Use"); Script.sleep(Script.random(800, 1500)); script.log("debug 1"); It never gets to writing to the log (or any other action I put there). Any idea what I am doing wrong? Your script isn't sleeping as far as I can tell, even though it shouldn't matter because InteractionEvent takes care of that for you. Although it doesn't solve your issue, make Script.sleep -> script.sleep.
April 28, 20178 yr On 4/22/2017 at 11:23 PM, sudoinit6 said: I have used this syntax before but for some reason this isn't working. It never gets beyond the second interact and then it loops back and starts again never making any shells. script.inventory.getItem("Pie dish").interact("Use"); Script.sleep(Script.random(2000, 3000)); script.inventory.getItem("Pastry dough").interact("Use"); Script.sleep(Script.random(800, 1500)); script.log("debug 1"); It never gets to writing to the log (or any other action I put there). Any idea what I am doing wrong? What I would do is start by structuring your script so that if an event fails at anytime, it will simply retry that action only, not the whole loop again (as @Apaec suggested): if (!inventory.isItemSelected()) { // Use first item // Sleep until inventory.isSelected() } else { // Use first item with second item // Sleep until finished making pie shell } Here is a full example taken from my AIO Herblore script: if (!script.inventory.isItemSelected()) { Item pestle = script.inventory.getItem("Pestle and mortar"); if (pestle != null) { if (pestle.interact("Use")) { Sleep.sleepUntil(() -> script.inventory.isItemSelected(), 5000); } } } else { int clickSlot = script.inventory.getSlot(itemToGrind); InventorySlotDestination itemSlot = new InventorySlotDestination(script.getBot(), clickSlot); script.getMouse().move(itemSlot); if (script.getMouse().click(false)) { Sleep.sleepUntil(() -> !script.inventory.contains(itemToGrind) || script.getDialogues().isPendingContinuation(), 120000); } } Edited April 28, 20178 yr by harrypotter
Create an account or sign in to comment