;Creator: Eedis
;Email: Eedis@gmx.us

iniread, record, click it.ini, click it, record
iniread, tx, click it.ini, title, x
iniread, ty, click it.ini, title, y
iniread, sx, click it.ini, score, x
iniread, sy, click it.ini, score, y
iniread, rx, click it.ini, rules, x
iniread, ry, click it.ini, rules, y
iniread, gx, click it.ini, game, x
iniread, gy, click it.ini, game, y

path=%A_WorkingDir%\Sounds
click:="Click it"
scroll:="Scroll it"
move:="Move it"
current=0
num=0
dif=1000

gui, -border
Gui, Show, w%A_screenwidth% h%A_ScreenHeight% , Click it!
WinSet, Transparent, 01, Click it!

gui, 4:+owner1
Gui, 4:Color, FF8040
gui, 4:-maximizebox -MinimizeBox -sysmenu
Gui, 4:Font, S42 CGreen Bold Underline, Papyrus
Gui, 4:Add, Text, x71 y1 w200 h80 , Click it!
Gui, 4:Show, x%tx% y%ty% w350 h80, Title Window

gui, 5:+owner1
Gui, 5:Color, FF8040
gui, 5:-maximizebox -MinimizeBox -sysmenu
Gui, 5:Font, S14 CGreen Bold, Verdana
Gui, 5:Add, Text, vscore x8 y1 w100 h20 , %current%/%record%
Gui, 5:Show, x%sx% y%sy% w113 h24, Score Window

 

gui, 3:+owner1
Gui, 3:Color, FF8040
Gui, 3:Font, S12 CGreen, Verdana
gui, 3:-maximizebox -MinimizeBox -sysmenu
Gui, 3:Add, Text, x4 y7 w340 h400 , :~Game Rules~:`n`nWelcome to Click it! The object of this game is to follow orders. When you're told to "Click it!"`, simply cick the left mouse button. When you're told to "Scroll it!"`, simply scroll your scroll wheel up or down. When you're told to "Move it!"`, simply move your mouse in any direction. It's simple. There's a list of commands below. Good luck!`n`n`nF1: Start`nF2: Minimize game`nF3: Reset Highscore`nESC: End game
Gui, 3:Show, x%rx% y%ry% w350 h317, Rules Window

gui, 2:+owner1
Gui, 2:Color, FF8040
Gui, 2:Font, S24 CGreen Bold, Papyrus
gui, 2:add, text, vtext x25 y20 w180 h90, Click it!
gui, 2:-maximizebox -MinimizeBox -sysmenu AlwaysOnTop
gui, 2:show, x%gx% y%gy% w180 h90, Game Window

F1::
settimer, moved, 1
coordmode, mouse, screen
current=0
Guicontrol, 2:, text, 3
sleep, 1000
Guicontrol, 2:, text, 2
sleep, 1000
Guicontrol, 2:, text, 1
sleep, 1000
Guicontrol, 2:, text,
sleep, 200

start:
random, num, 1, 3

if (num = 1)
{
mousegetpos, x, y
x-=20
mx=%x%
x+=40
ax=%x%
y-=20
my=%y%
y+=40
ay=%y%
Guicontrol, 2:, text, %click%
soundplay, %path%\%click%.wav
if (current > 0)
dif=1000
if (current > 10)
dif=900
if (current > 30)
dif=800
if (current > 50)
dif=700
if (current > 80)
dif=600
if (current > 100)
dif=500
sleep, %dif%
if (num = 4)
goto, good
}

if (num = 2)
{
mousegetpos, x, y
x-=20
mx=%x%
x+=40
ax=%x%
y-=20
my=%y%
y+=40
ay=%y%
Guicontrol, 2:, text, %scroll%
soundplay, %path%\%scroll%.wav
if (current > 0)
dif=1000
if (current > 10)
dif=900
if (current > 20)
dif=800
if (current > 30)
dif=700
if (current > 40)
dif=600
if (current > 50)
dif=500
sleep, %dif%
if (num = 5)
goto, good
}

if (num = 3)
{
mousegetpos, x, y
x-=20
mx=%x%
x+=40
ax=%x%
y-=20
my=%y%
y+=40
ay=%y%
Guicontrol, 2:, text, %move%
soundplay, %path%\%move%.wav
if (current > 0)
dif=1000
if (current > 10)
dif=900
if (current > 20)
dif=800
if (current > 30)
dif=700
if (current > 40)
dif=600
if (current > 50)
dif=500
sleep, %dif%
if (num = 6)
goto, good
}

lost:
settimer, moved, off
num=0
current=0
Guicontrol, 2:, text, Lost!
Return

good:
current+=1
if (current > record)
record=%current%
guicontrol, 5:, score, %current%/%record%
Guicontrol, 2:, text,
sleep, 200
goto, start

moved:
{
coordmode, mouse, screen
mousegetpos, nx, ny
if (num = 3)
{
if nx not between %mx% and %ax%
{
num=6
Guicontrol, 2:, text, Moved!
}
if ny not between %my% and %ay%
{
num=6
Guicontrol, 2:, text, Moved!
}
}
if (num = 2)
{
if nx not between %mx% and %ax%
{
num=0
gosub, lost
}
if ny not between %my% and %ay%
{
num=0
gosub, lost
}
}
if (num = 1)
{
if nx not between %mx% and %ax%
{
num=0
gosub, lost
}
if ny not between %my% and %ay%
{
num=0
gosub, lost
}
}
}
Return

~lbutton::
{
if (num = 1)
{
num=4
Guicontrol, 2:, text, Clicked!
}
if (num = 2)
{
num=0
Gosub, lost
}
if (num = 3)
{
num=0
Gosub, lost
}
}
Return

wheeldown::
{
if (num = 2)
{
num=5
Guicontrol, 2:, text, Scrolled!
}
if (num = 1)
{
num=0
Gosub, lost
}
if (num = 3)
{
num=0
Gosub, lost
}
}
Return

wheelup::
{
if (num = 2)
{
num=5
Guicontrol, 2:, text, Scrolled!
}
if (num = 1)
{
num=0
Gosub, lost
}
if (num = 3)
{
num=0
Gosub, lost
}
}
Return

F2::WinMinimize, Click it!

F3::
{
iniwrite, 0, click it.ini, click it, record
record=0
guicontrol, 5:, score, %current%/0
}
Return

esc::
2guiclose:
wingetpos, tx, ty,,, Title Window
wingetpos, sx, sy,,, Score Window
wingetpos, rx, ry,,, Rules Window
wingetpos, gx, gy,,, Game Window
iniwrite, %record%, click it.ini, click it, record
iniwrite, %tx%, click it.ini, title, x
iniwrite, %ty%, click it.ini, title, y
iniwrite, %sx%, click it.ini, score, x
iniwrite, %sy%, click it.ini, score, y
iniwrite, %rx%, click it.ini, rules, x
iniwrite, %ry%, click it.ini, rules, y
iniwrite, %gx%, click it.ini, game, x
iniwrite, %gy%, click it.ini, game, y
ExitApp