Sign in to follow this  
Followers 0
matrix10657

Gui, help with input boxes

7 posts in this topic

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

Share this post


Link to post
Share on other sites



Very logical...you have the GUICtrlRead in quotes, meaning it will become a string. Remove the quotes and voila !

Share this post


Link to post
Share on other sites

any idea how I would make the 'go!' button commence the script?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Nicely put Helge. hehe


- Dan [Website]

Share this post


Link to post
Share on other sites

I know.. I realised it wasn't in the right forum but I couldnt delete my old post. Sry

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