Jump to content
UBot Underground

Can Ubot Select Random Numbers From A List?


Recommended Posts

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-04

05-06-07-08

09-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-12

01-04-05-11

03-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.

 

Link to post
Share on other sites

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

Link to post
Share on other sites

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, "|")}\}"))
}

Link to post
Share on other sites

 

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!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...