xvdw Posted December 17, 2015 Share Posted December 17, 2015 Hi guys,I need some help being able to enter a random string of text, my code is as follows for where I need to action this. _IEAction ($oElement2, "focus")Send("Blah blah blah")EndIfWhere it says send("blah blah blah") I need it to choose from one of maybe 30 different random strings of text to send. I have tried using the help but can only work out how to send random numbers. I have a feeling it'll be similar but I cant nail the formatting.Any help will be great.Thank you. Link to comment Share on other sites More sharing options...
xvdw Posted December 17, 2015 Author Share Posted December 17, 2015 Hi guys,I need some help being able to enter a random string of text, my code is as follows for where I need to action this. _IEAction ($oElement2, "focus")Send("Blah blah blah")EndIfWhere it says send("blah blah blah") I need it to choose from one of maybe 30 different random strings of text to send. I have tried using the help but can only work out how to send random numbers. I have a feeling it'll be similar but I cant nail the formatting.Any help will be great.Thank you. Link to comment Share on other sites More sharing options...
kylomas Posted December 17, 2015 Share Posted December 17, 2015 (edited) Hmmm...I don't see how this could end well. Can you surprise us with a reason for this "spam bot"?kylomas edit: Please see the forum rules in my sig Edited December 17, 2015 by kylomas additional info Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 17, 2015 Moderators Share Posted December 17, 2015 @xvdw, please refrain from double posting in the future. I, too, would like to know a little more about what you're trying to do. It should be pretty easy to hold your strings in an array, and use random to grab the index. If you would like more, please provide some more information on what you're trying to accomplish. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
xvdw Posted December 17, 2015 Author Share Posted December 17, 2015 Hmmm...I don't see how this could end well. Can you surprise us with a reason for this "spam bot"?kylomas edit: Please see the forum rules in my sigHi guys,It's not for spamming. I'm filling in a company internal webform and we need to simulate A LOT of record entries. Which is fine and I have done, but I want the record entries for the 'comment box' to vary, so when we use the entries as an example its not the same comment looped thousands of times. Apologies for posting twice, I didn't even realize I did, Link to comment Share on other sites More sharing options...
kylomas Posted December 17, 2015 Share Posted December 17, 2015 xvdw,Thank you for the reasonable explanation. One possible way...#include <array.au3> ; generate array of random text local $aRandomText[25] for $i = 0 to ubound($aRandomText) - 1 for $j = 0 to random(5,15,1) $aRandomText[$i] &= chr(random(65,90,1)) Next next _arraydisplay($aRandomText) _IEAction ($oElement2, "focus") Send($aRandomText[random(0,24,1)])Of course, you could construct a file or array of sensible text and use the same technique.kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now