June 13, 20178 yr New to scripting, got most of it down pat, can't seem to figure out how to stop my script from clicking a tree at least five times or so before it will begin cutting. Everything else seems to be fine. Any help/criticism is welcome https://pastebin.com/UA1uGd37
June 13, 20178 yr 10 minutes ago, Angelclaw said: New to scripting, got most of it down pat, can't seem to figure out how to stop my script from clicking a tree at least five times or so before it will begin cutting. Everything else seems to be fine. Any help/criticism is welcome https://pastebin.com/UA1uGd37 You need to run a ConditionalSleep until the player is chopping the tree. Read section 9 of my tutorial: https://osbot.org/forum/topic/115124-explvs-scripting-101/ Edited June 13, 20178 yr by Explv
June 13, 20178 yr What Explv said and rewrite your getState() a little. Check if the bot is animating before interacting with the tree (or put myPlayer().isAnimating() is a conditionalSleep) and not in getState()
June 14, 20178 yr Author 9 hours ago, nosepicker said: What Explv said and rewrite your getState() a little. Check if the bot is animating before interacting with the tree (or put myPlayer().isAnimating() is a conditionalSleep) and not in getState() so i should just rewrite the whole getState? Or is there a simply way of just changing one line of code.
June 14, 20178 yr 7 hours ago, Angelclaw said: so i should just rewrite the whole getState? Or is there a simply way of just changing one line of code. Writing something simple like this should do the trick public State getState() { if (inventory.isFull()) { return State.BANK; else { return State.CUT; } } Could also add more states for walking back and forth. Check the !myPlayer.isAnimating() before cutting a tree. I recommend reading Explvs tutorial first if having trouble. Edited June 14, 20178 yr by nosepicker