mr magoo Posted October 21, 2017 Share Posted October 21, 2017 something as simple as: if (getBank().isOpen() { getBank().depositAll(itemID); } Seems to run into problems. It SEEMS to click twice very quickly: it right clicks on the item once, begins to move, and then right clicks again all in a very short time frame. The second click is not on an item and thus does not have a deposit-all option, so the bot stutters, and then goes to attempt the deposit again (which at this point works 100% of the time as far as I'm aware). This is rather frustrating though. I'm not sure if it's a bug or if it's intended but it's a considerable problem when it comes to doing multithreaded processes. I've noticed this issue of double clicking very blatantly in other projects, but now I've run into a stand still for this project due to the problem and will likely stop developing for this platform unless it turns out it's actually a problem on my end, which is my reason for this post. Does this also happen to you? Considering the situation has appeared in numerous projects of mine I'm lead to believe it's not due to something I've done. Quote Link to comment Share on other sites More sharing options...
whipz Posted October 21, 2017 Share Posted October 21, 2017 you arent using sleeps ? Quote Link to comment Share on other sites More sharing options...
liverare Posted October 21, 2017 Share Posted October 21, 2017 Computers do stuff very quick like. Before you can blink, the computer's already spun around in circles 1000s of times. You gotta tell your computer to slow down, brah. 2 Quote Link to comment Share on other sites More sharing options...
mr magoo Posted October 21, 2017 Author Share Posted October 21, 2017 (edited) Of course I use sleep. Unless you're unaware the onLoop method must return an integer value for the script to wait. In what manner would using a sleep stop the one line of code I provided to stop executing twice in rapid succession? It gets called only a maximum of once per execution of onloop, but per observation it very obviously executes more than once per execution of onLoop. This is the problem. Consider the problem in a vacuum. If the mouse is located ontop of a prayer, and if every iteration of onLoop consisted of left clicking once, sleeping for x amount of time, left clicking again (that is, turning the prayer on and then off), and then sleeping for 5 seconds, there would occasionally be an instance where each click would register twice. The outcome is effectively the same, but the problem is there. This is a simplified version of the problem but this scenario has appeared often. Edited October 22, 2017 by mr magoo Quote Link to comment Share on other sites More sharing options...
whipz Posted October 22, 2017 Share Posted October 22, 2017 1 minute ago, mr magoo said: Of course I use sleep. Unless you're unaware the onLoop method must return an integer value for the script to wait. In what manner would using a sleep stop the one line of code I provided to stop executing twice in rapid succession? It gets called only a maximum of once per execution of onloop, but per observation it very obviously executes more than once per execution of onLoop. This is the problem. conditional sleep, whats your return at the end of the loop, like 500ms Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted October 22, 2017 Share Posted October 22, 2017 20 minutes ago, mr magoo said: Of course I use sleep. Unless you're unaware the onLoop method must return an integer value for the script to wait. In what manner would using a sleep stop the one line of code I provided to stop executing twice in rapid succession? It gets called only a maximum of once per execution of onloop, but per observation it very obviously executes more than once per execution of onLoop. This is the problem. Consider the problem in a vacuum. If the mouse is located ontop of a prayer, and if every iteration of onLoop consisted of left clicking once, sleeping for x amount of time, left clicking again (that is, turning the prayer on and then off), and then sleeping for 5 seconds, there would occasionally be an instance where each click would register twice. The outcome is effectively the same, but the problem is there. This is a simplified version of the problem but this scenario has appeared often. It's like you can check boolean values and use certain sleep classes to sleep until they've executed succesfully. Quote Link to comment Share on other sites More sharing options...
mr magoo Posted October 22, 2017 Author Share Posted October 22, 2017 It's like you're trying to be helpful but your reading comprehension isn't up for it. Quote Link to comment Share on other sites More sharing options...
d0zza Posted October 22, 2017 Share Posted October 22, 2017 58 minutes ago, mr magoo said: It's like you're trying to be helpful but your reading comprehension isn't up for it. Lol brah you're arguing with people that are scripter rank. Look into implementing sleeps cause obviously your code isn't working the way you intend. 1 Quote Link to comment Share on other sites More sharing options...
Chikan Posted October 22, 2017 Share Posted October 22, 2017 (edited) I'll throw my 2 cents in here and mention: Take a read through that, implement some of into your script. You need some better sleep timing guy. Edited October 22, 2017 by Chikan Quote Link to comment Share on other sites More sharing options...