iamddr 12 Posted November 27, 2015 Report Share Posted November 27, 2015 Im new here and I used loop a lot, just wonder what did you guys do when you need a break/continue operation. Quote Link to post Share on other sites
pash 504 Posted November 27, 2015 Report Share Posted November 27, 2015 Im new here and I used loop a lot, just wonder what did you guys do when you need a break/continue operation. If you have a large amount of code you need to place several check points. on load("Bot Loaded") { set(#Running,$false,"Global") } ui button("Start") { if($not(#Running)) { then { Run() } else { } } } ui button("Pause") { set(#LoopPause,$true,"Global") } ui button("Resume") { set(#LoopPause,"false","Global") } set(#LoopPause,"true","Global") ui button("Stop") { set(#Stop,$true,"Global") set(#Running,"false","Global") } ui stat monitor("Number: ",#Num) define Run { set(#Running,"true","Global") set(#LoopPause,$false,"Global") set(#Num,0,"Global") set(#Stop,"false","Global") loop(10) { PauseCheckPoint() wait(1) increment(#Num) PauseCheckPoint() } set(#Running,"false","Global") } define PauseCheckPoint { if(#Stop) { then { stop script } } loop while(#LoopPause) { wait(1) } } 2 Quote Link to post Share on other sites
iamddr 12 Posted November 28, 2015 Author Report Share Posted November 28, 2015 If you have a large amount of code you need to place several check points. on load("Bot Loaded") { set(#Running,$false,"Global") } ui button("Start") { if($not(#Running)) { then { Run() } else { } } } ui button("Pause") { set(#LoopPause,$true,"Global") } ui button("Resume") { set(#LoopPause,"false","Global") } set(#LoopPause,"true","Global") ui button("Stop") { set(#Stop,$true,"Global") set(#Running,"false","Global") } ui stat monitor("Number: ",#Num) define Run { set(#Running,"true","Global") set(#LoopPause,$false,"Global") set(#Num,0,"Global") set(#Stop,"false","Global") loop(10) { PauseCheckPoint() wait(1) increment(#Num) PauseCheckPoint() } set(#Running,"false","Global") } define PauseCheckPoint { if(#Stop) { then { stop script } } loop while(#LoopPause) { wait(1) } }Terrific! Thanks for your replay, I just browsed the plugins that you've built for ubot. I think they were hardcore coder's work. 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.