absurdist Posted October 23, 2005 Share Posted October 23, 2005 System: Celeron 2400, 256MB RAM, 20GB HDD, CD-ROM, S3 Graphics Software: Win98, all service packs installed, DirectX9, Autoit3, "The Way Things Work" Multimedia Software Very simple program. I just want to run the executable from the TWTW program, and have it loop and restart if someone closes it. I have the looping all working and everything is wonderful there. However, every time I try to call the program using Run or RunWait, I initially get an error message box popping up. The error message is null id-1169. When I click on it the program loads just fine. When I close the program it loops correctly... and right back to the error message popup. once again, if I click on it, it goes away and everything is ok. But that's not going to be an acceptable solution. I've tried even just a one line script, just to run the program. Same thing. I know I can write a script to close it automagically, but I'd rather not have it pop up if I can avoid it. Any ideas? Link to comment Share on other sites More sharing options...
Valuater Posted October 23, 2005 Share Posted October 23, 2005 show us the code 8) Link to comment Share on other sites More sharing options...
absurdist Posted October 23, 2005 Author Share Posted October 23, 2005 Several samples of the code: $val = RunWait("c:\dkmm\twtw2\twtw2.exe") ; script waits until twtw2 closes MsgBox(0, "Program returned with exit code:", $val) RunWait("c:\dkmm\twtw2\twtw2.exe") $1=0 Do RunWait("c:\dkmm\twtw2\twtw2.exe") Until $1=1 $1=0 While $1=0 RunWait("c:\dkmm\twtw2\twtw2.exe") Wend And all of the above using Run instead of RunWait. I even modified the code for AutoIt 2, with the commas and the double slashes and such. Same damned thing. I'm very confused. It's a simple loop. Link to comment Share on other sites More sharing options...
GaryFrost Posted October 23, 2005 Share Posted October 23, 2005 Several samples of the code:$val = RunWait("c:\dkmm\twtw2\twtw2.exe"); script waits until twtw2 closesMsgBox(0, "Program returned with exit code:", $val)RunWait("c:\dkmm\twtw2\twtw2.exe")$1=0DoRunWait("c:\dkmm\twtw2\twtw2.exe")Until $1=1$1=0While $1=0RunWait("c:\dkmm\twtw2\twtw2.exe")WendAnd all of the above using Run instead of RunWait.I even modified the code for AutoIt 2, with the commas and the double slashes and such. Same damned thing.I'm very confused. It's a simple loop. have you tried?RunWait("twtw2.exe","c:\dkmm\twtw2") SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
/dev/null Posted October 23, 2005 Share Posted October 23, 2005 (edited) However, every time I try to call the program using Run or RunWait, I initially get an error message box popping up. The error message is null id-1169. When I click on it the program loads just fine. When I close the program it loops correctly... and right back to the error message popup. once again, if I click on it, it goes away and everything is ok. But that's not going to be an acceptable solution.What happens if you start your "TWTW" program twice via START-> Programs -> etc... (or double click on icon)?? Do you get the same error message?CheersKurt Edited October 23, 2005 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Valuater Posted October 23, 2005 Share Posted October 23, 2005 maybe this ; Press Esc to terminate script, Pause/Break to "pause" Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{F9}", "Run_it") ;;;; Body of program would go here;;;; While 1 If Not WinExists("the title here") Then Run_it() EndIf Sleep(100) WEnd ;;;;;;;; Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Func Run_it() Run("c:\dkmm\twtw2\twtw2.exe") WinWait("") Sleep(1000) EndFunc 8) 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