PabeckTricker Posted November 11, 2013 Posted November 11, 2013 Hello guys, in beforehand: I have used autoit successfully in the past, but i am not very experienced. Anyway what i would like to realize is this: A script that i can run in the background and which gives an output (e.g a postalcode) based on input. Also i would like to implement a pause and escape function. This is how far i have come from searching: ___________________________________________________________________________________ ; Press Esc to terminate script, Pause/Break to "pause" Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") ;Body ( Now how do i write the "if i enter Q or W or etc. then send "52074" ) While 1 ? ? WEnd Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd Func Terminate() Exit 0 EndFunc ;==>Terminate Also for some reason i seem to be lacking an Endfunc but i can identify where. Can someone help me ? Kind regards, Patrick
water Posted November 11, 2013 Posted November 11, 2013 You have to end function TogglePause before starting a new function. You can't nest functions. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
l3ill Posted November 11, 2013 Posted November 11, 2013 Hi PabeckTricker, This looks like the Example from the Help File... Except you took out the part that you need Put back the "Show Message: Hotkey and change it to do what you want. Try an InputBox and then have a look at Select Case or Switch case to change the out come from the input. If you get stuck, you know where we are.... Good luck ! Bill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
l3ill Posted November 11, 2013 Posted November 11, 2013 (edited) On second glance, you may not need this: Try an InputBox and then have a look at Select Case or Switch case to change the out come from the input. If all you want to do is send Postal Codes when a key is pressed. Bu t I would consider using ALT or CTRL together with the key otherwise normal typing will be impossible.... Edited November 11, 2013 by billo My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
PabeckTricker Posted November 11, 2013 Author Posted November 11, 2013 Hi PabeckTricker, This looks like the Example from the Help File... Except you took out the part that you need Put back the "Show Message: Hotkey and change it to do what you want. Try an InputBox and then have a look at Select Case or Switch case to change the out come from the input. If you get stuck, you know where we are.... Good luck ! Bill Hi Bill, yes this is what i found after googling. I tried as far as i came. And regarding the normal typing thats what i would like to have the "pause" function for. But in general its filling in stupid tables so pressing alt+ctrl everytime would be a pain in the ass. You have to end function TogglePause before starting a new function. You can't nest functions. "Nest functions" ?
l3ill Posted November 11, 2013 Posted November 11, 2013 I'm afraid the pause function in the HotKeySet will not serve this purpose. Recently found that out myself... Maybe use the F keys instead. F2, F3 etc "Nest functions" ? You removed one or more of the FUNC ENDFUNC Declarations causing a nested Function (Function within a function) My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
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