Jump to content
Sign in to follow this  
PabeckTricker

Input / Output

Recommended Posts

PabeckTricker

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

Share this post


Link to post
Share on other sites
water

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 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
l3ill

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

Share this post


Link to post
Share on other sites
l3ill

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 by billo

Share this post


Link to post
Share on other sites
PabeckTricker

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" ? 

Share this post


Link to post
Share on other sites
l3ill

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)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×