GUI Tasten Funktionen zu ordnen ??

05/29/2010 10:15 vames#1
soooo hab mich jetzt was durch den AutoIt Jungel gelesen und hab mir mit hilfe vin Koda FormDesigner nen kleinen Fenster gebastelt
und hab versucht dem start knopf zu sagen wenn er gedrückt wird das die schleife anfängt zu arbeiten

PHP Code:
#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$frmMain GUICreate("RübenBot"45085308178)
$Button1 GUICtrlCreateButton("Start"00449570)
$Label1 GUICtrlCreateLabel(" Du hast 10 Sekunden um in den Vollbildmodus zu wechseln."05644725)
GUICtrlSetFont(-1118002"Comic Sans MS")
GUICtrlSetBkColor(-10xFF0000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit

    EndSwitch
WEnd






HotKeySet
("{f3}""F3")
Func F3()
    
$t1
EndFunc

If _IsPressed($Button1then $t 0



While $t 0  



MouseMove 
(124,124,500)



WEnd 
aber ich weiss net warum des net klapt da ich selbst noch net so erfahren bin


mfg vame
05/29/2010 10:38 mipez#2
PHP Code:
While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit

    EndSwitch
WEnd 
Das ist das Gehirn deiner GUI xD
Schau dir mal
PHP Code:
Case $GUI_EVENT_ClOSE
Exit 
an^^
$GUI_EVENT_CLOSE ist das rote Kreuz rechts oben. Klingelts?
Mit Case und $control kannst du Buttons, Feldern etc Funktionen zuweisen.
05/29/2010 10:53 vames#3
#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$frmMain = GUICreate("RübenBot", 450, 85, 308, 178)
$Button1 = GUICtrlCreateButton("Start", 0, 0, 449, 57, 0)
$Label1 = GUICtrlCreateLabel(" Du hast 10 Sekunden um in den Vollbildmodus zu wechseln.", 0, 56, 447, 25)
GUICtrlSetFont(-1, 11, 800, 2, "Comic Sans MS")
GUICtrlSetBkColor(-1, 0xFF0000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

While 1
$Button1 = GUICtrlCreateButton()
Switch $Button1
Case $control $t=0
Exit

EndSwitch
WEnd

If _IsPressed($control) then $t=0


so hab was mehrere möglichkeiten gestet aber irgentwie schau ich net dahinter
05/29/2010 10:54 | Moep |#4
Code:
#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$frmMain = GUICreate("RübenBot", 450, 85, 308, 178)
$Button1 = GUICtrlCreateButton("Start", 0, 0, 449, 57, 0)
$Label1 = GUICtrlCreateLabel(" Du hast 10 Sekunden um in den Vollbildmodus zu wechseln.", 0, 56, 447, 25)

$startSwitch = False
HotKeySet("{ESC}", "_exit")
HotKeySet("{F3}", "stop")

GUICtrlSetFont(-1, 11, 800, 2, "Comic Sans MS")
GUICtrlSetBkColor(-1, 0xFF0000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
	Case $Button1
	    $startSwitch = Not $startSwitch
	EndSwitch
		
	If $startSwitch Then
		MouseMove (124,124,500)
		Sleep(2000)
	EndIf
WEnd
	
Func stop()
	$startSwitch = Not $startSwitch
EndFunc

Func _exit()
	Exit
EndFunc
Edit: Probier dir anzugewöhnen niemals mehr als eine "while 1 " schleife zu nutzen, da es sich dabei um eine Endlosschleife handelt und das Script diese normalerweise nicht verlässt, außer wenn du explizit etwas außerhalb der Hauptschleife aufrufst oder die Schleife mit "ExitLoop" abbrichst.
05/29/2010 12:02 vames#5
vielen dank von euch jetzt hab ich den fehler ^^ sry wenn ich euch zeit gestohlen hab bin noch net so vertraut bin erst seit 3 wochen dammit dran ^^ und bin froh das ich schon mal nen gui und halbwegs was machen kann

bekommt beide nen thanks

mfg vame