Jump to content

Gui, help with input boxes


Recommended Posts

I'm trying to make a gui that will allow you to enter in a bunch of different information. On this gui there will be an execute button, when it is pressed a pre-written script will go and at the appropriate times I want the data previously entered in the gui to be typed by auto it.

#include <GuiConstants.au3>
GuiCreate(".bot", 400, 400)
$name1 = GuiCtrlCreateInput("Name", 50, 50, 130, 20)
$gobutton = GuiCtrlCreateButton("Go!", 10, 330, 100, 30)
GUISetState()
while 1
sleep (5000)
wend

This is where I left off on my gui. I want to beable to enter 'bob' into my input box and when I press 'Go!' ....

mouseclick ("left",502,187,1,0)
mouseclick ("left",440,209,1,0)
mouseclick ("left",218,200,1,0)
mouseclick ("left",163,166,1,0)
mouseclick ("left",66,142,1,0)
mouseclick ("left",283,306,1,0)
mouseclick ("left",610,210,1,0)
mouseclick ("left",633,117,1,0)
mouseclick ("left",656,117,1,0)
mouseclick ("left",713,332,1,0)
mouseclick ("left",273,321,1,0)
mouseclick ("left",555,466,1,0)
sleep (500)
pixelsearch (306,379,308,381,0xFFFFFF)
if @error Then
    sleep (500)
    mouseclick ("left",323,380,1,0)
    EndIf
if not @error then
    mouseclick ("left",323,380,1,0)
EndIf
mouseclick ("left",28,555,1,0)
sleep (400)
mousemove (99,467,2)
mouseclick ("left",120,447,1,2)
mouseclick ("left",439,44,5,.5)
mouseclick ("left",281,216,1,0)
sleep (5000)
pixelsearch (379,42,381,44,0xFFFFFF)
if @error Then
    $do = 0
Else
    $do = 1
EndIf
Do
    sleep (500)
    pixelsearch (379,42,381,44,0xFFFFFF)
        if @error Then
        $do = 0
    Else
        $do = 1
    EndIf
until $do = 0
sleep (200)
mouseclick ("left",352,285,1,1)
sleep (200)
mouseclick ("left",107,136,1,0)
mousemove (258,205,0)
send ("{BS 16}")
send("GUICtrlRead($name1)")

Right at this part I would like it to send ("bob"). However, I do not know The correct way to format the gui and the script.

Thanks in advance

Link to comment
Share on other sites

Here's on quick way of doing it... Replace the While/WEnd-loop in your first part with this code :

While 1
    $iMsg = GUIGetMsg()
    If $iMsg = $gobutton Then _GoBob()
WEndoÝ÷ Ù8^­¶¬yÊ'v«¶ò¢êܡעØb±û§rب«­¢+ÙÕ¹}½   ½ ¤($ìÑ¥½¹Ì)¹Õ¹

Btw, do you use notepad as your editor ? If you do I would suggest you to use Scite4AutoIt

instead. Also, you might want to check out GUIGetMsg some more as well, if you want to close

the script by pressing the X in titlebar.

EDIT : Even if your life depends on it, there's never a reason to doublepost !

Edited by Helge
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...