Ich versuche nachdem ich nen Button gedrückt habe ein Funktion zu callen, was auch funktioniert, hier die Function:
Code:
$y = 0
$x = 0
Func _Agni()
Sleep(1000)
$agni2 = _ImageSearch("Gods\Agni.bmp",1,$y,$x,0)
If $agni2=1 Then
MouseMove($y,$x,1)
MouseClick("left")
MouseClick("left")
Sleep(1250)
MsgBox(1,"found","found")
ElseIf = MsgBox(1,"test","test")
EndIf
EndFunc
Hier noch mal der Button:
Code:
$agni = GUICtrlCreateButton("agni", 56, 216, 65, 65, BitOR($BS_BITMAP,$WS_GROUP))
GUICtrlSetImage(-1, "Gods\Agni.bmp", -1)
While 1
$nMsg = GUIGetMsg()
if $nMsg = $agni Then ;Agni Button
$agni1 = MsgBox (1,"Are you Sure","Are you sure u want to pick Agni?",0)
Switch $agni1
Case 1
GUICtrlSetImage($choosepic, "Gods\Agni.bmp")
GUICtrlSetState($agni, $GUI_DISABLE)
Sleep (1000)
MsgBox (0,"Ok Have Fun","Ok, have Fun with Agni",1)
Call ("_Agni")
Case 2
MsgBox (0,"Pick another ***","Ok! please pick another ***",0)
Sleep (1000)
EndSwitch
EndIf
Grüße
//EDIT:
Fehler selber gefunden, lag am BMP Format des Bildes. Mit PNG hats geklappt






