CattBoy Posted March 24, 2009 Posted March 24, 2009 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 $AutoRunButtonDeclaration of the Variable I will store the input intoHotKeySet("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 anythingQuestions or concerns please just ask! Thanks everyone~CBexpandcollapse popup#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
CodyBarrett Posted March 24, 2009 Posted March 24, 2009 i have not looked at this script... but if you have a this Func _HOTKEY () $Input = Inputbox () ; whatever your params are Hotkeyset ($Input, 'FUNCTION') [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
CattBoy Posted March 24, 2009 Author Posted March 24, 2009 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
ProgAndy Posted March 24, 2009 Posted March 24, 2009 You can try this to get a hotkey: http://www.autoitscript.com/forum/index.php?showtopic=72588 *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
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