webpro 31 Posted January 20, 2013 Report Share Posted January 20, 2013 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 botNow 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 Quote Link to post Share on other sites
VaultBoss 310 Posted January 20, 2013 Report Share Posted January 20, 2013 What is the DEBUGGER showing as the values for the two variables read from the UI? Quote Link to post Share on other sites
VaultBoss 310 Posted January 20, 2013 Report Share Posted January 20, 2013 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) Quote Link to post Share on other sites
webpro 31 Posted January 20, 2013 Author Report Share Posted January 20, 2013 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 hahahahahahaThanks I owe you several beers lol Quote Link to post Share on other sites
VaultBoss 310 Posted January 20, 2013 Report Share Posted January 20, 2013 I owe you several beers lol Looking forward to it! Quote Link to post Share on other sites
webpro 31 Posted January 21, 2013 Author Report Share Posted January 21, 2013 ODD, it works fine as .ubot but as .exeUI stat monitor isn't updated after the first number shown ? Ex: if it picks up 277secs, it will stay as 277secsNow 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 ? Quote Link to post Share on other sites
VaultBoss 310 Posted January 21, 2013 Report Share Posted January 21, 2013 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. Quote Link to post Share on other sites
nicolai 4 Posted January 12, 2016 Report Share Posted January 12, 2016 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). Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 12, 2016 Report Share Posted January 12, 2016 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. 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.