#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\Documents\AutoIt Projekte\Untitled - 1.ico
#AutoIt3Wrapper_outfile=MauszeigerSpiel v3.exe
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_Comment=Mitarbeit von Jonas Pössl
#AutoIt3Wrapper_Res_Description=Lässt mit gewünschter Geschwindigkeit den Mauszeiger über den Bildschirm flitzen.
#AutoIt3Wrapper_Res_Fileversion=3.2.2.1
#AutoIt3Wrapper_Res_LegalCopyright=(c) Johannes Emich
#AutoIt3Wrapper_Res_Language=1031
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
Opt("TrayIconHide",1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Maus ControlPanel", 433, 168, 188, 122)
$Input2 = GUICtrlCreateInput("", 16, 32, 217, 21)
$Input1 = GUICtrlCreateInput("", 16, 88, 217, 21)
$Button1 = GUICtrlCreateButton("Start", 288, 24, 121, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Reset", 288, 56, 121, 25, $WS_GROUP)
$Button3 = GUICtrlCreateButton("Start fieser Modus", 288, 88, 121, 25, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("Anzahl", 16, 8, 36, 17)
$Label2 = GUICtrlCreateLabel("Geschwindigkeit (100 schnell)", 16, 64, 199, 17)
$Label3 = GUICtrlCreateLabel('Zum Beenden des Mauszeigers "Ende" gedrückthalten', 16, 128, 258, 26)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Button4 = GUICtrlCreateButton("Exit", 288, 120, 121, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE, $Button4
                Exit
            Case $Button1
				$ende = 0
				$speed = GUICtrlRead($Input1)
                $zahl = GUICtrlRead($Input2)

				$answer1 = MsgBox(4,"Mausspiel","Wirklich starten?")
					If $answer1 = 7 Then MsgBox(0,"Mausspiel","Vielleicht ein ander mal")

					If $answer1 <> 7 Then
						For $for = 1 To $zahl

							if $speed > 100 Then
								MsgBox(48,"Error","Error, böser Bube, max 100!!!")
								$ende = 1
								ExitLoop
							EndIf

							$speed2 = 101-$speed
							MouseMove(Random(1,@DesktopWidth),Random(1,@DesktopHeight), $speed2)
								If _IsPressed("23") Then
									$ende = 1
									ExitLoop
								EndIf
						Next
						If $ende = 0 Then MsgBox(0,"Maus","Fertig!")
					EndIf

			Case $Button2
                GUICtrlSetData($Input1,"")
                GUICtrlSetData($Input2,"")
            Case $Button3
				$endefies = 0
                $speed = GUICtrlRead($Input1)
                $zahl = GUICtrlRead($Input2)

				For $i = 1 To $zahl

				if $speed > 100 Then
					MsgBox(48,"Error","Error, böser Bube, max 100!!!")
					$endefies = 1
					ExitLoop
				EndIf
				GUISetState(@SW_HIDE)
				$speed2 = 101-$speed
				MouseMove(Random(1,@DesktopWidth),Random(1,@DesktopHeight), $speed2)
					If _IsPressed("23") Then
						$endefies = 1
						MsgBox(0,"Wow","Wow, du hast es beendet. Woher weist du, wie das geht?")
						Exit
				EndIf
				Next
				If $endefies = 0 Then
					MsgBox(0,"Wow","Wow, du hast es überstanden. Du bist echt geduldig und kannst ohne Computer auskommen!!")
					Exit
				EndIf
				Exit
        EndSwitch
WEnd