Jump to content

Medium Diffuculty GUI Question


Black
 Share

Recommended Posts

Hi, I am very new to AutoIt and I have made a few multifunction GUI's but I am completely stumped on even where to start on a certain GUI.

I am trying to make a gui where it has an input box and that input is taken and put into a certain part of a script. For example.

I made a program to type text into a certain chat program repeatedly. Right now it is a set block of text,

but i would like to try and make it where you type what you want into an input box and it is made as

the text to type.

I would be very gracious if anyone could help me out with this. IF you could provide me with a rugh outline for this that would be awesome.

Edited by Black
Link to comment
Share on other sites

  • Moderators

$Input = GUICtrlCreateInput('Input Box', 10, 10, 100, 20)

....

Then where ever you want to find out the value of it, GUICtrlRead($Input) << contains the text of the Input control.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

#include <GUIConstants.au3>

GUICreate("My GUICtrlRead"); will create a dialog box that when displayed is centered

$n1=GUICtrlCreateInput('', 10, 10, 100, 20)


$n2=GUICtrlCreateButton ("button",0,100)
GUICtrlSetState(-1,$GUI_FOCUS)      ; the focus is on this button

GUISetState ()   ; will display an empty dialog box
; Run the GUI until the dialog is closed
Do
    $msg = GUIGetMsg()
    if $msg = $n2 then
        msgbox(0,"list=", GUICtrlRead($n1)); display the value
        WinActivate("game info - Notepad")
        Send( "GUICtrlRead($n1))
    endif
Until $msg = $GUI_EVENT_CLOSE

This is what I have so far, but i cannot figure out how to get

what i put in the input box to by typed?

Edited by Black
Link to comment
Share on other sites

You had an error here

Send( "GUICtrlRead($n1))

this worked ( notepad = "Untitled" )

#include <GUIConstants.au3>

GUICreate("My GUICtrlRead"); will create a dialog box that when displayed is centered

$n1=GUICtrlCreateInput('', 10, 10, 100, 20)


$n2=GUICtrlCreateButton ("button",0,100)
GUICtrlSetState(-1,$GUI_FOCUS)        ; the focus is on this button

GUISetState ()     ; will display an empty dialog box
; Run the GUI until the dialog is closed
Do
    $msg = GUIGetMsg()
    if $msg = $n2 then
        msgbox(0,"list=", GUICtrlRead($n1)); display the value
        WinActivate("Untitled")
        Send( GUICtrlRead($n1))
    endif
Until $msg = $GUI_EVENT_CLOSE

8)

Edited by Valuater

NEWHeader1.png

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...