Guest ragecrow Posted January 8, 2005 Share Posted January 8, 2005 I am having a problem getting this script to re-open the .exe it closes. Code looks like this ; --------------------------------- Vars's ----------------------------------- $botting=0 $AppName=IniRead("botting.ini","Settings","App_Name","turnbot.exe") $start_key=IniRead("botting.ini","Settings","Hotkey_StartFunc","{DEL}") $stop_key=IniRead("botting.ini","Settings","Hotkey_StopFunc","{END}") ; --------------------------------- Func's ----------------------------------- Func bot_start() $botting=1 EndFunc Func bot_stop() $botting=0 EndFunc ; --------------------------------- Hotkey's --------------------------------- HotKeySet($start_key, "bot_start") HotKeySet($stop_key, "bot_stop") ; --------------------------------- Start ------------------------------------ While 1 if $botting=1 Then Run($AppName) WinWaitActive("turnbot v0.67", "OK") Send("{ENTER}") EndIf Sleep(1000) WEnd I also have a notepad file named botting.ini in the same directory that looks like this. [settings] App_Name=turnbot.exe Hotkey_StartFunc={DEL} Hotkey_StopFunc={END} Essentially I hit delete and it opens the .exe file. That runs for a few minutes and then closes with a pop-up. The script closes the popup but will not re-open the .exe to start the cycle over (what I want). Is there something wrong in the code preventing it from re-opening? Thanks guys! Link to comment Share on other sites More sharing options...
buzz44 Posted January 9, 2005 Share Posted January 9, 2005 (edited) so all u want this script to do is run a program when u hit blah and close it when u hit blah then run it again if u press same key? try this ? Run("turnbot.exe") While 1 HotKeySet("{END}", "Quit") HotKeySet("{DEL}", "Start") WEnd Func Quit() ProcessClose ("turnbot.exe") EndFunc Func Start() Run("turnbot.exe") EndFunc jsut tested with notepad, hope thats want u meant Edited January 9, 2005 by burrup qq Link to comment Share on other sites More sharing options...
Guest ragecrow Posted January 10, 2005 Share Posted January 10, 2005 Thank you for the reply. I actually want it to start with the keypress but automatically restart the .exe after it closes the popup. I have a smaller script to do this but i cant get the keypress to turn on and off to work. Thanks! Link to comment Share on other sites More sharing options...
closeupman Posted January 10, 2005 Share Posted January 10, 2005 so all u want this script to do is run a program when u hit blah and close it when u hit blah then run it again if u press same key?try this ?Run("turnbot.exe") While 1 HotKeySet("{END}", "Quit") HotKeySet("{DEL}", "Start") WEnd Func Quit() ProcessClose ("turnbot.exe") EndFunc Func Start() Run("turnbot.exe") EndFuncjsut tested with notepad, hope thats want u meant <{POST_SNAPBACK}>Wouldn't it be better to have the hotkey B4 the while loop?? no reason to repeatedly set it....ie HotKeySet("{END}", "Quit") HotKeySet("{DEL}", "Start") While 1 Sleep(100) WEnd Link to comment Share on other sites More sharing options...
SlimShady Posted January 10, 2005 Share Posted January 10, 2005 Wouldn't it be better to have the hotkey B4 the while loop?? no reason to repeatedly set it....ie HotKeySet("{END}", "Quit") HotKeySet("{DEL}", "Start") While 1 Sleep(100) WEnd<{POST_SNAPBACK}>Exactly. Link to comment Share on other sites More sharing options...
buzz44 Posted January 11, 2005 Share Posted January 11, 2005 Exactly.<{POST_SNAPBACK}> i agree, the reason i done it that way was because i tried it your way closeupman but it did work , i think it is because i was using ProcessClose instead of WinClose.thanks qq 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