Jump to content
Sign in to follow this  
Joshuaaaa

Checked options activated on "Run" botton click?

Recommended Posts

Joshuaaaa

Ok. So i'm a noob and will admit it! I've done up my GUI using KODA, and have my simple rough GUI here:

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=

$Tester = GUICreate("Simple Clicker", 201, 151, 337, 222)

GUISetCursor (2)

GUISetBkColor(0xA6CAF0)

$Auto_Scatter = GUICtrlCreateCheckbox("Auto_Scatter", 56, 24, 97, 17)

GUICtrlSetBkColor(-1, 0xC0DCC0)

$Auto_Jumper = GUICtrlCreateCheckbox("Auto_Jumper", 56, 56, 97, 17)

GUICtrlSetBkColor(-1, 0xC0DCC0)

$Run = GUICtrlCreateButton("Run", 59, 115, 75, 25, 0)

If

GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Tester

EndSwitch

WEnd

I've got my GUI checkboxes on the GUI with it's text but no function yet. I've also got my botton at the bottom, entitled "Run". What I'm trying to do is have the "Run" button activate what is checked and perform the operation when clicked. Make sence to you?

For example... this is what I eventually want to have:

GUI opens. If checkbox entitled "Auto_Scatter" is clicked, and then I choose "Run", it will follow-through with the operation "Auto_Scatter" (which is to click right mouse botton repeatedly).

GUI opens. If checkbox entidled "Auto_Jumper" is clicked, and then I choose "Run", it will follow through with the operation "Auto_Jumper" (which is to click left mouse botton repeatedly while CTRL is held down).

I understand the basics, but I don't quite understand how to set the "Run" botton so that is activates what is selected in the above checkboxes.

Edited by Joshuaaaa

Share this post


Link to post
Share on other sites
enaiman

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Tester = GUICreate("Simple Clicker", 201, 151, 337, 222)
GUISetCursor (2)
GUISetBkColor(0xA6CAF0)
$Auto_Scatter = GUICtrlCreateCheckbox("Auto_Scatter", 56, 24, 97, 17)
GUICtrlSetBkColor(-1, 0xC0DCC0)
$Auto_Jumper = GUICtrlCreateCheckbox("Auto_Jumper", 56, 56, 97, 17)
GUICtrlSetBkColor(-1, 0xC0DCC0)
$Run = GUICtrlCreateButton("Run", 59, 115, 75, 25, 0)

GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Run
            If BitAND(GUICtrlRead($Auto_Scatter), $GUI_CHECKED) Then
                ;do stuff for that
                MsgBox(0, "Info","Auto_Scatter selected - will execute corresponding code")
            EndIf
            If BitAND(GUICtrlRead($Auto_Jumper), $GUI_CHECKED) Then
                ;do stuff for that
                MsgBox(0, "Info","Auto_Jumper selected - will execute corresponding code")
            EndIf
    EndSwitch
WEnd

the remaining is up to you


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.