Isolate Posted January 28, 2015 Share Posted January 28, 2015 (edited) ok so i if (x != null && !myPlayer().isMoving()) { log("Walking to x!"); map.walk(x); sleep(random(250, 350)); } clicks once whilst idol then the moment i start moving spams the hell out of the mini map and also if (!myPlayer().isAnimating()) { //Do something that causes it to animate //sleep } keeps spamming on doing the //Do something that causes it to animate //no sleep during animation. this is all in main loop. Edited January 28, 2015 by Isolate Link to comment Share on other sites More sharing options...
Khaleesi Posted January 28, 2015 Share Posted January 28, 2015 That weird Are you using latest version of osbot to start with? Mind putting the whole class in here? Khaleesi Link to comment Share on other sites More sharing options...
Isolate Posted January 28, 2015 Author Share Posted January 28, 2015 That weird Are you using latest version of osbot to start with? Mind putting the whole class in here? Khaleesi Found the problem anyways. Its just in the walking method itself, it appears to not return or move on until it reaches its destination. so once started it does go back to the top check it just loops the step method inside that method . Fixed it by alter a custom walking method to what i needed and naa I'd prefer people not to rip apart my code only based on the fact i might not follow conventions :P 1 Link to comment Share on other sites More sharing options...
Extreme Scripts Posted January 28, 2015 Share Posted January 28, 2015 Found the problem anyways. Its just in the walking method itself, it appears to not return or move on until it reaches its destination. so once started it does go back to the top check it just loops the step method inside that method . Fixed it by alter a custom walking method to what i needed and naa I'd prefer people not to rip apart my code only based on the fact i might not follow conventions Its always good to follow conventions and let people give you tips and feedback on how your code is structured. Use scripting as a learning curve (trust me it can be a huge one if you let it) not only as something to just do your work for you in RS. 1 Link to comment Share on other sites More sharing options...
Mysteryy Posted January 28, 2015 Share Posted January 28, 2015 Of course the first one spam clicks. You are telling your script to walk to x no matter what. If you added a check in there saying to only walk to x if your not already at x, then it would work. As for the second one, I'm guessing it's something with the code in the statement. Since you never post your code we can't help. ^_^ Link to comment Share on other sites More sharing options...
Isolate Posted January 28, 2015 Author Share Posted January 28, 2015 Its always good to follow conventions and let people give you tips and feedback on how your code is structured. Use scripting as a learning curve (trust me it can be a huge one if you let it) not only as something to just do your work for you in RS. I use conventions in class and sometimes i brush over a script and put them all in place i need to post but if everything runs well i wont bother, its just another thing to take up time. Of course the first one spam clicks. You are telling your script to walk to x no matter what. If you added a check in there saying to only walk to x if your not already at x, then it would work. As for the second one, I'm guessing it's something with the code in the statement. Since you never post your code we can't help. as stated the problem has been found. yes in my code there are other checks around the bit i posted but the whole time the walk method starts walking to the point it spams the spot, when it gets there the script continues as should its just that the osbot api has no check for if moving in its walking function that seems to be in play causing any check i do for walking to be nulled Link to comment Share on other sites More sharing options...
Mysteryy Posted January 28, 2015 Share Posted January 28, 2015 I use conventions in class and sometimes i brush over a script and put them all in place i need to post but if everything runs well i wont bother, its just another thing to take up time. as stated the problem has been found. yes in my code there are other checks around the bit i posted but the whole time the walk method starts walking to the point it spams the spot, when it gets there the script continues as should its just that the osbot api has no check for if moving in its walking function that seems to be in play causing any check i do for walking to be nulled You can add a check. There is a method to get your current minimap destination. For example, only click the next tile of you are < 4 tiles from the current destination. I made my own walker and used something like this in it. Link to comment Share on other sites More sharing options...
Isolate Posted January 28, 2015 Author Share Posted January 28, 2015 You can add a check. There is a method to get your current minimap destination. For example, only click the next tile of you are < 4 tiles from the current destination. I made my own walker and used something like this in it. Found the problem anyways. Its just in the walking method itself, it appears to not return or move on until it reaches its destination. so once started it does go back to the top check it just loops the step method inside that method . Fixed it by alter a custom walking method to what i needed Link to comment Share on other sites More sharing options...