Hallo, 2 teile meiens scripts:
1)
Dazu:Man sieht ja das ich mit While True da rum gebastelt habe. bis zu button 6 wechselt es bei 3-6 die farben. nur dann:
2)
Dazu:
Habe hier halt While 1 genommen, dann geht der 7te Button auch Grün "ABER" danach kann ich nicht mehr 3,4,5,6 drücken. Als ob das Script abgestürzt sei.
Bitte um korrektur mit ";" anmerkungen. danke!
1)
Code:
While True $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 MsgBox(1, "Anleitung", "Drückt Start um zu Schlagen,Picupen und Aura/Sk anzumach und Potten um Blaue|Rote pots zu schlucken.Dazu müssen Aura F1 und Blaue|Rote pots 1und 2 sein", 1000) Case $Button2 MsgBox*BLABLABLA habe ich mal raus genommen...* Case $Button3 GUICtrlSetBkColor($Button3, 0x00FF00) GUICtrlSetBkColor($Button4, Default) GUICtrlSetBkColor($Button5, Default) GUICtrlSetBkColor($Button6, Default) GUICtrlSetBkColor($Button7, Default) GUICtrlSetStyle($Button4, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($Button5, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($Button6, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($Button7, $GUI_SS_DEFAULT_BUTTON) _Start() ; Startfunktion aufrufen, Variable $start wird auf 1 gesetzt Case $Button4 GUICtrlSetBkColor($Button3, Default) GUICtrlSetBkColor($Button4, 0xFFFF00) GUICtrlSetBkColor($Button5, Default) GUICtrlSetBkColor($Button6, Default) GUICtrlSetBkColor($Button7, Default) GUICtrlSetStyle($Button3, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($Button5, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($Button6, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($Button7, $GUI_SS_DEFAULT_BUTTON) _pause() ; Pausefunktion aufrufen, Variable $start wird auf 0 gesetzt Case $Button5 GUICtrlSetBkColor($Button3, Default) GUICtrlSetBkColor($Button4, Default) GUICtrlSetBkColor($Button5, 0xFF0000) GUICtrlSetBkColor($Button6, Default) GUICtrlSetBkColor($Button7, Default) GUICtrlSetStyle($Button3, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($Button4, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($Button6, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($Button7, $GUI_SS_DEFAULT_BUTTON) _Ende() Case $Button6 GUICtrlSetBkColor($Button3, Default) GUICtrlSetBkColor($Button4, Default) GUICtrlSetBkColor($Button5, Default) GUICtrlSetBkColor($Button6, 0x00FF00) GUICtrlSetBkColor($Button7, Default) GUICtrlSetStyle($Button4, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($Button5, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($Button3, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($Button7, $GUI_SS_DEFAULT_BUTTON) _Start2() Case $Button7 GUICtrlSetBkColor($Button3, Default) GUICtrlSetBkColor($Button4, Default) GUICtrlSetBkColor($Button5, Default) GUICtrlSetBkColor($Button6, Default) GUICtrlSetBkColor($Button7, 0x00FF00) GUICtrlSetStyle($Button4, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($Button5, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($Button3, $GUI_SS_DEFAULT_BUTTON) GUICtrlSetStyle($Button6, $GUI_SS_DEFAULT_BUTTON) _Start3() EndSwitch
2)
Code:
If $start3 = 1 And TimerDiff($t) > 1 Then
While 1
$timerInit1 = TimerInit() ; Initialisiert einen Timer mit den Namen $timerInit1 und setzt ihn auf 0
Sleep(5000) ; Wartet 5000 ms
$timerInit2 = TimerInit() ; Initialisiert einen Timer mit den Namen $timerInit2 und setzt ihn auf 0
$timerDiff1 = TimerDiff($timerInit1) ; Liest den Stand des Timers $timerInit1 aus und speichert ihn in $timerDiff1
$timerDiff2 = TimerDiff($timerInit2) ; Liest den Stand des Timers $timerInit1 aus und speichert ihn in $timerDiff1
; Generiert einen ToolTip um die aktuellen Timerstände anzuzeigen
If $timerDiff1 >= 59000 Then ; Wenn Timerstand von $timerDiff1 größer als 10000ms dann:
Send("^h")
Sleep(500)
Send("{F1}")
Sleep(500)
Send("^h") ; - zeige eine MsgBox
$timerInit1 = TimerInit() ; - Initialisiert einen Timer mit den Namen $timerInit1 und setzt ihn auf 0
EndIf
If $timerDiff2 >= 59000 Then ; Wenn Timerstand von $timerDiff1 größer als 10000ms dann:
Send("^h")
Sleep(1500)
Send("{F1}")
Sleep(500)
Send("^h")
$timerInit2 = TimerInit()
EndIf
Habe hier halt While 1 genommen, dann geht der 7te Button auch Grün "ABER" danach kann ich nicht mehr 3,4,5,6 drücken. Als ob das Script abgestürzt sei.
Bitte um korrektur mit ";" anmerkungen. danke!