jakealaka9 Posted December 21, 2018 Share Posted December 21, 2018 (edited) Hello, I'm still very new to OSBot coding, and I don't understand why my doing (inventory.interact("Use", "Tinderbox", "Logs")) only selects either logs or tinderbox, whichever comes first. Could someone explain? EDIT: Okay so I found a workaround, although I would still like original question answered. Also, now I'm having problems with what it returns. For some reason this doesn't seem to return false, so my player wont move. I decided I would just paste this snippet. I realize it's not made the best way it can be right now, so if you guys have any suggestions, feel free to add them. while(script.inventory.contains("Logs")) { if(!script.myPlayer().isAnimating()) { script.inventory.interact("Use", "Tinderbox"); if(!script.inventory.interact("Use", "Logs")) { if(!script.walking.walk(new Position(script.myPlayer().getX()+1, script.myPlayer().getY(), script.myPlayer().getZ()))) { if(!script.walking.walk(new Position(script.myPlayer().getX()-1, script.myPlayer().getY(), script.myPlayer().getZ()))) { if(!script.walking.walk(new Position(script.myPlayer().getX(), script.myPlayer().getY()+1, script.myPlayer().getZ()))) { script.walking.walk(new Position(script.myPlayer().getX(), script.myPlayer().getY()-1, script.myPlayer().getZ())); } } } } } MethodProvider.sleep(MethodProvider.random(300, 400)); Edited December 21, 2018 by jakealaka9 Link to comment Share on other sites More sharing options...
Reminiscence Posted December 21, 2018 Share Posted December 21, 2018 There's no method for interact (item1, action, item2). https://osbot.org/api/org/osbot/rs07/api/util/ItemContainer.html#interact-int-java.lang.String...- You should look into conditional sleeps. Use them between selecting the item and interacting, then sleeping until the action is done or no action is done for a set amount of time. I'm gonna go on a limb here and imagine you're working on a firemaking script. You should check for pre-existing fires in your current spot as well as the spot behind you, before even attempting to interact. Also, you'll need to make sure that you can actually walk to the tile. Link to comment Share on other sites More sharing options...
jakealaka9 Posted December 22, 2018 Author Share Posted December 22, 2018 Thank you, I have resolved my problems with some more workarounds and cleaned up my if statements. I don't know how to resolve a topic, I would if I knew how to. Link to comment Share on other sites More sharing options...
Juggles Posted December 22, 2018 Share Posted December 22, 2018 Glad to hear this was resolved. Closing thread. Link to comment Share on other sites More sharing options...