Sign in to follow this  
Followers 0
hmRaggy

Input box / variable

5 posts in this topic

Hello, I am trying to make a GUI window with an input box so that I can take whatever is in that input box and paste it in a spot in a script... don't know if that makes any sense or not, but heres the way I'm thinkin' of it

Here is my script so far...

#include <GUIConstants.au3>

GUICreate("Double Click", 120, 40, 20, 20)

GUISetState (@SW_SHOW)

$var = GUICtrlCreateInput("120", 10, 10, 100, 20)

HotKeySet("{1}", "one")

Func one()

Send("1")

Sleep($var)

Send("2")

EndFunc

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Wend

I just need an universal example so I can make what I need =p

Share this post


Link to post
Share on other sites



I'm just trying to do somethin' like a copy/paste. Like I wanna run a script, and whatever is in the input box will be inputed inside the script. Like if I wanted my script to press "1" (sleep) "2" whenever I press a hotkey but I wnated to adjust the sleep time between "1" (slep) "2" with the gui input. So I could run the script and be able to change the sleep variable without configuring the script itself.

Share this post


Link to post
Share on other sites

maybe this

; Press Esc to terminate script

#include <GUIConstants.au3>

Dim $var = 100
Dim $go = "stop"
Dim $Paused

HotKeySet("{ESC}", "Terminate")
HotKeySet("{F9}", "Set_Sleep")
HotKeySet("{PAUSE}", "TogglePause")

TogglePause()

;;;; Body of program would go here;;;;
While 1
    Sleep($var)
    Send("1")
    Sleep($var)
    Send("2")
WEnd
;;;;;;;;


Func Terminate()
    Exit 0
EndFunc

Func Set_Sleep()
    $var = InputBox("Set Sleep", "Please type in the sleep time desired")
    MsgBox(64, "Sleep Setting", "Sleep has been set to " & $var & " milliseconds   ", 3)
EndFunc

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

8)


NEWHeader1.png

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