dahid84 5 Posted February 20, 2015 Report Share Posted February 20, 2015 (edited) How to make random from only 1,4 i know only this way.. there is easier way ?set(#random, $rand(1, 2), "Global")if($comparison(#random, "=", 1)) { then { click(<for=1>, "Left Click", "No") } else { }} if($comparison(#random, "=", 2)) { then { click(<for=4>, "Left Click", "No") } else { }} Edited February 20, 2015 by dahid84 Quote Link to post Share on other sites
darryl561 177 Posted February 20, 2015 Report Share Posted February 20, 2015 You can take out the if commands set(#random, $rand(1, 4), "Global") click(<for=#random>, "Left Click", "No") Quote Link to post Share on other sites
dahid84 5 Posted February 20, 2015 Author Report Share Posted February 20, 2015 You can take out the if commands set(#random, $rand(1, 4), "Global") click(<for=#random>, "Left Click", "No") yes but random wil be pickup from 1,2,3,4 and i don't need 2,3 ;/ only 1 and 4 Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted February 20, 2015 Report Share Posted February 20, 2015 I use the above method but for a smaller range like that I use spin function as it is more "random" it seams. Instead of getting a lot of one numbers in a row it gives different number more often. alert($spin("\{1|2|3|4\}"))define $random number(#MIN, #MAX) { set(#F_index,#MIN,"Global") loop(#MAX) { add item to list(%F_ramd_list,#F_index,"Delete","Global") increment(#F_index) } set(#F_rand_list,%F_ramd_list,"Global") clear list(%F_ramd_list) return($spin("\{{$text from list($list from text(#F_rand_list,$new line),"|")}\}"))}comment("if you have a bigger bot then you might need to use a lotso to drag from \"custome commands\"is much easier and you end up using less code most of the time.Also, if you want a larger range it is nice too.")alert($random number(1, 4)) CD Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted February 20, 2015 Report Share Posted February 20, 2015 oops 1 Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted February 20, 2015 Report Share Posted February 20, 2015 You can take out the if commands set(#random, $rand(1, 4), "Global") click(<for=#random>, "Left Click", "No") yes but random wil be pickup from 1,2,3,4 and i don't need 2,3 ;/ only 1 and 4 didn't see that till after I posted. just use spin func with {1|4} click(<for=$spin("\{1|4\}")>,"Left Click","No") CD Quote Link to post Share on other sites
dahid84 5 Posted February 20, 2015 Author Report Share Posted February 20, 2015 Ty 4 help This is perfect ;] Quote Link to post Share on other sites
gavind 6 Posted February 22, 2015 Report Share Posted February 22, 2015 Thanks! Found this to be working on my end too! 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.