VentureOnline 49 Posted June 26, 2012 Report Share Posted June 26, 2012 So I am developing a scheduler for a big bot I am creating. My issue is for some reason ubot is having issues doing math within a thread. If I run this script regularly it runs with no problems but once I put it into a thread and new browser it stops executing the math. Any help would be much appreciated. ui text box("Articles To Submit", #Articles) ui text box("Days", #Days) ui button("RunTimer") { thread { in new browser { wait($eval($multiply(#Days, 86400))) Timer() } } } define Timer { set(#Seconds, $eval($multiply(#Days, 86400)), "Global") set(#TimeBetweenSubmissions, $eval($divide(#Seconds, #Articles)), "Global") set(#ArticlesSubmitted, 0, "Global") set(#AmountofSecondsPassed, 0, "Global") loop(#Articles) { loop(#TimeBetweenSubmissions) { wait(1) increment(#AmountofSecondsPassed) } increment(#ArticlesSubmitted) navigate("http://www.success.com/", "Wait") } } Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted June 26, 2012 Report Share Posted June 26, 2012 Change your variables to local stead of global from the advanced area of the node. set(#Seconds, $eval($multiply(#Days, 86400)), "Local") set(#TimeBetweenSubmissions, $eval($divide(#Seconds, #Articles)), "Local") set(#ArticlesSubmitted, 0, "Global") set(#AmountofSecondsPassed, 0, "Local") Quote Link to post Share on other sites
VentureOnline 49 Posted June 26, 2012 Author Report Share Posted June 26, 2012 I went in and changed everything and I am still getting the same issue unfortunately. Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted June 26, 2012 Report Share Posted June 26, 2012 ui text box("Articles To Submit", #Articles) ui text box("Days", #Days) ui button("RunTimer") { set(#ArticlesSubmitted, 0, "Global") thread { in new browser { set(#AmountofSecondsPassed, 0, "Global") wait($eval($multiply(#Days, 86400))) Timer() } } } define Timer { set(#Seconds, $multiply(#Days, 86400), "Global") set(#TimeBetweenSubmissions, $divide(#Seconds, #Articles), "Global") loop(#Articles) { loop(#TimeBetweenSubmissions) { wait(1) increment(#AmountofSecondsPassed) } increment(#ArticlesSubmitted) navigate("http://www.success.com/", "Wait") } } Seems to work, but if you run more then 1 thread, then you will need to set the variables to local (which you cant see running in debugger when set to local) Quote Link to post Share on other sites
VentureOnline 49 Posted June 26, 2012 Author Report Share Posted June 26, 2012 Thanks for all your help. It seems to be working but for some reason the variables don't update. Ive added in after the "Success" navigation a save to file option. Which would save the position of all of the variables. That way if the bot crashed you could use the file to figure out where it left off. Any idea why the variables seem to be running correctly but I can't "see" or "print" them? Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted June 26, 2012 Report Share Posted June 26, 2012 i was able to watch and monitor them in debugger without an issue. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.