Checkbox funktioniert nicht.

12/05/2010 10:57 RettAss#1
Hab jetzt bestimmt schon zich variationen ausprobiert, aber es funktionirt einfach nicht. Die Funktion soll so aussehn, Checkbox + Input, wenn ich einen wert in den input schreibe, soll er durchdas aktivieren der Checkbox aktiviert werden und beim deaktivieren der checkbox eben wieder deaktiviert werden, was mach ich dabei falsch?

PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <NomadMemory.au3>

$pid = ProcessExists("3D Live Pool.exe")

If 
$pid = 0 Then
    MsgBox
(16,@ScriptName,'Prozess nicht gefunden, Skript wird beendet.')
    Exit 
1
EndIf

$open = _MemoryOpen($pid)

$adresse = 0x004A3480
$adresse1 
= 0x004A347C

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Test (checkbox)", 209, 148, 192, 124)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 96, 24, 17, 49)
$Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 96, 80, 17, 49)
$Input1 = GUICtrlCreateInput("", 120, 40, 81, 21)
$Input2 = GUICtrlCreateInput("", 120, 96, 81, 21)
$Label1 = GUICtrlCreateLabel("Bot:", 48, 32, 46, 33)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Spieler:", 8, 88, 88, 33)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Func Bot()
 
_MemoryWrite($adresse,$open,GUICTrlRead($input1))
 
EndFunc

While 1
    $nMsg 
= GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
           If 
BitAND(GuiCtrlRead($Checkbox1), $GUI_CHECKED) = $GUI_CHECKED Then Bot()

    EndSwitch
WEnd 
12/05/2010 11:01 ZeraPain#2
setz doch einfach ein case event auf die checkbox und überprüfe dann, wenn sie angeklickt wurde, ob sie checked oder unchecked ist.
12/05/2010 11:40 RettAss#3
Wenn ichs mit "Case" probiere komm ich auch nicht ans gewünschte ziel, wie gesagt habe schon etliches ausprobiert, anscheinend vergess ich immer etwas wichtiges
12/05/2010 11:46 BlackHybrid#4
Du fragst erst die checkbox ab nachdem du das script beendet hast :facepalm: (falls der fall eintritt das das X gedrückt wurde)
Setz die Abfrage hinter Endswitch und dann sollte es gehen

PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <NomadMemory.au3>

$pid = ProcessExists("3D Live Pool.exe")

If 
$pid = 0 Then
    MsgBox
(16, @ScriptName, 'Prozess nicht gefunden, Skript wird beendet.')
    Exit 
1
EndIf

$open = _MemoryOpen($pid)

$adresse = 0x004A3480
$adresse1 
= 0x004A347C

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Test (checkbox)", 209, 148, 192, 124)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 96, 24, 17, 49)
$Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 96, 80, 17, 49)
$Input1 = GUICtrlCreateInput("", 120, 40, 81, 21)
$Input2 = GUICtrlCreateInput("", 120, 96, 81, 21)
$Label1 = GUICtrlCreateLabel("Bot:", 48, 32, 46, 33)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Spieler:", 8, 88, 88, 33)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Func Bot()
    
_MemoryWrite($adresse, $open, GUICtrlRead($Input1))
EndFunc   ;==>Bot

While 1
    $nMsg 
= GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
    EndSwitch
    If 
BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) = $GUI_CHECKED Then Bot()
WEnd 
12/05/2010 11:58 RettAss#5
Quote:
Originally Posted by BlackHybrid View Post
Du fragst erst die checkbox ab nachdem du das script beendet hast :facepalm: (falls der fall eintritt das das X gedrückt wurde)
Setz die Abfrage hinter Endswitch und dann sollte es gehen

PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <NomadMemory.au3>

$pid = ProcessExists("3D Live Pool.exe")

If 
$pid = 0 Then
    MsgBox
(16, @ScriptName, 'Prozess nicht gefunden, Skript wird beendet.')
    Exit 
1
EndIf

$open = _MemoryOpen($pid)

$adresse = 0x004A3480
$adresse1 
= 0x004A347C

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Test (checkbox)", 209, 148, 192, 124)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 96, 24, 17, 49)
$Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 96, 80, 17, 49)
$Input1 = GUICtrlCreateInput("", 120, 40, 81, 21)
$Input2 = GUICtrlCreateInput("", 120, 96, 81, 21)
$Label1 = GUICtrlCreateLabel("Bot:", 48, 32, 46, 33)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
$Label2 = GUICtrlCreateLabel("Spieler:", 8, 88, 88, 33)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Func Bot()
    
_MemoryWrite($adresse, $open, GUICtrlRead($Input1))
EndFunc   ;==>Bot

While 1
    $nMsg 
= GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
    EndSwitch
    If 
BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) = $GUI_CHECKED Then Bot()
WEnd 
Ohhhh wasn peinlicher fehler :mad: naja zumindest ist sonst alles in ordnung mit dem script, Danke Für die hilfe

Mfg
12/05/2010 12:05 Al Kappaccino#6
PHP Code:
Case $Checkbox1
    
If GUICtrlRead($Checkbox1) = 1 Then
        Bot
()
    Else
        Return
    EndIf 
Oder so
12/05/2010 15:22 PenGuin :O#7
Wozu das Return? O.o

Code:
Case $Checkbox1
    If GUICtrlRead($Checkbox1) Then Bot()