webpro 31 Posted February 10, 2013 Report Share Posted February 10, 2013 Is there a loop forever method ? I have some loops with long wait commands and i want the bot to work 24hrs/day, 7days/week Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted February 10, 2013 Report Share Posted February 10, 2013 set var = 0 loop while comparison var = 0 Quote Link to post Share on other sites
Brutal 164 Posted February 10, 2013 Report Share Posted February 10, 2013 Thanks BotGuru - I have always set mine to 99999 in the past. And here you go providing yet another simple direct solution! Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted February 10, 2013 Report Share Posted February 10, 2013 make sure to add a ui buttonthat on clicking it sets var to anything other then 0 so that you can stop it when you like 1 Quote Link to post Share on other sites
malefic 48 Posted February 10, 2013 Report Share Posted February 10, 2013 I always use: loop while > comparison > 1 = 1 Always a winner 1 Quote Link to post Share on other sites
Anonym 53 Posted February 10, 2013 Report Share Posted February 10, 2013 No need for comparisons. Just use $true , in the below case I just increase the value of #i so that you can see that it works. $true is always true so... ui stat monitor("i = ", #i)set(#i, 0, "Global")loop while($true) { increment(#i)} More efficient code this way and no need to slow it down with a comparison (you save a couple of clock cycles ). On the other hand, this will always be true and if you for some reason want to do a clean exit at some point then go ahead with the $comparison example and set #var to something else but 0. Voila! 1 Quote Link to post Share on other sites
webpro 31 Posted February 10, 2013 Author Report Share Posted February 10, 2013 Thanks guys !!!!!!!! Quote Link to post Share on other sites
webpro 31 Posted February 11, 2013 Author Report Share Posted February 11, 2013 No need for comparisons. Just use $true , in the below case I just increase the value of #i so that you can see that it works. $true is always true so... ui stat monitor("i = ", #i)set(#i, 0, "Global")loop while($true) { increment(#i)} More efficient code this way and no need to slow it down with a comparison (you save a couple of clock cycles ). On the other hand, this will always be true and if you for some reason want to do a clean exit at some point then go ahead with the $comparison example and set #var to something else but 0. Voila! I guess i don't understand the logic. I'm confused Here is what i have done as testing so far (i tried anonym $true idea but can't make it work either) ui button("Stop") { set(#loopforever, 1, "Global") } set(#loopforever, 0, "Global") loop while(#loopforever) { if($comparison(1, "=", 1)) { then { } else { navigate("http://www.imeetzu.com/", "Wait") wait(5) } } } Quote Link to post Share on other sites
webpro 31 Posted February 11, 2013 Author Report Share Posted February 11, 2013 I think i got it ui button("Stop") { set(#loopforever, 1, "Global") } set(#loopforever, 0, "Global") loop while($comparison(#loopforever, "=", 0)) { navigate("http://www.imeetzu.com/", "Wait") wait(3) } Guys, how would i use Anonym idea to make the script do less things with a working stop button ? Thanks EDITED: i THINK I GOT IT ui button("Stop") { set(#loopforever, 1, "Global") } set(#loopforever, 0, "Global") loop while($true) { if($comparison(#loopforever, "=", 1)) { then { stop script } else { } } navigate("http://www.imeetzu.com/", "Wait") wait(3) }but something odd is happening, when i try to go to the code view, it says to finish all nodes ??? When they are finished. In fact, i had to save the project, close down UB and reload it with the project so i could copy the code to paste it in here ? Anyways... Quote Link to post Share on other sites
nancy30 0 Posted February 18, 2013 Report Share Posted February 18, 2013 (edited) eitherfor(;; ){//put the code you want to loop forever here.}or int temp = 0;while (temp !=1){/*put the code you want to loop forever here.Make sure you never put temp = 1 in the code you put.*/} Edited February 18, 2013 by nancy30 Quote Link to post Share on other sites
blumi40 222 Posted February 18, 2013 Report Share Posted February 18, 2013 for?while?ubot?did i miss something ? 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.