Sign in to follow this  
Followers 0
CattBoy

Storing InputBox into a HotKeySet

4 posts in this topic

Hello Everyone,

I am trying to setup an inputbox to ask the user a question. The user will enter a character (single, 1), that character will then be set to a hotkeyset to kick off a function.

Below is the old code with the bolded values I would like to have saved from the input to the hotkeyset.

Global $AutoRunButton

Declaration of the Variable I will store the input into

HotKeySet("o", "AutoRun")

Location where I will put the AutoRunButton value and set it to that key?

$AutoRunButton = InputBox("Hotkey 5", "Please press your AutoRun button", "DELETE THIS TEXT AND ENTER YOUR KEY", "", _

-1, -1, 0, 0)

Prompting using to input there keystroke (a single character)

I have tried the following:

HotKeySet($AutoRunButton, "AutoRun") -- Did not do anything

Questions or concerns please just ask! Thanks everyone

~CB

#cs ----------------------------------------------------------------------------
        Game AutoSprint Loop      v1.0                               Created by CattBoy

        Updates --
        v1.0    -- Initial Verison



        What it Does: AutoSprints by holding Shift


1-- Hit "O" o not zero (Hit Keystroke "o" to enable shift to be held down)
2-- Hit "P" to stop (Hit Keystroke "p" to disable shift)
3-- Auto Runs and loops

Additional Keystrokes
Pause - Pauses Macro - Only Pauses it if Not Turned on ("P")
Esc - Quits Macro

#ce ----------------------------------------------------------------------------


Global $Paused
Global $AutoRunButton



$StartLoop = 1
$Endloop = -1

;Sets key for AutoSprint Enable
HotKeySet("o", "AutoRun")

;Set key for Autpsrint Disable
HotKeySet("P", "StopAutoRun")

; Press Esc to terminate script, Pause/Break to "pause"
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")


;;;; Body of program would go here;;;;
While 1
    
;Gives Le-way to Alt-Tab back in (2 seconds)
    Sleep(2000)
    
;Message box with Info
        $AutoRunButton = InputBox("Hotkey 5", "Please press your AutoRun button", "DELETE THIS TEXT AND ENTER YOUR KEY", "", _
    -1, -1, 0, 0)
    Sleep(1000)
    
;Never ending loop to stay active
    Do
        
    Sleep(3000)
    ToolTip('')
    
    Until $StartLoop < $Endloop
WEnd


;;;;;;
Func AutoRun()
    While NOT $Paused
        Send("{SHIFTDOWN}")
        Sleep(500)
        ToolTip('Script is "AutoRunning"',0,0)
        Sleep(500)
    WEnd
    ToolTip('')
EndFunc
;;
Func StopAutoRun()
    While NOT $Paused
        Send("{SHIFTUP}")
        Sleep(500)
        ToolTip('Script is Not "AutoRunning"',0,0)
        Sleep(500)
    WEnd
    ToolTip('')
EndFunc

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        Sleep(500)
        ToolTip('Script is "Pause"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Share this post


Link to post
Share on other sites



i have not looked at this script... but if you have a this

Func _HOTKEY ()
$Input = Inputbox () ; whatever your params are
Hotkeyset ($Input, 'FUNCTION')

Share this post


Link to post
Share on other sites

i have not looked at this script... but if you have a this

Func _HOTKEY ()
$Input = Inputbox () ; whatever your params are
Hotkeyset ($Input, 'FUNCTION')

Well thanks,

Silly coding on my part and I just needed to move the HOTKEYSET down inside the scope of the loop. Not In the 'header' declaration!

Cheers!

~CB

Share this post


Link to post
Share on other sites

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

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  
Followers 0