laurynherbert 0 Posted April 13, 2015 Report Share Posted April 13, 2015 Perhaps this question has been answered, but I cannot find in the form. I would like to compile a bot that can choose a random numb from a group of numbers. EXAMPLE: 01-02-03-0405-06-07-0809-10-11-12 Can you make ubot select x-amount of those numers, randomly (without choosing the same number twice) to make random combinations? EXAMPLE: 05-07-09-1201-04-05-1103-07-08-10 (this would be how the compiled random 4-digit (or however many) combinations would come out). Is this possible to do in ubot? If so, your expert advice would be greatly appreciated. Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted April 13, 2015 Report Share Posted April 13, 2015 Yes and I prefer $spin instead of $rand, seams to be more random. You can also use $random list item as well, but u can choose see attached example CDexample--loto nums.ubot Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted April 13, 2015 Report Share Posted April 13, 2015 with 0's if less than 10example--loto nums.ubot Quote Link to post Share on other sites
laurynherbert 0 Posted April 13, 2015 Author Report Share Posted April 13, 2015 Yes and I prefer $spin instead of $rand, seams to be more random. You can also use $random list item as well, but u can choose see attached example CD Yes and I prefer $spin instead of $rand, seams to be more random. You can also use $random list item as well, but u can choose see attached example CD Thank you. I downloaded the file and tried to open it, but got the message, "This bot contains an invalid script" If it helps, I'm using ubot 5.5.13 standard edition Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted April 13, 2015 Report Share Posted April 13, 2015 I made it 4 but should work in 5 clear list(%loto nums)set(#max loto nums, 4, "Global")loop while($list total(%loto nums) < #max loto nums) { set(#rand num, $Random numner(50), "Global") if(#rand num < 10) { then { set(#rand num, "0{#rand num}", "Global") } } if($not($plugin function("File Management.dll", "$exists in list", %loto nums, #rand num))) { then { add item to list(%loto nums, #rand num, "Delete", "Global") } }}set(#loto result, $text from list(%loto nums, "-"), "Global")alert(#loto result)define $Random numner(#MAX RANGE) { clear list(%mums list) set(#index, 0, "Global") loop($add(#MAX RANGE, 1)) { add item to list(%mums list, #index, "Delete", "Global") increment(#index) } return($spin("\{{$text from list(%mums list, "|")}\}"))} Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted April 13, 2015 Report Share Posted April 13, 2015 you must have the file management plugin installed as well http://www.ubotstudio.com/forum/index.php?/topic/13237-free-file-management-plugin-multiple-commands-and-functions/ Quote Link to post Share on other sites
laurynherbert 0 Posted April 13, 2015 Author Report Share Posted April 13, 2015 you must have the file management plugin installed as well http://www.ubotstudio.com/forum/index.php?/topic/13237-free-file-management-plugin-multiple-commands-and-functions/ Thank you so much! With the plugin installed everything works like a charm. I am so gratful for you taking the time to help! You're awesome! Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted April 13, 2015 Report Share Posted April 13, 2015 you are most welcme 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.