Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_UseX64=n
- #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
- #include <ButtonConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- $Form1 = GUICreate("'Scheiß Spiel'", 596, 138, 192, 124)
- $1 = GUICtrlCreateCheckbox("1", 16, 88, 25, 17)
- $2 = GUICtrlCreateCheckbox("2", 48, 48, 25, 17)
- $3 = GUICtrlCreateCheckbox("3", 144, 16, 33, 17)
- $4 = GUICtrlCreateCheckbox("4", 232, 48, 25, 17)
- $5 = GUICtrlCreateCheckbox("5", 272, 88, 25, 17)
- $6 = GUICtrlCreateRadio("6", 144, 88, 25, 17)
- $Group1 = GUICtrlCreateGroup("Spielfeld", 8, 0, 321, 129)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- $Group2 = GUICtrlCreateGroup("Würfel", 336, 0, 161, 129)
- $Label1 = GUICtrlCreateLabel("Spieler 1 ist dran!", 344, 16, 129, 17)
- $Button1 = GUICtrlCreateButton("Würflen", 344, 48, 147, 41, $WS_GROUP)
- $Button2 = GUICtrlCreateButton("weiter", 344, 87, 147, 41, $WS_GROUP)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- $Group3 = GUICtrlCreateGroup("Sticks", 504, 0, 89, 129)
- $Label2 = GUICtrlCreateLabel("Du:", 512, 16, 21, 17)
- $SticksP = GUICtrlCreateLabel("IIIIIIIII", 512, 32, 71, 33)
- $Label4 = GUICtrlCreateLabel("Computer:", 512, 72, 52, 17)
- $SticksC = GUICtrlCreateLabel("IIIIIIIII", 513, 86, 71, 33)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- GUISetState(@SW_SHOW)
- $next = False
- MsgBox(0, "Hilfe", "Drücke F1 für die Hilfe!")
- HotKeySet("{F1}", "_Help")
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $Button1
- _GoUser()
- Case $Button2
- _weiter("User")
- EndSwitch
- WEnd
- Func _GoPC()
- $next = False
- $W = Random(1, 6, 1)
- $nNext = Random(0, 1, 1)
- If $nNext = 1 Then _weiter("PC")
- GUICtrlSetData($Label1, "Computer hat " & $W & " gewürfelt!")
- Switch $W
- Case 1
- If GUICtrlRead($1) = $GUI_CHECKED Then
- GUICtrlSetState($1, $GUI_UNCHECKED)
- $sticks = GUICtrlRead($SticksC)
- GUICtrlSetData($SticksC, $sticks & "I")
- MsgBox(0, "Nächster", "Du bist der nächste!")
- Else
- GUICtrlSetState($1, $GUI_CHECKED)
- $sticks = GUICtrlRead($SticksC)
- If Not $sticks = "" Then
- GUICtrlSetData($SticksC, StringRight($sticks, StringLen($sticks) - 1))
- Else
- MsgBox(0, "Verloren!", "Tut mir leid aber der Computer hat gewonnen!")
- EndIf
- _GoPC()
- EndIf
- Case 2
- If GUICtrlRead($2) = $GUI_CHECKED Then
- GUICtrlSetState($2, $GUI_UNCHECKED)
- $sticks = GUICtrlRead($SticksC)
- GUICtrlSetData($SticksC, $sticks & "I")
- MsgBox(0, "Nächster", "Du bist der nächste!")
- Else
- GUICtrlSetState($2, $GUI_CHECKED)
- $sticks = GUICtrlRead($SticksC)
- If Not $sticks = "" Then
- GUICtrlSetData($SticksC, StringRight($sticks, StringLen($sticks) - 1))
- Else
- MsgBox(0, "Verloren!", "Tut mir leid aber der Computer hat gewonnen!")
- EndIf
- _GoPC()
- EndIf
- Case 3
- If GUICtrlRead($3) = $GUI_CHECKED Then
- GUICtrlSetState($3, $GUI_UNCHECKED)
- $sticks = GUICtrlRead($SticksC)
- GUICtrlSetData($SticksC, $sticks & "I")
- MsgBox(0, "Nächster", "Du bist der nächste!")
- Else
- GUICtrlSetState($3, $GUI_CHECKED)
- $sticks = GUICtrlRead($SticksC)
- If Not $sticks = "" Then
- GUICtrlSetData($SticksC, StringRight($sticks, StringLen($sticks) - 1))
- Else
- MsgBox(0, "Verloren!", "Tut mir leid aber der Computer hat gewonnen!")
- EndIf
- _GoPC()
- EndIf
- Case 4
- If GUICtrlRead($4) = $GUI_CHECKED Then
- GUICtrlSetState($1, $GUI_UNCHECKED)
- $sticks = GUICtrlRead($SticksC)
- GUICtrlSetData($SticksC, $sticks & "I")
- MsgBox(0, "Nächster", "Du bist der nächste!")
- Else
- GUICtrlSetState($4, $GUI_CHECKED)
- $sticks = GUICtrlRead($SticksC)
- If Not $sticks = "" Then
- GUICtrlSetData($SticksC, StringRight($sticks, StringLen($sticks) - 1))
- Else
- MsgBox(0, "Verloren!", "Tut mir leid aber der Computer hat gewonnen!")
- EndIf
- _GoPC()
- EndIf
- Case 5
- If GUICtrlRead($5) = $GUI_CHECKED Then
- GUICtrlSetState($5, $GUI_UNCHECKED)
- $sticks = GUICtrlRead($SticksC)
- GUICtrlSetData($SticksC, $sticks & "I")
- MsgBox(0, "Nächster", "Du bist der nächste!")
- Else
- GUICtrlSetState($5, $GUI_CHECKED)
- $sticks = GUICtrlRead($SticksC)
- If Not $sticks = "" Then
- GUICtrlSetData($SticksC, StringRight($sticks, StringLen($sticks) - 1))
- Else
- MsgBox(0, "Verloren!", "Tut mir leid aber der Computer hat gewonnen!")
- EndIf
- _GoPC()
- EndIf
- Case 6
- GUICtrlSetState($6, $GUI_CHECKED)
- Sleep(1000)
- GUICtrlSetState($6, $GUI_UNCHECKED)
- _GoPC()
- EndSwitch
- EndFunc ;==>_GoPC
- Func _GoUser()
- $W = Random(1, 6, 1)
- $next = True
- GUICtrlSetData($Label1, "Spieler 1 hat " & $W & " gewürfelt!")
- Switch $W
- Case 1
- If GUICtrlRead($1) = $GUI_CHECKED Then
- GUICtrlSetState($1, $GUI_UNCHECKED)
- $sticks = GUICtrlRead($SticksP)
- GUICtrlSetData($SticksP, $sticks & "I")
- MsgBox(0, "Eins Ziehen!", "Tut mir leid! Aber du musst ein Stick ziehen!")
- _GoPC()
- Else
- GUICtrlSetState($1, $GUI_CHECKED)
- $sticks = GUICtrlRead($SticksP)
- If Not $sticks = "" Then
- GUICtrlSetData($SticksP, StringRight($sticks, StringLen($sticks) - 1))
- Else
- MsgBox(0, "Gewonnen!", "Glückwunsch! Du hast den Computer geschlagen und gewonnen!")
- EndIf
- EndIf
- Case 2
- If GUICtrlRead($2) = $GUI_CHECKED Then
- GUICtrlSetState($2, $GUI_UNCHECKED)
- $sticks = GUICtrlRead($SticksP)
- MsgBox(0, "", $sticks)
- GUICtrlSetData($SticksP, $sticks & "I")
- MsgBox(0, "Eins Ziehen!", "Tut mir leid! Aber du musst ein Stick ziehen!")
- _GoPC()
- Else
- GUICtrlSetState($2, $GUI_CHECKED)
- $sticks = GUICtrlRead($SticksP)
- If Not $sticks = "" Then
- GUICtrlSetData($SticksP, StringRight($sticks, StringLen($sticks) - 1))
- Else
- MsgBox(0, "Gewonnen!", "Glückwunsch! Du hast den Computer geschlagen und gewonnen!")
- EndIf
- EndIf
- Case 3
- If GUICtrlRead($3) = $GUI_CHECKED Then
- GUICtrlSetState($3, $GUI_UNCHECKED)
- $sticks = GUICtrlRead($SticksP)
- GUICtrlSetData($SticksP, $sticks & "I")
- MsgBox(0, "Eins Ziehen!", "Tut mir leid! Aber du musst ein Stick ziehen!")
- _GoPC()
- Else
- GUICtrlSetState($3, $GUI_CHECKED)
- $sticks = GUICtrlRead($SticksP)
- If Not $sticks = "" Then
- GUICtrlSetData($SticksP, StringRight($sticks, StringLen($sticks) - 1))
- Else
- MsgBox(0, "Gewonnen!", "Glückwunsch! Du hast den Computer geschlagen und gewonnen!")
- EndIf
- EndIf
- Case 4
- If GUICtrlRead($4) = $GUI_CHECKED Then
- GUICtrlSetState($1, $GUI_UNCHECKED)
- $sticks = GUICtrlRead($SticksP)
- GUICtrlSetData($SticksP, $sticks & "I")
- MsgBox(0, "Eins Ziehen!", "Tut mir leid! Aber du musst ein Stick ziehen!")
- _GoPC()
- Else
- GUICtrlSetState($4, $GUI_CHECKED)
- $sticks = GUICtrlRead($SticksP)
- If Not $sticks = "" Then
- GUICtrlSetData($SticksP, StringRight($sticks, StringLen($sticks) - 1))
- Else
- MsgBox(0, "Gewonnen!", "Glückwunsch! Du hast den Computer geschlagen und gewonnen!")
- EndIf
- EndIf
- Case 5
- If GUICtrlRead($5) = $GUI_CHECKED Then
- GUICtrlSetState($5, $GUI_UNCHECKED)
- $sticks = GUICtrlRead($SticksP)
- GUICtrlSetData($SticksP, $sticks & "I")
- MsgBox(0, "Eins Ziehen!", "Tut mir leid! Aber du musst ein Stick ziehen!")
- _GoPC()
- Else
- GUICtrlSetState($5, $GUI_CHECKED)
- $sticks = GUICtrlRead($SticksP)
- If Not $sticks = "" Then
- GUICtrlSetData($SticksP, StringRight($sticks, StringLen($sticks) - 1))
- Else
- MsgBox(0, "Gewonnen!", "Glückwunsch! Du hast den Computer geschlagen und gewonnen!")
- EndIf
- EndIf
- Case 6
- GUICtrlSetState($6, $GUI_CHECKED)
- MsgBox(0, "6 Gewürfelt", "Glückwunsch du hast die 6 gewürfelt!")
- GUICtrlSetState($6, $GUI_UNCHECKED)
- EndSwitch
- EndFunc ;==>_GoUser
- Func _Help()
- MsgBox(0, "Hilfe", "Das Ziel ist es möglichst schnell alle Sticks weg zu bekommen." & @CRLF & _
- "Dazu Würfelst du, und setzt einen Stick auf das Feld das du gewürfelt hast. Das Script macht dies sogar automatisch." & @CRLF & _
- "Ist in dem Feld jedoch schon ein Stick musst du diesen herausnehmen und der Gegner ist dran." & @CRLF & _
- "Bist du dran und hattest gerade einmal gewürfelt, kannst du den Würfel weiter geben!")
- EndFunc ;==>_Help
- Func _weiter($who)
- Switch $who
- Case "User"
- If $next = True Then
- _GoPC()
- Else
- MsgBox(0, "Tut mir leid!", "Tut mir leid, aber du musst noch einmal würfeln!")
- EndIf
- Case "PC"
- If $next = False Then
- _GoUser()
- Else
- EndIf
- EndSwitch
- EndFunc ;==>_weiter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement