Jump to content

Using GUI to activate other scripts


Recommended Posts

Heres the basic idea: i need help with this. I have created a GUI with buttons, and i was wondering how to make the buttons execute other autoit codes.

EXAMPLE: you click on the button to make your mouse move to 174,607.

MouseMove(174,607)oÝ÷ ØÛh©¶­iËb½«^§i»­¶â±ÉbrG    ©Ú*'z¥¦gÍ£­+Þ²gê뢼"¶ayÊy«­¢+Ø)U%ÉÑÕÑѽ¸ ÅÕ½Ðí±½¥¸ÅÕ½Ðì¤

EDIT 2.0: oooo. its GUICtrlCreateButton

EDIT 3.0:::still wont work...

Edited by codemyster
Link to comment
Share on other sites

You know there is a really helpful and well written help file coming with autoit? It has samples like this all over the place :D

#include <GUIConstants.au3>

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

Opt("GUICoordMode",2)
$Button_1 = GUICtrlCreateButton ("Run Notepad",  10, 30, 100)
$Button_2 = GUICtrlCreateButton ( "Button Test",  0, -1)
$Button_3 = GUICtrlCreateButton ( "Mouse move",  0, -1)
GUISetState ()  ; will display an  dialog box with 2 button

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button_1
            Run('Notepad.exe')  ; Will Run/Open Notepad
        Case $msg = $Button_2
            MsgBox(0, 'Testing', 'Button 2 was pressed')  ; Will demonstrate Button 2 being pressed
        Case $msg = $Button_3
            MouseMove(200,300)
    EndSelect
Wend

EDIT: My spelling is kinda shitty these days.

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