t0ddie Posted September 18, 2006 Share Posted September 18, 2006 (edited) I dont know why, but the script i was using that did not work, works today. i changed nothing. go figure. anyways, thanks for all the advice guys. problem solved i guess... heh Edited September 23, 2006 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
Confuzzled Posted September 18, 2006 Share Posted September 18, 2006 You could pipe the DOS program output to a text file and read that in AutoIT. eg: PROG.exe >> output_text_file.txt (Check out the common DOS batch commands including the "|" option) Link to comment Share on other sites More sharing options...
jvanegmond Posted September 18, 2006 Share Posted September 18, 2006 Look at the Run command with StdIn and StdOut. It's probably Beta. github.com/jvanegmond Link to comment Share on other sites More sharing options...
lod3n Posted September 18, 2006 Share Posted September 18, 2006 Try this:Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced Opt("SendKeyDelay", 1) ;milliseconds FileDelete(@ScriptDir&"\output.txt") FileDelete(@ScriptDir&"\gen.bat") FileWriteLine(@ScriptDir&"\gen.bat","d2skey.exe > output.txt") $pid = run(@comspec,@scriptdir,@SW_HIDE) $hwnd = _ProcessGetWin($pid) ControlSend($hwnd,"","","script.bat{enter}") ControlSend($hwnd,"","","2") ControlSend($hwnd,"","","1.mpq{enter 2}") ControlSend($hwnd,"","","exit{enter}") $output = FileRead(@scriptdir&"\output.txt") FileDelete(@ScriptDir&"\output.txt") FileDelete(@ScriptDir&"\gen.bat") msgbox(0,"Output from d2skey.exe",$output) func _ProcessGetWin($procID) sleep(100) $var = WinList() For $i = 1 to $var[0][0] $thispid = WinGetProcess($var[$i][1]) if $thispid = $procID then return $var[$i][1] Next EndFunc [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
lod3n Posted September 19, 2006 Share Posted September 19, 2006 You put this script in the same directory as the d2skey.exe program? [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
CoderDunn Posted September 20, 2006 Share Posted September 20, 2006 Well I sort of solved a problem I had about keeping the cmd window open by using: Run(@SystemDir & "\cmd.exe", @SystemDir) then using the Send() function to do a command. Link to comment Share on other sites More sharing options...
lod3n Posted September 20, 2006 Share Posted September 20, 2006 The code I wrote works for me when I run it. Place it in the diablo directory with the program. Try changing: $pid = run(@comspec,@scriptdir,@SW_HIDE) to $pid = run(@comspec,@scriptdir) so that it doesn't run the command window hidden. Also try sprinkling in some sleep(1000) comands so that you can see what it's doing. Also try commenting out the FileDeletes, so you can take a look at the Output.txt file it's creating to capture the output from the program. It should be working fine. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] 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