#region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=zahlenraten.exe #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Run_Obfuscator=y #Obfuscator_Parameters=/striponly #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** _main() Func _main() Local $sTitle = "ZahlenRaten - Tut", $sDate = "15.09.2012", $sVersion = "0.4" Local $sMsgUpdate = $sTitle & '\n\nDer PC ermittelt eine zufällige Zahl, die von Dir\t\nmit so wenig wie möglichen Versuchen,\nerraten werden soll.\nAls Hinweis bekommst Du eine Meldung,\nob Deine Zahl kleiner, größer oder richtig war.\n\nVersion:\t%s\nBuild:\t%s\n\nAutor:\nRitzelrocker04 / RR04\nritzelrocker04.bplaced.net\n\nWeiter zum UpdateCheck?' Local $nMsg, $btnClose, $btnGo, $iptZahl, $lblOut, $lblOutMsg, $btnAbout Local $zfzhl, $zahl, $try = 0 GUICreate($sTitle, 250, 155) GUICtrlCreateLabel("Rate die Zahl zwischen 0 und 999", 10, 10, 230, 17, 0x001) GUICtrlSetFont(-1, 10, 400, 0, "Comic Sans MS") $iptZahl = GUICtrlCreateInput("Hier eine Ganzzahl eingeben", 10, 35, 230, 20, 0x2000) GUICtrlSetLimit(-1, 3) $lblOut = GUICtrlCreateLabel("Hinweise.", 10, 65, 230, 17, 0x001) GUICtrlSetFont(-1, 10, 400, 0, "Comic Sans MS") $lblOutMsg = GUICtrlCreateLabel("Anzahl der Versuche :" & @TAB & $try, 10, 95, 230, 17, 0x001) GUICtrlSetFont(-1, 10, 400, 0, "Comic Sans MS") $btnAbout = GUICtrlCreateButton("&About", 10, 125, 75, 22) $btnGo = GUICtrlCreateButton("&Start", 90, 125, 75, 22, 0x0001) $btnClose = GUICtrlCreateButton("&Beenden", 170, 125, 75, 22) GUISetState() $zfzhl = Random(0, 999, 1) ;~ ConsoleWrite("Die zufällige Zahl lautet : " & $zfzhl & @CRLF) While True $nMsg = GUIGetMsg() Switch $nMsg Case -3, $btnClose ExitLoop Case $btnAbout If MsgBox(64 + 4, $sTitle & ' UpdateCheck', StringFormat($sMsgUpdate, $sVersion, $sDate)) = 6 Then ShellExecute("http://ritzelrocker04.bplaced.net/") Case $btnGo $try += 1 $zahl = GUICtrlRead($iptZahl) ;~ ConsoleWrite("Die vom Nutzer eingegebene Zahl : " & $zahl & @CRLF) If ($zahl >= 0) And ($zahl <= 999) Then Switch $zfzhl Case $zfzhl < $zahl GUICtrlSetData($lblOut, "Die gesuchte Zahl ist kleiner.") GUICtrlSetData($lblOutMsg, "Anzahl der Versuche :" & @TAB & $try) Case $zfzhl > $zahl GUICtrlSetData($lblOut, "Die gesuchte Zahl ist groesser.") GUICtrlSetData($lblOutMsg, "Anzahl der Versuche :" & @TAB & $try) Case Else GUICtrlSetData($lblOut, "Super ! Du hast die Zahl geraten !") GUICtrlSetData($lblOutMsg, "Anzahl der Versuche :" & @TAB & $try) EndSwitch Else MsgBox(64, "Error", "Bitte eine Zahl zwischen 0 und 999 eingeben !") EndIf EndSwitch WEnd EndFunc ;==>_main ; Ende