#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=ico32.ico
#AutoIt3Wrapper_Compile_Both=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
$myGui = GUICreate("Печеньки", 300, 400)
GUISetBkColor(0xFFFFFF)
GUICtrlCreateLabel("Хавка", 10, 10)
$prog = GUICtrlCreateProgress(50, 10, 240, 15)
GUICtrlSetData(-1, 100)
$click = GUICtrlCreatePic("ico.jpg", 100, 250, 40, 40)
$score_la = GUICtrlCreateLabel("Печенек съел: 0", 180, 380, 200)
GUISetState()
$Global_timer = TimerInit()
$Global_speed = 100
$i = 0
Global $score = 0
While 1
$msg = GUIGetMsg()
If Int(TimerDiff($Global_timer)) >= $Global_speed Then
$i += 1
$Global_timer = TimerInit()
GUICtrlSetData($prog, 100 - $i)
If $i >= 100 Then ExitLoop
EndIf
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
Case $click
$prog1_read = GUICtrlRead($prog)
GUICtrlSetData($prog, $prog1_read + 25)
$i -= 25
If $i <= 0 Then $i = 0
GUICtrlSetPos($click, Random(10, 240, 2), Random(30, 340, 2))
; GUICtrlSetState($prog, $GUI_FOCUS)
$Global_speed = $Global_speed - 10
If $Global_speed <= 12 Then $Global_speed = 12
$score += 1
GUICtrlSetData($score_la, "Печенек съел: " & $score)
;~ ConsoleWrite($Global_speed & @CRLF)
EndSwitch
WEnd
GUIDelete()
GUICreate("О, Нет!!!", 300, 450)
GUISetBkColor(0xFFFFFF)
GUICtrlCreatePic("mem_sad.jpg", 10, 10, 290, 290)
GUICtrlCreateLabel("Мои любимые печеньки...... ", 60, 320, 300, 20)
GUICtrlSetFont(-1, 12, 600)
$btn = GUICtrlCreateButton("Кончились", 75, 340, 150, 50)
GUICtrlSetFont(-1, 12, 200)
Switch $score
Case 1
$score &= " печеньку"
Case 2 To 4
$score &= " печеньки"
Case Else
$score &= " печенек"
EndSwitch
GUICtrlCreateLabel("Ты съел всего " & $score, 75, 400, 250)
GUICtrlSetFont(-1, 10, 200)
GUISetState()
While 1
Switch GUIGetMsg()
Case $btn
ExitLoop
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
If MsgBox(4, "Ты хочешь ещё...", "Печенек?") = 6 Then ShellExecute(FileGetShortName(@ScriptFullPath))