DeluxeDeluxe 0 Posted November 14 Quote HotKeySet("1", "Hotkey1") HotKeySet("2", "Hotkey2") While 1 Sleep(100) WEnd Func Hotkey1() HotKeySet ("1") Send("testkey1_1") Send("testkey1_2") Send("testkey1_3") HotKeySet("1", "Hotkey1") EndFunc Func Hotkey2() HotKeySet ("2") Send("testkey2_1") Send("testkey2_2") Send("testkey2_3") HotKeySet("2", "Hotkey2") EndFunc Hi Guys, just trying to realize a simple script, when 1 is pressed type something, if 2 is pressed type something else. this thing is just exiting after a couple uses and messes arround, inserts sometimes content from hotkey1. any clues how to improve that? also sometimes just exists, should normally run forever. Thanks guys! Share this post Link to post Share on other sites
Jos 1,844 Posted November 14 (edited) That posted script won't just exit assuming you don't have that first line you have in there. Guess your real script isn't the same and contains some sort of error maybe? Jos Edited November 14 by Jos Hide Jos's signature Hide all signatures 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. Share this post Link to post Share on other sites
DeluxeDeluxe 0 Posted November 14 Thanks Jos for your reply ✌🏾 Not byitself, but after using the Hotkey a couple times. The mixing up of the Hotkeys content gets me also confused. Maybe i am overseeing something general in this? Share this post Link to post Share on other sites
Jos 1,844 Posted November 14 Post a replicator script which simulates the issue to avoid the guessing game as the posted script isn't causing any issues as far as I can see. Jos Hide Jos's signature Hide all signatures 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. Share this post Link to post Share on other sites
Nine 340 Posted November 14 No wonder that the script is messing with the 2 hotkeys. Using Send is just like typing. So in hot 2 there a few 1 and in hot 1 there a few 2. 1 DeluxeDeluxe reacted to this Hide Nine's signature Hide all signatures No signature so far... Share this post Link to post Share on other sites
seadoggie01 44 Posted November 14 You got the right idea when you removed the hotkey before sending the text, but you failed to unregister both hotkeys, which causes both hotkey functions to fire, I imagine Basically, this happens? You run the script and press 1... This launches HotKey1, which unregisters 1 as a hotkey it then types testkey1_1testkey1_2 and launches HotKey2 HotKey2 unregisters itself and sends all it's text HotKey1 continues 1 DeluxeDeluxe reacted to this Hide seadoggie01's signature Hide all signatures All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Share this post Link to post Share on other sites