Hey there. I'd like to write a script that will click on a random button. The screen will just have a webpage up with several buttons, and I can specify the locations of those buttons then the script will randomly decide one of them and move to it (then click it.). Is this at all possible?
Oh, also, on a sidenote, for this script a handy thing would be to see if it could do something like ctrl+f on and find something, then if it found a result such as, "Wow, that really sucked." it would do something like ctrl+w (just close the tab). If it didn't find that, however, it would do ctrl+t and repeat the previous code a couple times.
So yeah. Any help to a noob like me would be greatly appreciated.
Can I make my script randomly pick between a few specified MouseMove points and then move to it?
Can I make my script randomly pick between a few specified MouseMove points and then move to it?
I'm pretty new to this language and barely know what I'm doing. Please excuse any stupidity lol.
Oh also try and explain stuff well if I need it
Oh also try and explain stuff well if I need it
Re: Can I make my script randomly pick between a few specified MouseMove points and then move to it?
If you just want to select one out of, say, five buttons, you can "label" the buttons and use Random to select which one to click each time:
Random, btn, 1,5
Random, btn, 1,5
Re: Can I make my script randomly pick between a few specified MouseMove points and then move to it?
Cool! How do I "label" them though?
I'm pretty new to this language and barely know what I'm doing. Please excuse any stupidity lol.
Oh also try and explain stuff well if I need it
Oh also try and explain stuff well if I need it
Re: Can I make my script randomly pick between a few specified MouseMove points and then move to it?
You could put all of the button names (or IDs or whatever you use) into an array and use random to pick which value you'll send.
This is not working code, just visualization of the concept.
Code: Select all
btns := ["btnOne","btnTwo","btnThree","btnFour","btnFive"]
...
Random, n, 1, 5
pwb.document.getElementsByTagName(btns[n]).click()
Who is online
Users browsing this forum: NinjoOnline and 295 guests