namstery21 3 Posted April 29, 2017 Report Share Posted April 29, 2017 If I want to save every 100, 200, 300, 400, then what can I use for that?When I use comparison, I can use comparison = 100, then save else blank..But how can I set every 100 counting then logic? Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted April 29, 2017 Report Share Posted April 29, 2017 Here's a sample code set(#position,1,"Global") loop(500) { if($comparison(#position,"=",100)) { then { alert(#position) set(#position,1,"Global") } else { } } increment(#position) } 1 Quote Link to post Share on other sites
namstery21 3 Posted April 29, 2017 Author Report Share Posted April 29, 2017 Thank you for your kind answer.. But when I checked it, it just show 100 repeatedly.. I want to get result every 100 so 100, 200, 300, 400, 500.. not 100 only.. When it loop every 100, 200, 300, 400 it has to show alert 100, 200, 300, 400 if it is correct,, but sample which you gave alert 100 only.. maybe my expression was not clear.. Sorry for that.. Here's a sample code set(#position,1,"Global") loop(500) { if($comparison(#position,"=",100)) { then { alert(#position) set(#position,1,"Global") } else { } } increment(#position) } Quote Link to post Share on other sites
abbas786 78 Posted April 29, 2017 Report Share Posted April 29, 2017 try this one set(#position,1,"Global") loop(500) { if($comparison(#position,"=",100) OR $comparison(#position,"=",200) OR $comparison(#position,"=",300) OR $comparison(#position,"=",400) OR $comparison(#position,"=",500)) { then { alert(#position) } else { } } increment(#position) } 1 Quote Link to post Share on other sites
HelloInsomnia 1103 Posted April 29, 2017 Report Share Posted April 29, 2017 I think that Kreatus has the correct answer of what you really want but based on your feedback if you really want to see the number try this: set(#position,1,"Global") loop(500) { if($comparison($division remainder(#position,100),"=",0)) { then { alert(#position) } else { } } increment(#position) } 1 Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted April 29, 2017 Report Share Posted April 29, 2017 Try this one set(#step by,100,"Global") set(#position,0,"Global") loop(500) { wait(0) if($comparison(#position,"= Equals",#step by)) { then { alert(#position) set(#step by,$add(#step by,100),"Global") } else { } } increment(#position) } ui stat monitor("postition: {#position}","") Regards,Nick 1 Quote Link to post Share on other sites
namstery21 3 Posted April 29, 2017 Author Report Share Posted April 29, 2017 Great, this guys..I learn many things from your answers.. logic and variables..Thank a lot! 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.