onlineth Posted February 13, 2014 Share Posted February 13, 2014 Hi, I am wondering if it is possible to generate a random word and input it to a variable like $randomword. Is it possible to get the word from a text file like this one-- (word's text file attachment). Thank you so much your help and support!!! Word's.txt scientia potentia est Link to comment Share on other sites More sharing options...
Solution jdelaney Posted February 13, 2014 Solution Share Posted February 13, 2014 try: $aWords = StringRegExp(FileRead("some.txt"),"(\w+)",3) $sRandom = $aWords[Random(0,UBound($aWords),1)] ConsoleWrite($sRandom & @CRLF) onlineth and GoogleDude 1 1 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Unc3nZureD Posted February 13, 2014 Share Posted February 13, 2014 This one does the same: $File = FileReadToArray("Word's.txt") $Random = $File[Random(0, UBound($File) - 1, 1)] MsgBox(64, "Hey", "Here's a random word: " & $Random) onlineth 1 Link to comment Share on other sites More sharing options...
onlineth Posted February 13, 2014 Author Share Posted February 13, 2014 Your Awesome, thank you jdelaney and also thank you Unc3nZureD!!! scientia potentia est 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