Jump to content
UBot Underground

I'm trying to add random wait times from UI TEXT box but it doesn't work


Recommended Posts

I'm trying to add random wait times from UI TEXT box but it doesn't work

 

ui text box("Minimum wait", #waittime)ui text box("Maximum Wait", #waittime2)wait($rand(#waittime, #waittime2))

This doesn't work. It always picks up the biggest number ex:

Minimum entered 100, maximum entered 200, well 200 will be selected by the bot

Now i would like the bot to pick up a random number from 100 to 200 for this case.

 

I want it to work depending of what's entered into both fields

 

Unless there's another way to do this ? Or is it a bug ?

 

Thanks

Link to post
Share on other sites

This works for me here (tested):

 

ui stat monitor("Generated Value", #WaitRND)
ui text box("Wait Min", #WaitMIN)
ui text box("Wait Max", #WaitMAX)
set(#WaitRND, $rand(#WaitMIN, #WaitMAX), "Global")
wait(#WaitRND)
Link to post
Share on other sites

Thanks a lot yes yours works.

 

To be honest, the other simple code works too but tends to pick up higher values more often. At least the few times i tested it.

I did a test with value 1 to 10 and 5,6,7,8 were chosen very often

 

Man, what would i do without you hahahahahaha

Thanks

 

I owe you several beers lol

Link to post
Share on other sites

ODD, it works fine as .ubot but as .exe

UI stat monitor  isn't updated after the first number shown ?

 

Ex: if it picks up 277secs, it will stay as 277secs

Now i ain't sure if the wait time works either ? Looked like i was waiting for 277secs each time ?

 

Does this happens on your end guys ?

Link to post
Share on other sites

Use a smaller range, like 1-10 secs to test it and see what happens.  It is hard to repeat the test and wait like 200+ secs each time...

 

But with a smaller range you will speed up the process and still be able to make the difference when it chooses say... 1-3 secs vs. 7-9 or so.

Link to post
Share on other sites
  • 2 years later...

 

This works for me here (tested):

ui stat monitor("Generated Value", #WaitRND)
ui text box("Wait Min", #WaitMIN)
ui text box("Wait Max", #WaitMAX)
set(#WaitRND, $rand(#WaitMIN, #WaitMAX), "Global")
wait(#WaitRND)

 

Thanks for this.

 

I added the following to the top of my file like this to give between 2 and 10 second random delay.

set(#WaitRND,$rand(2,10),"Global")
wait(#WaitRND)

Then where I need random delay in rest of bot I add wait(#WaitRND).

Link to post
Share on other sites

Thanks for this.

 

I added the following to the top of my file like this to give between 2 and 10 second random delay.

set(#WaitRND,$rand(2,10),"Global")
wait(#WaitRND)

Then where I need random delay in rest of bot I add wait(#WaitRND).

 

If you preset the variable and use it for every random wait then all the wait times will be the same, you can simplify it a bit more and do this:

wait($rand(2,10))

And each time it is called it will then be randomized.

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