jjump Posted June 28, 2008 Posted June 28, 2008 Need to be able to take a random word from a file and enter into a send command.. So, it would be Send("THEN THE RANDOM WORD FROM FILE").. Is this possible? Thanks Ian
goldenix Posted June 28, 2008 Posted June 28, 2008 is it a txt file? How big is it? How many lines of code does it have? Where do you want to send the word? always Give as much info as possible.! My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
yyyy273 Posted June 28, 2008 Posted June 28, 2008 (edited) If you have 1 word per line you could do $file = FileOpen("YourFile.txt") Filereadline($file,Random(1, <however many lines your file is>)) FileClose($file Edited June 28, 2008 by yyyy273
jjump Posted June 28, 2008 Author Posted June 28, 2008 Hi, Thank you for your replies.. The file would be a text file with one word per line and have about 200 words.. The word would just be sent using the Send command.. With the above example, how would you code that into a send command? Many Thanks Ian
goldenix Posted June 28, 2008 Posted June 28, 2008 something like this ;~ Count How mny lines are in the file - $i For $i = 1 to 999999999999999999 $line = FileReadLine('doujin[001].txt',$i) ; readline If @error = -1 Then ExitLoop ; exit,loop if end of file ToolTip('line: ' & $i & ' ' &$line,0,0) Next While 1 $random = Random(1, $i, 1) ; generate an integer between 1 and $i - is the Nr of lines we found $line = FileReadLine('doujin[001].txt',$random) Send($line & @CRLF) Sleep(1000) WEnd My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
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