darwin Posted July 10, 2011 Share Posted July 10, 2011 hello all i made a script w/o gui which runs when i press CTRL+1 a shortcut from a game which is placed in windows directory because i tested it with notepad and some other programms which are placed in windows directory but when i try to run my shortcut it doesnt work Hotkeyset("^{1}", "_runGame") Hotkeyset("^{2}", "_exit") func _exit () Exit endfunc func _runGame () shellexecute("game.exe") endfunc while 1 wend then i get a msgbox which says "game.exe unable to find" or smth like this sorry im new with auto it so pls tell me what i did wrong Link to comment Share on other sites More sharing options...
jaberwacky Posted July 10, 2011 Share Posted July 10, 2011 Forum Rules Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Developers Jos Posted July 10, 2011 Developers Share Posted July 10, 2011 Is your script located in the same directory as the program? if not, how would it know where to find it on the disk? Add a Sleep(50) to your While-Wend loop to avoid eating too much CPU. also make sure you have read our forum rules! Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
darwin Posted July 10, 2011 Author Share Posted July 10, 2011 okay i placed the script in the game folder and put a shortcut of script on desktop and it works thx Jos! 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