Jump to content
Sign in to follow this  
Drew

It won't see if it's checked or not.

Recommended Posts

Drew

Alright. This is what I'm trying to do.

When the checkbox is NOT checked , I need the script to do this:

Send( $input & "" &$x)

$x = $x + 1

Send( "{ENTER}")

When the checkbox IS checked , I need the script to do this:

Send( $input & "-" &$x)

Send( "{TAB}")

Send( "" &$x)

$x = $x + 1

Send( "{ENTER}")

The script reads whether or not its checked as soon as the program starts , leaving the user zero time to make that decision on which they want. I can't figure out how to make this script so that whenever this function is called , it READS what it needs to do ACCORDING to whether or not the box is checked or not.

I'm including my script at the bottom:

I did some searching of my own , and I think maybe GUICtrlRead might help me in doing this? I looked it over , And I'm not certain on how to use it to do what I need.

; Press Esc to terminate script, Pause/Break to "pause"
HotKeySet("{ESC}", "Terminate")
HotKeySet("`", "Box")
HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 804, 226, 193, 125)
GUISetBkColor(0x800000)
$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Dreu\Desktop\D2War_Banner2.bmp", 0, 0, 801, 145, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Checkbox1 = GUICtrlCreateCheckbox("Private Game", 456, 152, 137, 25)
GUICtrlSetFont(-1, 12, 800, 0, "Palatino Linotype")
$Button1 = GUICtrlCreateButton("Read Me", 456, 184, 145, 33, 0)
GUICtrlSetFont(-1, 12, 800, 0, "Palatino Linotype")
$Pic2 = GUICtrlCreatePic("C:\Documents and Settings\Dreu\Desktop\CopyRight.bmp", 136, 152, 265, 68, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $x = 1
Global $input = InputBox( "Game Name", "Please type in the desired game name.", "Game Name")

;;;; Body of program would go here;;;;
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
        ;
        ;Put the ReadMe Here.
        ;
    EndSwitch
    
WEnd
;;;;;;;;


Func Box()
    WinWaitActive( "Untitled - Notepad")
    If $Checkbox1 = $GUI_CHECKED Then
        Send( $input & "-" &$x)
        Send( "{TAB}")
        Send( "" &$x)
        $x = $x + 1
        Send( "{ENTER}")
        EndIf
    If $CheckBox1 = $GUI_UNCHECKED Then
    Send( $input & "" &$x)
    $x = $x + 1
    Send( "{ENTER}")
    EndIf
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMessage()
    $input = InputBox( "Game Name", "Enter the desired game name.")
    MsgBox( 0, "Game Name", "Your new Game Name is: " &$input)
EndFunc

Share this post


Link to post
Share on other sites
GunsAndRoses

If GUICtrlRead($Checkbox) = $GUI_CHECKED Then

;do whatever

Else

;do whatever

EndIf

Share this post


Link to post
Share on other sites
Drew

Not only Thank you , but GUNS n' ROSES KICK @$$.

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  

×