DeluxeDeluxe Posted November 14, 2019 Share Posted November 14, 2019 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! Link to comment Share on other sites More sharing options...
Developers Jos Posted November 14, 2019 Developers Share Posted November 14, 2019 (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, 2019 by 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...
DeluxeDeluxe Posted November 14, 2019 Author Share Posted November 14, 2019 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? Link to comment Share on other sites More sharing options...
Developers Jos Posted November 14, 2019 Developers Share Posted November 14, 2019 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 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...
Nine Posted November 14, 2019 Share Posted November 14, 2019 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. DeluxeDeluxe 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
seadoggie01 Posted November 14, 2019 Share Posted November 14, 2019 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 DeluxeDeluxe 1 All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types 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