Jump to content

Follow the box game


Paulie
 Share

Recommended Posts

  • Replies 47
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

$Winpos = WinGetPos($h_Game)
    ToolTip("Score: " & $points, ($Winpos[0]+200), ($Winpos[1]+250))

I like it in the middle, that's just me. Thanks :wacko:

I don't think you want it in the middle, because if you happen to roll over it while playing, and you mouse touches it, you'll lose

Try this

$WinPos = WinGetPos($h_Game)
Tooltip("Score: " & $points, $winpos[0] + 200, $winpos[1])

Another thing, does anyone know a way to reduce the flickering as the box moves around?

That would be marvelous :D

Link to comment
Share on other sites

Alright, newer version, not quite enough canges to become V.5

but V.4.1 i sout (First post)

Sped up everything, and made a change or 2 to the changeandcheck function, tooltip is not at the top of the game window as opposed to corner of the screen

Link to comment
Share on other sites

play your own music during game play :D new random song each time ... i was goin 2 make game sounds but ill leave the music up to paulie just givin him ideas :wacko:

and had to change the score card from a msg box to a new gui so you dint get that annoying beep

<div style="height:600; overflow:auto">

#cs
;============================================================
;Box Follow Game
;
;Created By: Paulie
;Assisted by: Simucal
;
;--Function list--
;Base Functions:
;   -Menu()
;   -ReadData()
;   -ChangeAndCheck()
;Easy Difficulty:
;   -GameBeginEasy()
;   -StartGameEasy()
;Medium Difficulty:
;   -GameBeginMed()
;   -StartGameMed()
;Hard Difficulty:
;   -GameBeginHard()
;   -StartGameHard()    
;=============================================================
#ce
$song1 = "C:\Documents and Settings\Shawn\My Documents\My Music\01. Kryptonite.mp3" ;<---- put the file path of your music to be played
$song2 = "C:\Documents and Settings\Shawn\My Documents\My Music\09 Faith.mp3"       ;<---- put the file path of your music to be played
$song3 = "C:\Documents and Settings\Shawn\My Documents\My Music\basket case.mp3"    ;<---- put the file path of your music to be played

#include<GuiConstants.au3>
Opt('MouseCoordMode', 0)

Global $x, $y, $MenuPlay, $instructions, $MenuGame, $box, $x2, $y2, $points, $pos[10], $menu, $menuEASY, $MenuMed, $menuHARD, $h_game, $diff

Menu()



#cs
============================================================
Base Functions
============================================================
#ce
Func Menu()
AdlibDisable()
$R_music = Random(1, 3, 1)
If $R_music = 1 then
    soundPlay($song1,0)
ElseIf $R_music = 2 Then
    soundPlay($song2,0)
ElseIf $R_music = 3 Then
    soundPlay($song3,0)
EndIf
$points = 0
WinMinimizeAll()
$menu = GUICreate("", 200, 330, -1, -1)
$menuEASY = GUICtrlCreateRadio("Easy", 25, 65, 100, 50)
$menuMED = GUICtrlCreateRadio("Medium", 25, 110, 100,50)
$menuHARD = GUICtrlCreateRadio("Hard", 25, 160, 100, 50)
$menuGroup = GUICtrlCreateGroup("Difficulty", 20, 50, 120, 165)
$menuPLAY1 = GUICtrlCreateButton("Play", 50, 250, 100, 30)
GuiSetState()
SoundSetWaveVolume (0)

While 1
    $msg=GUIGETMSG()
If $msg = $GUI_EVENT_CLOSE then Exit
If $msg = $menuPLAY1 Then ReadData()
WEnd
EndFunc ;<==Menu
;===========================================================
Func ReadData()
    $StateEasy = GUICtrlRead($menuEASY)
    $StateMedium = GUICtrlRead($menuMED)
    $StateHard = GUICtrlRead($menuHARD)
    If $StateEasy = $GUI_Checked Then
        GameBeginEasy()
    ElseIf $StateMedium = $GUI_Checked Then
        GameBeginMed()
    ElseIf $StateHard = $GUI_CHECKED Then
        GameBeginHard()
    Else
        MsgBox(0,"Please Select", "Please Select a Difficulty.")
    EndIf
EndFunc ;<==ReadData
;===========================================================
Func ChangeAndCheck()
    SoundSetWaveVolume (50)
    $dist = Random(5,30,1)
    $s_Temp = 0
    $a_BoxPos = ControlGetPos("", "", $box)
    $WinPos = WinGetPos($h_game)
    ToolTip("Score: " & $points, $WinPos[0]+200,$WinPos[1])   
    If IsArray($a_BoxPos) Then
    Do
        $i_Rand = Random(00000, 40001,1)
        Select
            Case $i_Rand < 10000  ; Move Box UP
                If ($a_BoxPos[1] - $dist) > 25 Then
                    For $i = 1 to $dist                    
                        GUICtrlSetBkColor($box, 0xFFFF00)
                        $a_Info = GuiGetCursorInfo($h_Game)
                        If $a_Info[4] <> $box Then ExitLoop 
                        If $diff = "Hard" Then
                            Sleep(5)
                            GUICtrlSetPos($box, $a_BoxPos[0], $a_BoxPos[1] - $i)
                        Else
                            sleep(10)
                            GUICtrlSetPos($box, $a_BoxPos[0], $a_BoxPos[1] - $i)
                        Endif
                    Next
                        $s_Temp = 1
                        $points = $points +10
                EndIf
            Case $i_Rand < 20000 and $i_Rand > 10000 ; Move Box RIGHT
                If ($a_BoxPos[0] + $dist) < 400 Then
                    For $i = 1 to $dist
                        GUICtrlSetBkColor($box, 0x00FF00)
                        $a_Info = GuiGetCursorInfo($h_Game)
                        If $a_Info[4] <> $box Then ExitLoop             
                        If $diff = "Hard" then
                            Sleep(5)
                            GUICtrlSetPos($box, $a_BoxPos[0] + $i, $a_BoxPos[1])
                        Else
                            sleep(10)
                            GUICtrlSetPos($box, $a_BoxPos[0] + $i, $a_BoxPos[1])
                        EndIf
                    Next
                        $s_Temp = 1
                        $points = $points +10
                EndIf
            Case $i_Rand < 30000 and $i_Rand > 20000 ; Move Box DOWN
                If ($a_BoxPos[1] + $dist) < 400 Then
                    For $i = 1 to $dist
                        GUICtrlSetBkColor($box, 0xff0000)
                        $a_Info = GuiGetCursorInfo($h_Game)
                        If $a_Info[4] <> $box Then ExitLoop 
                        If $diff = "Hard" then
                        Sleep(5)
                        GUICtrlSetPos($box, $a_BoxPos[0], $a_BoxPos[1] + $i)
                        Else
                        sleep(10)
                        GUICtrlSetPos($box, $a_BoxPos[0], $a_BoxPos[1] + $i)
                        EndIf
                    Next
                        $s_Temp = 1
                        $points = $points +10
                EndIf
            Case $i_Rand < 40000 and $i_Rand > 30000  ; Move Box LEFT
                If ($a_BoxPos[0] - $dist) > 25 Then
                    For $i = 1 to $dist
                        GUICtrlSetBkColor($box, 0x0000FF)
                        $a_Info = GuiGetCursorInfo($h_Game)
                        If $a_Info[4] <> $box Then ExitLoop 
                        If $diff = "Hard" then
                        Sleep(5)
                        GUICtrlSetPos($box, $a_BoxPos[0] - $i, $a_BoxPos[1])
                        Else
                        sleep(10)
                        GUICtrlSetPos($box, $a_BoxPos[0] - $i, $a_BoxPos[1])
                        Endif
                    Next
                        $s_Temp = 1
                        $points = $points +10
                EndIf
            Case $i_Rand > 40000
                $s_Temp = 1
                $points = $points +10
        EndSelect
    Until $s_Temp = 1
    SoundSetWaveVolume (0)
EndIf

EndFunc   ;==>ChangeAndCheck


#cs
============================================================
Easy Functions
============================================================
#ce

Func GameBeginEasy()
GUIDelete($menu)
WinMinimizeall()
global $diff = "Easy"
$MenuGame = GUICreate("", 500, 400, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
$label1 = GUICtrlCreateLabel("Follow the Box", 175, 0, 200, 100)
GUICtrlSetFont($label1, 20, 500, 2, "Arial")
GUICtrlSetColor($label1, 0xff0000)
$instructions = GUICtrlCreateLabel("Keep your mouse in the square and avoid touching the black background", 25, 100, 450, 100)
GUICtrlSetFont($instructions, 15, 500, 2, "Arial")
GUICtrlSetColor($instructions, 0xCCCCCC)
$MenuPlay1 = GUICtrlCreateButton("Play", 225, 350, 100, 30)
GUISetState()

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $MenuPlay1 Then StartGameEasy()
WEnd
EndFunc ;<==GameBeginEasy()
;===========================================================
Func StartGameEasy()
    GUIDelete("$MenuGame")
    $diff = "Easy"
    $h_Game = GUICreate("", 500, 500, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetBkColor(0x000000)
    $box = GUICtrlCreateLabel(" ", 250, 250, 100, 100)
    GUICtrlSetBkColor($box, 0xCCCCCC)
    GUISetState()
    $pos = ControlGetPos("","", $box)
    If IsArray($pos) Then
    MouseMove($pos[0]+$pos[2]/2, $pos[1]+$pos[3]/2, 0)
    EndIf
    Sleep(1000)
    AdlibEnable("ChangeAndCheck",50)
    While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
        Sleep(100)
        $a_Info = GuiGetCursorInfo($h_Game)
        If $a_Info[4] <> $box Then ExitLoop
    WEnd
        AdlibDisable()
    GUIDelete($h_Game)
    Beep(100, 200)
    Beep(200, 200)
    Beep(300, 200)
    Beep(400, 200)
    Beep(300, 200)
    Beep(200, 200)
    Beep(100, 200)
GUICreate("Whoops!", 140, 120)
GUISetState(@SW_SHOW)
$Play_again = GUICtrlCreateButton("Play Again", 0, 100, 70, 20)
$Close_me = GUICtrlCreateButton("Exit", 70, 100, 70, 20)
GUICtrlCreateLabel("Your mouse left the box!" & @CRLF & @CRLF & "Difficulty: " & $diff & @CRLF & "Your Score: " & $points & @CRLF & @CRLF & "Good Job!! Play Again!", 0, 0, 450, 100)

    
While 1
   $msg = GUIGetMsg()
   Select
    Case $msg = $Play_again
        GUIDelete("Whoops!")
        Menu()
        
     Case $msg = $Close_me
        GUIDelete("Whoops!")
        Exit
      Case $msg = $GUI_EVENT_CLOSE

         GUIDelete("Whoops!")
         Exit         
   EndSelect

WEnd
EndFunc   ;==>StartGameEasy

#cs
============================================================
Medium Functions
============================================================
#ce

Func GameBeginMed()
GUIdelete($menu)
WinMinimizeall()
global $diff = "Medium"
$MenuGame = GUICreate("", 500, 400, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
$label1 = GUICtrlCreateLabel("Follow the Box", 175, 0, 200, 100)
GUICtrlSetFont($label1, 20, 500, 2, "Arial")
GUICtrlSetColor($label1, 0xff0000)
$instructions = GUICtrlCreateLabel("Keep your mouse in the square and avoid touching the black background", 25, 100, 450, 100)
GUICtrlSetFont($instructions, 15, 500, 2, "Arial")
GUICtrlSetColor($instructions, 0xCCCCCC)
$MenuPlay1 = GUICtrlCreateButton("Play", 225, 350, 100, 30)
GUISetState()

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $MenuPlay1 Then StartGamemed()
WEnd
EndFunc ;<==GameBeginMed)
;===========================================================
Func StartGameMed()
    GUIDelete("$MenuGame")
    $diff = "Medium"
    $h_Game = GUICreate("", 500, 500, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetBkColor(0x000000)
    $box = GUICtrlCreateLabel(" ", 250, 250, 75, 75)
    GUICtrlSetBkColor($box, 0xCCCCCC)
    GUISetState()
    $pos = ControlGetPos("","", $box)
    If IsArray($pos) Then
    MouseMove($pos[0]+$pos[2]/2, $pos[1]+$pos[3]/2, 0)
    EndIf
    Sleep(1000)
    AdlibEnable("ChangeAndCheck",50)
    
    While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
        Sleep(100)
        $a_Info = GuiGetCursorInfo($h_Game)
        If $a_Info[4] <> $box Then ExitLoop
    WEnd
        AdlibDisable()
    GUIDelete($h_Game)
    Beep(100, 200)
    Beep(200, 200)
    Beep(300, 200)
    Beep(400, 200)
    Beep(300, 200)
    Beep(200, 200)
    Beep(100, 200)
GUICreate("Whoops!", 140, 120)
GUISetState(@SW_SHOW)
$Play_again = GUICtrlCreateButton("Play Again", 0, 100, 70, 20)
$Close_me = GUICtrlCreateButton("Exit", 70, 100, 70, 20)
GUICtrlCreateLabel("Your mouse left the box!" & @CRLF & @CRLF & "Difficulty: " & $diff & @CRLF & "Your Score: " & $points & @CRLF & @CRLF & "Good Job!! Play Again!", 0, 0, 450, 100)

    
While 1
   $msg = GUIGetMsg()
   Select
    Case $msg = $Play_again
        GUIDelete("Whoops!")
        Menu()
        
     Case $msg = $Close_me
        GUIDelete("Whoops!")
        Exit
      Case $msg = $GUI_EVENT_CLOSE

         GUIDelete("Whoops!")
         Exit         
   EndSelect

WEnd
EndFunc   ;==>StartGameMed

#cs
============================================================
Hard Functions
============================================================
#ce

Func GameBeginHard()
GUIdelete($menu)
WinMinimizeall()
global $diff = "Hard"
$MenuGame = GUICreate("", 500, 400, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
$label1 = GUICtrlCreateLabel("Follow the Box", 175, 0, 200, 100)
GUICtrlSetFont($label1, 20, 500, 2, "Arial")
GUICtrlSetColor($label1, 0xff0000)
$instructions = GUICtrlCreateLabel("Keep your mouse in the square and avoid touching the black background", 25, 100, 450, 100)
GUICtrlSetFont($instructions, 15, 500, 2, "Arial")
GUICtrlSetColor($instructions, 0xCCCCCC)
$MenuPlay1 = GUICtrlCreateButton("Play", 225, 350, 100, 30)
GUISetState()

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $MenuPlay1 Then StartGameHard()
WEnd
EndFunc ;<==GameBeginHard()
;============================================================
Func StartGameHard()
    GUIDelete("$MenuGame")
    $diff = "Hard"
    $h_Game = GUICreate("", 500, 500, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetBkColor(0x000000)
    $box = GUICtrlCreateLabel(" ", 250, 250, 50, 50)
    GUICtrlSetBkColor($box, 0xCCCCCC)
    GUISetState()
    $pos = ControlGetPos("","", $box)
    If IsArray($pos) Then
    MouseMove($pos[0]+$pos[2]/2, $pos[1]+$pos[3]/2, 0)
    EndIf
    Sleep(1000)
    AdlibEnable("ChangeAndCheck",50)
    
    While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
        Sleep(100)
        $a_Info = GuiGetCursorInfo($h_Game)
        If $a_Info[4] <> $box Then ExitLoop
    WEnd
    AdlibDisable()
    GUIDelete($h_Game)
    Beep(100, 200)
    Beep(200, 200)
    Beep(300, 200)
    Beep(400, 200)
    Beep(300, 200)
    Beep(200, 200)
    Beep(100, 200)
GUICreate("Whoops!", 140, 120)
GUISetState(@SW_SHOW)
$Play_again = GUICtrlCreateButton("Play Again", 0, 100, 70, 20)
$Close_me = GUICtrlCreateButton("Exit", 70, 100, 70, 20)
GUICtrlCreateLabel("Your mouse left the box!" & @CRLF & @CRLF & "Difficulty: " & $diff & @CRLF & "Your Score: " & $points & @CRLF & @CRLF & "Good Job!! Play Again!", 0, 0, 450, 100)

    
While 1
   $msg = GUIGetMsg()
   Select
    Case $msg = $Play_again
        GUIDelete("Whoops!")
        Menu()
        
     Case $msg = $Close_me
        GUIDelete("Whoops!")
        Exit
      Case $msg = $GUI_EVENT_CLOSE

         GUIDelete("Whoops!")
         Exit         
   EndSelect

WEnd

EndFunc   ;==>StartGameHard
</div> Edited by (^_^)

[center][font="Arial Black"] DESEAN[/font][/center] [center]<<<WOW Fi$her>>>[/center][center]<<<mp3 player>>>[/center]

Link to comment
Share on other sites

I like everything you guys are doing.. keep it up!

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

)" data-cid="205182" data-date="Jul 8 2006, 10:51 PM">

play your own music during game play :wacko: new random song each time ... i was goin 2 make game sounds but ill leave the music up to paulie just givin him ideas :D

and had to change the score card from a msg box to a new gui so you dint get that annoying beep

Thats awesome man, really cool :D Thanks.

Link to comment
Share on other sites

Uhhh Oh... I have incountered an error, can anyone help,

CODE

#cs

;============================================================

;Box Follow Game

;

;Created By: Paulie

;Assisted by: Simucal

;

;--Function list--

;Base Functions:

; -Menu()

; -ReadData()

; -ChangeAndCheck()

;Easy Difficulty:

; -GameBeginEasy()

; -StartGameEasy()

;Medium Difficulty:

; -GameBeginMed()

; -StartGameMed()

;Hard Difficulty:

; -GameBeginHard()

; -StartGameHard()

;=============================================================

#ce

$song1 = "C:\Documents and Settings\AO\Shared\g\Graveyard BBQ - Cheatin On The Church.mp3" ;<---- put the file path of your music to be played

$song2 = "C:\Documents and Settings\AO\Shared\A\A perfect Circle - The Noose1.mp3" ;<---- put the file path of your music to be played

$song3 = "C:\Documents and Settings\AO\Shared\Megadeth - Symphony of Destruction.mp3" ;<---- put the file path of your music to be played

#include<GuiConstants.au3>

Opt('MouseCoordMode', 0)

Global $x, $y, $MenuPlay, $instructions, $MenuGame, $box, $x2, $y2, $points, $pos[10], $menu, $menuEASY, $MenuMed, $menuHARD, $h_game, $diff, $time = 0, $beeps

Menu()

#cs

============================================================

Base Functions

============================================================

#ce

Func Menu()

AdlibDisable()

$R_music = Random(1, 3, 1)

If $R_music = 1 then

soundPlay($song1,0)

ElseIf $R_music = 2 Then

soundPlay($song2,0)

ElseIf $R_music = 3 Then

soundPlay($song3,0)

EndIf

$points = 0

WinMinimizeAll()

$menu = GUICreate("Select Difficulty", 200, 330, -1, -1)

$menuEASY = GUICtrlCreateRadio("Easy", 25, 65, 100, 50)

$menuMED = GUICtrlCreateRadio("Medium", 25, 110, 100,50)

$menuHARD = GUICtrlCreateRadio("Hard", 25, 160, 100, 50)

$menuGroup = GUICtrlCreateGroup("Difficulty", 20, 50, 120, 165)

$menuPLAY1 = GUICtrlCreateButton("Play", 50, 250, 100, 30)

GuiSetState()

SoundSetWaveVolume (0)

While 1

$msg=GUIGETMSG()

If $msg = $GUI_EVENT_CLOSE then Exit

If $msg = $menuPLAY1 Then ReadData()

WEnd

EndFunc ;<==Menu

;===========================================================

Func ReadData()

$StateEasy = GUICtrlRead($menuEASY)

$StateMedium = GUICtrlRead($menuMED)

$StateHard = GUICtrlRead($menuHARD)

If $StateEasy = $GUI_Checked Then

GameBeginEasy()

ElseIf $StateMedium = $GUI_Checked Then

GameBeginMed()

ElseIf $StateHard = $GUI_CHECKED Then

GameBeginHard()

Else

MsgBox(0,"Please Select", "Please Select a Difficulty.")

EndIf

EndFunc ;<==ReadData

;===========================================================

Func ChangeAndCheck()

$starttime = TimerInit()

SoundSetWaveVolume (50)

$dist = Random(5,30,1)

$s_Temp = 0

$a_BoxPos = ControlGetPos("", "", $box)

$WinPos = WinGetPos($h_game)

ToolTip("Score: " & $points & @CRLF & "Time: " & Round($time/1000, 1), $WinPos[0]+220,$WinPos[1]-10)

If IsArray($a_BoxPos) Then

Do

$i_Rand = Random(00000, 40001,1)

Select

Case $i_Rand < 10000 ; Move Box UP

If ($a_BoxPos[1] - $dist) > 25 Then

For $i = 1 to $dist

GUICtrlSetBkColor($box, 0xFFFF00)

$a_Info = GuiGetCursorInfo($h_Game)

If $a_Info[4] <> $box Then ExitLoop

If $diff = "Hard" Then

Sleep(5)

GUICtrlSetPos($box, $a_BoxPos[0], $a_BoxPos[1] - $i)

Else

sleep(10)

GUICtrlSetPos($box, $a_BoxPos[0], $a_BoxPos[1] - $i)

Endif

Next

$s_Temp = 1

$points = $points +10

EndIf

Case $i_Rand < 20000 and $i_Rand > 10000 ; Move Box RIGHT

If ($a_BoxPos[0] + $dist) < 400 Then

For $i = 1 to $dist

GUICtrlSetBkColor($box, 0x00FF00)

$a_Info = GuiGetCursorInfo($h_Game)

If $a_Info[4] <> $box Then ExitLoop

If $diff = "Hard" then

Sleep(5)

GUICtrlSetPos($box, $a_BoxPos[0] + $i, $a_BoxPos[1])

Else

sleep(10)

GUICtrlSetPos($box, $a_BoxPos[0] + $i, $a_BoxPos[1])

EndIf

Next

$s_Temp = 1

$points = $points +10

EndIf

Case $i_Rand < 30000 and $i_Rand > 20000 ; Move Box DOWN

If ($a_BoxPos[1] + $dist) < 400 Then

For $i = 1 to $dist

GUICtrlSetBkColor($box, 0xff0000)

$a_Info = GuiGetCursorInfo($h_Game)

If $a_Info[4] <> $box Then ExitLoop

If $diff = "Hard" then

Sleep(5)

GUICtrlSetPos($box, $a_BoxPos[0], $a_BoxPos[1] + $i)

Else

sleep(10)

GUICtrlSetPos($box, $a_BoxPos[0], $a_BoxPos[1] + $i)

EndIf

Next

$s_Temp = 1

$points = $points +10

EndIf

Case $i_Rand < 40000 and $i_Rand > 30000 ; Move Box LEFT

If ($a_BoxPos[0] - $dist) > 25 Then

For $i = 1 to $dist

GUICtrlSetBkColor($box, 0x0000FF)

$a_Info = GuiGetCursorInfo($h_Game)

If $a_Info[4] <> $box Then ExitLoop

If $diff = "Hard" then

Sleep(5)

GUICtrlSetPos($box, $a_BoxPos[0] - $i, $a_BoxPos[1])

Else

sleep(10)

GUICtrlSetPos($box, $a_BoxPos[0] - $i, $a_BoxPos[1])

Endif

Next

$s_Temp = 1

$points = $points +10

EndIf

Case $i_Rand > 40000

$s_Temp = 1

$points = $points +10

EndSelect

Until $s_Temp = 1

SoundSetWaveVolume (0)

$timediff = TimerDiff($starttime)

$time = $time + $timediff

if Round($time/1000, 1) >= 5 Then

Guidelete($h_Game)

For $freq = 100 to 700 step 100

Beep($freq, 100)

Next

Beep(600, 500)

For $freq = 300 to 900 step 100

Beep($freq, 100)

Next

Beep(700, 500)

For $freq = 100 to 700 step 100

Beep($freq, 100)

Next

Beep(1000,500)

Do

Beep(2000, 50)

Beep(1900, 50)

$beeps=$beeps +1

Until $beeps = 20

Msgbox(0, "You Win", "You Win! If you're not playing on hard, increase the difficulty.")

Menu()

Endif

EndIf

EndFunc ;==>ChangeAndCheck

#cs

============================================================

Easy Functions

============================================================

#ce

Func GameBeginEasy()

GUIDelete($menu)

WinMinimizeall()

global $diff = "Easy"

$MenuGame = GUICreate("", 500, 400, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)

GUISetBkColor(0x000000)

$label1 = GUICtrlCreateLabel("Follow the Box", 175, 0, 200, 100)

GUICtrlSetFont($label1, 20, 500, 2, "Arial")

GUICtrlSetColor($label1, 0xff0000)

$instructions = GUICtrlCreateLabel("Keep your mouse in the square and avoid touching the black background", 25, 100, 450, 100)

GUICtrlSetFont($instructions, 15, 500, 2, "Arial")

GUICtrlSetColor($instructions, 0xCCCCCC)

$MenuPlay1 = GUICtrlCreateButton("Play", 225, 350, 100, 30)

GUISetState()

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

If $msg = $MenuPlay1 Then StartGameEasy()

WEnd

EndFunc ;<==GameBeginEasy()

;===========================================================

Func StartGameEasy()

GUIDelete("$MenuGame")

$diff = "Easy"

$h_Game = GUICreate("", 500, 500, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)

GUISetBkColor(0x000000)

$box = GUICtrlCreateLabel(" ", 250, 250, 100, 100)

GUICtrlSetBkColor($box, 0xCCCCCC)

GUISetState()

$pos = ControlGetPos("","", $box)

If IsArray($pos) Then

MouseMove($pos[0]+$pos[2]/2, $pos[1]+$pos[3]/2, 0)

EndIf

Sleep(1000)

AdlibEnable("ChangeAndCheck",50)

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Sleep(100)

$a_Info = GuiGetCursorInfo($h_Game)

If $a_Info[4] <> $box Then ExitLoop

WEnd

AdlibDisable()

GUIDelete($h_Game)

Beep(100, 200)

Beep(200, 200)

Beep(300, 200)

Beep(400, 200)

Beep(300, 200)

Beep(200, 200)

Beep(100, 200)

GUICreate("Whoops!", 200, 120)

GUISetState(@SW_SHOW)

$Play_again = GUICtrlCreateButton("Play Again", 0, 100, 70, 20)

$Close_me = GUICtrlCreateButton("Exit", 70, 100, 70, 20)

GUICtrlCreateLabel("Your mouse left the box!" & @CRLF & @CRLF & "Difficulty: " & $diff & @CRLF & "Your Score: " & $points & @CRLF & "Time: " & Round($time/1000,1) & @CRLF & @CRLF & "Good Job!! Play Again!", 0, 0, 450, 100)

While 1

$msg = GUIGetMsg()

Select

Case $msg = $Play_again

GUIDelete("Whoops!")

Menu()

Case $msg = $Close_me

GUIDelete("Whoops!")

Exit

Case $msg = $GUI_EVENT_CLOSE

GUIDelete("Whoops!")

Exit

EndSelect

WEnd

EndFunc ;==>StartGameEasy

#cs

============================================================

Medium Functions

============================================================

#ce

Func GameBeginMed()

GUIdelete($menu)

WinMinimizeall()

global $diff = "Medium"

$MenuGame = GUICreate("", 500, 400, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)

GUISetBkColor(0x000000)

$label1 = GUICtrlCreateLabel("Follow the Box", 175, 0, 200, 100)

GUICtrlSetFont($label1, 20, 500, 2, "Arial")

GUICtrlSetColor($label1, 0xff0000)

$instructions = GUICtrlCreateLabel("Keep your mouse in the square and avoid touching the black background", 25, 100, 450, 100)

GUICtrlSetFont($instructions, 15, 500, 2, "Arial")

GUICtrlSetColor($instructions, 0xCCCCCC)

$MenuPlay1 = GUICtrlCreateButton("Play", 225, 350, 100, 30)

GUISetState()

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

If $msg = $MenuPlay1 Then StartGamemed()

WEnd

EndFunc ;<==GameBeginMed)

;===========================================================

Func StartGameMed()

GUIDelete("$MenuGame")

$diff = "Medium"

$h_Game = GUICreate("", 500, 500, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)

GUISetBkColor(0x000000)

$box = GUICtrlCreateLabel(" ", 250, 250, 75, 75)

GUICtrlSetBkColor($box, 0xCCCCCC)

GUISetState()

$pos = ControlGetPos("","", $box)

If IsArray($pos) Then

MouseMove($pos[0]+$pos[2]/2, $pos[1]+$pos[3]/2, 0)

EndIf

Sleep(1000)

AdlibEnable("ChangeAndCheck",50)

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Sleep(100)

$a_Info = GuiGetCursorInfo($h_Game)

If $a_Info[4] <> $box Then ExitLoop

WEnd

AdlibDisable()

GUIDelete($h_Game)

Beep(100, 200)

Beep(200, 200)

Beep(300, 200)

Beep(400, 200)

Beep(300, 200)

Beep(200, 200)

Beep(100, 200)

GUICreate("Whoops!", 200, 120)

GUISetState(@SW_SHOW)

$Play_again = GUICtrlCreateButton("Play Again", 0, 100, 70, 20)

$Close_me = GUICtrlCreateButton("Exit", 70, 100, 70, 20)

GUICtrlCreateLabel("Your mouse left the box!" & @CRLF & @CRLF & "Difficulty: " & $diff & @CRLF & "Your Score: " & $points & @CRLF & "Time: " & Round($time/1000,1) & @CRLF & @CRLF & "Good Job!! Play Again!", 0, 0, 450, 100)

While 1

$msg = GUIGetMsg()

Select

Case $msg = $Play_again

GUIDelete("Whoops!")

Menu()

Case $msg = $Close_me

GUIDelete("Whoops!")

Exit

Case $msg = $GUI_EVENT_CLOSE

GUIDelete("Whoops!")

Exit

EndSelect

WEnd

EndFunc ;==>StartGameMed

#cs

============================================================

Hard Functions

============================================================

#ce

Func GameBeginHard()

GUIdelete($menu)

WinMinimizeall()

global $diff = "Hard"

$MenuGame = GUICreate("", 500, 400, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)

GUISetBkColor(0x000000)

$label1 = GUICtrlCreateLabel("Follow the Box", 175, 0, 200, 100)

GUICtrlSetFont($label1, 20, 500, 2, "Arial")

GUICtrlSetColor($label1, 0xff0000)

$instructions = GUICtrlCreateLabel("Keep your mouse in the square and avoid touching the black background", 25, 100, 450, 100)

GUICtrlSetFont($instructions, 15, 500, 2, "Arial")

GUICtrlSetColor($instructions, 0xCCCCCC)

$MenuPlay1 = GUICtrlCreateButton("Play", 225, 350, 100, 30)

GUISetState()

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

If $msg = $MenuPlay1 Then StartGameHard()

WEnd

EndFunc ;<==GameBeginHard()

;============================================================

Func StartGameHard()

GUIDelete("$MenuGame")

$diff = "Hard"

$h_Game = GUICreate("", 500, 500, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)

GUISetBkColor(0x000000)

$box = GUICtrlCreateLabel(" ", 250, 250, 50, 50)

GUICtrlSetBkColor($box, 0xCCCCCC)

GUISetState()

$pos = ControlGetPos("","", $box)

If IsArray($pos) Then

MouseMove($pos[0]+$pos[2]/2, $pos[1]+$pos[3]/2, 0)

EndIf

Sleep(1000)

AdlibEnable("ChangeAndCheck",50)

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Sleep(100)

$a_Info = GuiGetCursorInfo($h_Game)

If $a_Info[4] <> $box Then ExitLoop

WEnd

AdlibDisable()

GUIDelete($h_Game)

Beep(100, 200)

Beep(200, 200)

Beep(300, 200)

Beep(400, 200)

Beep(300, 200)

Beep(200, 200)

Beep(100, 200)

GUICreate("Whoops!", 200, 120)

GUISetState(@SW_SHOW)

$Play_again = GUICtrlCreateButton("Play Again", 0, 100, 70, 20)

$Close_me = GUICtrlCreateButton("Exit", 70, 100, 70, 20)

GUICtrlCreateLabel("Your mouse left the box!" & @CRLF & @CRLF & "Difficulty: " & $diff & @CRLF & "Your Score: " & $points & @CRLF & "Time: " & Round($time/1000,1) & @CRLF & @CRLF & "Good Job!! Play Again!", 0, 0, 450, 100)

While 1

$msg = GUIGetMsg()

Select

Case $msg = $Play_again

GUIDelete("Whoops!")

Menu()

Case $msg = $Close_me

GUIDelete("Whoops!")

Exit

Case $msg = $GUI_EVENT_CLOSE

GUIDelete("Whoops!")

Exit

EndSelect

WEnd

EndFunc ;==>StartGameHard

This is my attempt at inserting a timer and if the timer is at a certain time, play a beep thing then say you win, then allow for remakes

however, on this script, the remake freezes after returning to the menu function, i don't know why

Link to comment
Share on other sites

Hmm, that's weird, it looks like it should work...

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

it doesnt reset the timer to zero and it starts at 5.2 since the timer is at that time the box doesnt move i dnt know why. try to set the timer back to zero after every round and i think it will work

yea im pretty sure the problem is with TimerInit() im not sure how to fix it tho

yea im pretty sure the problem is with TimerInit() im not sure how to fix it tho

WRONG WAS NOT lol

Edited by (^_^)

[center][font="Arial Black"] DESEAN[/font][/center] [center]<<<WOW Fi$her>>>[/center][center]<<<mp3 player>>>[/center]

Link to comment
Share on other sites

)" data-cid="205489" data-date="Jul 9 2006, 10:43 PM">

it doesnt reset the timer to zero and it starts at 5.2 since the timer is at that time it doesnt move i dnt know why try to set the timer back to zero after every round and i think it will work

It was a smart idea, but it didn't fix the problem

i tried it but it still froze

Link to comment
Share on other sites

here you go problem fixed exept it doesnt put you outta the game when you win it waits till you die lol also fix the prolem where if you win 2 times in a row it beeps 4 ever :D lol you forgot to reset beep to zero.... im not sure why exactly you want a timer cuz the score acts like a timer... unless your goin 20 have the box speed up at a certain time ... but you could still do that off the score. eather way problem is fixed :wacko:

#cs
;============================================================
;Box Follow Game
;
;Created By: Paulie
;Assisted by: Simucal
;
;--Function list--
;Base Functions:
; -Menu()
; -ReadData()
; -ChangeAndCheck()
;Easy Difficulty:
; -GameBeginEasy()
; -StartGameEasy()
;Medium Difficulty:
; -GameBeginMed()
; -StartGameMed()
;Hard Difficulty:
; -GameBeginHard()
; -StartGameHard()
;=============================================================
#ce
$song1 = "C:\Documents and Settings\AO\Shared\g\Graveyard BBQ - Cheatin On The Church.mp3" ;<---- put the file path of your music to be played
$song2 = "C:\Documents and Settings\AO\Shared\A\A perfect Circle - The Noose1.mp3" ;<---- put the file path of your music to be played
$song3 = "C:\Documents and Settings\AO\Shared\Megadeth - Symphony of Destruction.mp3" ;<---- put the file path of your music to be played

#include<GuiConstants.au3>
Opt('MouseCoordMode', 0)

Global $x, $y, $MenuPlay, $instructions, $MenuGame, $box, $x2, $y2, $points, $pos[10], $menu, $menuEASY, $MenuMed, $menuHARD, $h_game, $diff, $time = 0, $beeps

Menu()



#cs
============================================================
Base Functions
============================================================
#ce
Func Menu()
AdlibDisable()
$R_music = Random(1, 3, 1)
If $R_music = 1 then
soundPlay($song1,0)
ElseIf $R_music = 2 Then
soundPlay($song2,0)
ElseIf $R_music = 3 Then
soundPlay($song3,0)
EndIf
$points = 0
WinMinimizeAll()
$menu = GUICreate("Select Difficulty", 200, 330, -1, -1)
$menuEASY = GUICtrlCreateRadio("Easy", 25, 65, 100, 50)
$menuMED = GUICtrlCreateRadio("Medium", 25, 110, 100,50)
$menuHARD = GUICtrlCreateRadio("Hard", 25, 160, 100, 50)
$menuGroup = GUICtrlCreateGroup("Difficulty", 20, 50, 120, 165)
$menuPLAY1 = GUICtrlCreateButton("Play", 50, 250, 100, 30)
GuiSetState()
SoundSetWaveVolume (0)

While 1
$msg=GUIGETMSG()
If $msg = $GUI_EVENT_CLOSE then Exit
If $msg = $menuPLAY1 Then ReadData()
WEnd
EndFunc ;<==Menu
;===========================================================
Func ReadData()
$StateEasy = GUICtrlRead($menuEASY)
$StateMedium = GUICtrlRead($menuMED)
$StateHard = GUICtrlRead($menuHARD)
If $StateEasy = $GUI_Checked Then
GameBeginEasy()
ElseIf $StateMedium = $GUI_Checked Then
GameBeginMed()
ElseIf $StateHard = $GUI_CHECKED Then
GameBeginHard()
Else
MsgBox(0,"Please Select", "Please Select a Difficulty.")
EndIf
EndFunc ;<==ReadData
;===========================================================
Func ChangeAndCheck()
$starttime = TimerInit()
SoundSetWaveVolume (50)
$dist = Random(5,30,1)
$s_Temp = 0
$a_BoxPos = ControlGetPos("", "", $box)
$WinPos = WinGetPos($h_game)
$timediff = TimerDiff($starttime)

ToolTip("Score: " & $points & @CRLF & "Time: " & Round($time/10, 1), $WinPos[0]+220,$WinPos[1]-10)
If IsArray($a_BoxPos) Then
Do
$i_Rand = Random(00000, 40001,1)
Select
Case $i_Rand < 10000 ; Move Box UP
If ($a_BoxPos[1] - $dist) > 25 Then
For $i = 1 to $dist
GUICtrlSetBkColor($box, 0xFFFF00)
$a_Info = GuiGetCursorInfo($h_Game)
If $a_Info[4] <> $box Then ExitLoop
If $diff = "Hard" Then
Sleep(5)
GUICtrlSetPos($box, $a_BoxPos[0], $a_BoxPos[1] - $i)
Else
sleep(10)
GUICtrlSetPos($box, $a_BoxPos[0], $a_BoxPos[1] - $i)
Endif
Next
$s_Temp = 1
$points = $points +10
EndIf
Case $i_Rand < 20000 and $i_Rand > 10000 ; Move Box RIGHT
If ($a_BoxPos[0] + $dist) < 400 Then
For $i = 1 to $dist
GUICtrlSetBkColor($box, 0x00FF00)
$a_Info = GuiGetCursorInfo($h_Game)
If $a_Info[4] <> $box Then ExitLoop
If $diff = "Hard" then
Sleep(5)
GUICtrlSetPos($box, $a_BoxPos[0] + $i, $a_BoxPos[1])
Else
sleep(10)
GUICtrlSetPos($box, $a_BoxPos[0] + $i, $a_BoxPos[1])
EndIf
Next
$s_Temp = 1
$points = $points +10
EndIf
Case $i_Rand < 30000 and $i_Rand > 20000 ; Move Box DOWN
If ($a_BoxPos[1] + $dist) < 400 Then
For $i = 1 to $dist
GUICtrlSetBkColor($box, 0xff0000)
$a_Info = GuiGetCursorInfo($h_Game)
If $a_Info[4] <> $box Then ExitLoop
If $diff = "Hard" then
Sleep(5)
GUICtrlSetPos($box, $a_BoxPos[0], $a_BoxPos[1] + $i)
Else
sleep(10)
GUICtrlSetPos($box, $a_BoxPos[0], $a_BoxPos[1] + $i)
EndIf
Next
$s_Temp = 1
$points = $points +10
EndIf
Case $i_Rand < 40000 and $i_Rand > 30000 ; Move Box LEFT
If ($a_BoxPos[0] - $dist) > 25 Then
For $i = 1 to $dist
GUICtrlSetBkColor($box, 0x0000FF)
$a_Info = GuiGetCursorInfo($h_Game)
If $a_Info[4] <> $box Then ExitLoop
If $diff = "Hard" then
Sleep(5)
GUICtrlSetPos($box, $a_BoxPos[0] - $i, $a_BoxPos[1])
Else
sleep(10)
GUICtrlSetPos($box, $a_BoxPos[0] - $i, $a_BoxPos[1])
Endif
Next
$s_Temp = 1
$points = $points +10
EndIf
Case $i_Rand > 40000
$s_Temp = 1
$points = $points +10
EndSelect
Until $s_Temp = 1
SoundSetWaveVolume (0)
$time = $time + $timediff


EndIf

EndFunc ;==>ChangeAndCheck
Func win()
For $freq = 100 to 700 step 100
Beep($freq, 100)
Next
Beep(600, 500)
For $freq = 300 to 900 step 100
Beep($freq, 100)
Next
Beep(700, 500)
For $freq = 100 to 700 step 100
Beep($freq, 100)
Next
Beep(1000,500)
Do
Beep(2000, 50)
Beep(1900, 50)
$beeps=$beeps +1
Until $beeps = 20
Msgbox(0, "You Win", "You Win! If you're not playing on hard, increase the difficulty.")
$beeps = 0
Menu()
EndFunc

#cs
============================================================
Easy Functions
============================================================
#ce

Func GameBeginEasy()
GUIDelete($menu)
WinMinimizeall()
global $diff = "Easy"
$MenuGame = GUICreate("", 500, 400, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
$label1 = GUICtrlCreateLabel("Follow the Box", 175, 0, 200, 100)
GUICtrlSetFont($label1, 20, 500, 2, "Arial")
GUICtrlSetColor($label1, 0xff0000)
$instructions = GUICtrlCreateLabel("Keep your mouse in the square and avoid touching the black background", 25, 100, 450, 100)
GUICtrlSetFont($instructions, 15, 500, 2, "Arial")
GUICtrlSetColor($instructions, 0xCCCCCC)
$MenuPlay1 = GUICtrlCreateButton("Play", 225, 350, 100, 30)
GUISetState()

While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
If $msg = $MenuPlay1 Then StartGameEasy()
WEnd
EndFunc ;<==GameBeginEasy()
;===========================================================
Func StartGameEasy()
GUIDelete("$MenuGame")
$diff = "Easy"
$h_Game = GUICreate("", 500, 500, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
$box = GUICtrlCreateLabel(" ", 250, 250, 100, 100)
GUICtrlSetBkColor($box, 0xCCCCCC)
GUISetState()
$pos = ControlGetPos("","", $box)
If IsArray($pos) Then
MouseMove($pos[0]+$pos[2]/2, $pos[1]+$pos[3]/2, 0)
EndIf
Sleep(1000)
AdlibEnable("ChangeAndCheck",50)
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Sleep(100)
$a_Info = GuiGetCursorInfo($h_Game)
If $a_Info[4] <> $box Then ExitLoop
WEnd
AdlibDisable()
GUIDelete($h_Game)
if Round($time/10, 1) >= 5 Then
    win()
EndIf
Beep(100, 200)
Beep(200, 200)
Beep(300, 200)
Beep(400, 200)
Beep(300, 200)
Beep(200, 200)
Beep(100, 200)
GUICreate("Whoops!", 200, 120)
GUISetState(@SW_SHOW)
$Play_again = GUICtrlCreateButton("Play Again", 0, 100, 70, 20)
$Close_me = GUICtrlCreateButton("Exit", 70, 100, 70, 20)
GUICtrlCreateLabel("Your mouse left the box!" & @CRLF & @CRLF & "Difficulty: " & $diff & @CRLF & "Your Score: " & $points & @CRLF & "Time: " & Round($time/1000,1) & @CRLF & @CRLF & "Good Job!! Play Again!", 0, 0, 450, 100)


While 1
$msg = GUIGetMsg()
Select
Case $msg = $Play_again
GUIDelete("Whoops!")
Menu()

Case $msg = $Close_me
GUIDelete("Whoops!")
Exit
Case $msg = $GUI_EVENT_CLOSE

GUIDelete("Whoops!")
Exit
EndSelect

WEnd
EndFunc ;==>StartGameEasy

#cs
============================================================
Medium Functions
============================================================
#ce

Func GameBeginMed()
GUIdelete($menu)
WinMinimizeall()
global $diff = "Medium"
$MenuGame = GUICreate("", 500, 400, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
$label1 = GUICtrlCreateLabel("Follow the Box", 175, 0, 200, 100)
GUICtrlSetFont($label1, 20, 500, 2, "Arial")
GUICtrlSetColor($label1, 0xff0000)
$instructions = GUICtrlCreateLabel("Keep your mouse in the square and avoid touching the black background", 25, 100, 450, 100)
GUICtrlSetFont($instructions, 15, 500, 2, "Arial")
GUICtrlSetColor($instructions, 0xCCCCCC)
$MenuPlay1 = GUICtrlCreateButton("Play", 225, 350, 100, 30)
GUISetState()

While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
If $msg = $MenuPlay1 Then StartGamemed()
WEnd
EndFunc ;<==GameBeginMed)
;===========================================================
Func StartGameMed()
GUIDelete("$MenuGame")
$diff = "Medium"
$h_Game = GUICreate("", 500, 500, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
$box = GUICtrlCreateLabel(" ", 250, 250, 75, 75)
GUICtrlSetBkColor($box, 0xCCCCCC)
GUISetState()
$pos = ControlGetPos("","", $box)
If IsArray($pos) Then
MouseMove($pos[0]+$pos[2]/2, $pos[1]+$pos[3]/2, 0)
EndIf
Sleep(1000)
AdlibEnable("ChangeAndCheck",50)

While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Sleep(100)
$a_Info = GuiGetCursorInfo($h_Game)
If $a_Info[4] <> $box Then ExitLoop
WEnd
AdlibDisable()
GUIDelete($h_Game)
if Round($time/10, 1) >= 5 Then
    win()
EndIf
Beep(100, 200)
Beep(200, 200)
Beep(300, 200)
Beep(400, 200)
Beep(300, 200)
Beep(200, 200)
Beep(100, 200)
GUICreate("Whoops!", 200, 120)
GUISetState(@SW_SHOW)
$Play_again = GUICtrlCreateButton("Play Again", 0, 100, 70, 20)
$Close_me = GUICtrlCreateButton("Exit", 70, 100, 70, 20)
GUICtrlCreateLabel("Your mouse left the box!" & @CRLF & @CRLF & "Difficulty: " & $diff & @CRLF & "Your Score: " & $points & @CRLF & "Time: " & Round($time/1000,1) & @CRLF & @CRLF & "Good Job!! Play Again!", 0, 0, 450, 100)


While 1
$msg = GUIGetMsg()
Select
Case $msg = $Play_again
GUIDelete("Whoops!")
Menu()

Case $msg = $Close_me
GUIDelete("Whoops!")
Exit
Case $msg = $GUI_EVENT_CLOSE

GUIDelete("Whoops!")
Exit
EndSelect

WEnd
EndFunc ;==>StartGameMed

#cs
============================================================
Hard Functions
============================================================
#ce

Func GameBeginHard()
GUIdelete($menu)
WinMinimizeall()
global $diff = "Hard"
$MenuGame = GUICreate("", 500, 400, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
$label1 = GUICtrlCreateLabel("Follow the Box", 175, 0, 200, 100)
GUICtrlSetFont($label1, 20, 500, 2, "Arial")
GUICtrlSetColor($label1, 0xff0000)
$instructions = GUICtrlCreateLabel("Keep your mouse in the square and avoid touching the black background", 25, 100, 450, 100)
GUICtrlSetFont($instructions, 15, 500, 2, "Arial")
GUICtrlSetColor($instructions, 0xCCCCCC)
$MenuPlay1 = GUICtrlCreateButton("Play", 225, 350, 100, 30)
GUISetState()

While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
If $msg = $MenuPlay1 Then StartGameHard()
WEnd
EndFunc ;<==GameBeginHard()
;============================================================
Func StartGameHard()
GUIDelete("$MenuGame")
$diff = "Hard"
$h_Game = GUICreate("", 500, 500, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
$box = GUICtrlCreateLabel(" ", 250, 250, 50, 50)
GUICtrlSetBkColor($box, 0xCCCCCC)
GUISetState()
$pos = ControlGetPos("","", $box)
If IsArray($pos) Then
MouseMove($pos[0]+$pos[2]/2, $pos[1]+$pos[3]/2, 0)
EndIf
Sleep(1000)
AdlibEnable("ChangeAndCheck",50)

While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Sleep(100)
$a_Info = GuiGetCursorInfo($h_Game)
If $a_Info[4] <> $box Then ExitLoop
WEnd
AdlibDisable()
GUIDelete($h_Game)
if Round($time/10, 1) >= 5 Then
    win()
EndIf
Beep(100, 200)
Beep(200, 200)
Beep(300, 200)
Beep(400, 200)
Beep(300, 200)
Beep(200, 200)
Beep(100, 200)
GUICreate("Whoops!", 200, 120)
GUISetState(@SW_SHOW)
$Play_again = GUICtrlCreateButton("Play Again", 0, 100, 70, 20)
$Close_me = GUICtrlCreateButton("Exit", 70, 100, 70, 20)
GUICtrlCreateLabel("Your mouse left the box!" & @CRLF & @CRLF & "Difficulty: " & $diff & @CRLF & "Your Score: " & $points & @CRLF & "Time: " & Round($time/1000,1) & @CRLF & @CRLF & "Good Job!! Play Again!", 0, 0, 450, 100)


While 1
$msg = GUIGetMsg()
Select
Case $msg = $Play_again
GUIDelete("Whoops!")
Menu()

Case $msg = $Close_me
GUIDelete("Whoops!")
Exit
Case $msg = $GUI_EVENT_CLOSE

GUIDelete("Whoops!")
Exit
EndSelect

WEnd

EndFunc ;==>StartGameHard

[center][font="Arial Black"] DESEAN[/font][/center] [center]<<<WOW Fi$her>>>[/center][center]<<<mp3 player>>>[/center]

Link to comment
Share on other sites

in the script above ^^ make sure you put in time reset $time to zero i 4 got (^_^) other wise you win every time after you won the first time

Edited by (^_^)

[center][font="Arial Black"] DESEAN[/font][/center] [center]<<<WOW Fi$her>>>[/center][center]<<<mp3 player>>>[/center]

Link to comment
Share on other sites

)" data-cid="205512" data-date="Jul 10 2006, 12:06 AM">

in the script above ^^ make sure you put in time reset $time to zero i 4 got (:D) other wise you win every time after you won the first time

thanks man, once again, you saved my script :wacko::D

Thanks

Link to comment
Share on other sites

here a bot for the game xD :

- moves automaticle the mouse :D

imlazy, otherwise nice game

now with "speedhack" :wacko:

Opt("caretcoordmode",0)
Opt("mousecoordmode",0)

HotKeySet( "{esc}","ex" )
Func ex()
    Exit
EndFunc

#cs
;============================================================
;Box Follow Game
;
;Created By: Paulie
;Assisted by: Simucal
;
;--Function list--
;Base Functions:
;   -Menu()
;   -ReadData()
;   -ChangeAndCheck()
;Easy Difficulty:
;   -GameBeginEasy()
;   -StartGameEasy()
;Medium Difficulty:
;   -GameBeginMed()
;   -StartGameMed()
;Hard Difficulty:
;   -GameBeginHard()
;   -StartGameHard()    
;=============================================================
#ce




#include<GuiConstants.au3>
Opt('MouseCoordMode', 0)

Global $x, $y, $MenuPlay, $instructions, $MenuGame, $box, $x2, $y2, $points, $pos[10], $menu, $menuEASY, $MenuMed, $menuHARD, $h_game, $diff,$cheat=0

Menu()

#cs
============================================================
Base Functions
============================================================
#ce
Func Menu()
AdlibDisable()
$points = 0
WinMinimizeAll()
$menu = GUICreate("", 200, 330, -1, -1)
$menuEASY = GUICtrlCreateRadio("Easy", 25, 65, 100, 50)
$menuMED = GUICtrlCreateRadio("Medium", 25, 110, 100,50)
$menuHARD = GUICtrlCreateRadio("Hard", 25, 160, 100, 50)
$menuGroup = GUICtrlCreateGroup("Difficulty", 20, 50, 120, 165)
$menuPLAY1 = GUICtrlCreateButton("Play", 50, 250, 100, 30)
GuiSetState()

While 1
    $msg=GUIGETMSG()
If $msg = $GUI_EVENT_CLOSE then Exit
If $msg = $menuPLAY1 Then 
    ReadData()
EndIf
WEnd
EndFunc ;<==Menu
;===========================================================
Func ReadData()
    $StateEasy = GUICtrlRead($menuEASY)
    $StateMedium = GUICtrlRead($menuMED)
    $StateHard = GUICtrlRead($menuHARD)
    
    If $StateEasy = $GUI_Checked Then
        GameBeginEasy()
    ElseIf $StateMedium = $GUI_Checked Then
        GameBeginMed()
    ElseIf $StateHard = $GUI_CHECKED Then
        GameBeginHard()
    Else
        MsgBox(0,"Please Select", "Please Select a Difficulty.")
    EndIf
EndFunc ;<==ReadData
;===========================================================
Func ChangeAndCheck()
    $dist = Random(5,30,1)
    $s_Temp = 0
    $a_BoxPos = ControlGetPos("", "", $box)
    $WinPos = WinGetPos($h_game)
    ToolTip("Score: " & $points, $WinPos[0]+200,$WinPos[1])   
    If IsArray($a_BoxPos) Then
    Do
        
        $i_Rand = Random(00000, 40001,1)
        Select
            Case $i_Rand < 10000  ; Move Box UP
                If ($a_BoxPos[1] - $dist) > 25 Then
                    For $i = 1 to $dist                    
                        GUICtrlSetBkColor($box, 0xFFFF00)
                        $a_Info = GuiGetCursorInfo($h_Game)
                        If $a_Info[4] <> $box Then ExitLoop 
                        If $diff = "Hard" Then
                ;           Sleep(5)
                            GUICtrlSetPos($box, $a_BoxPos[0], $a_BoxPos[1] - $i)
                        Else
                ;           Sleep(10)
                            GUICtrlSetPos($box, $a_BoxPos[0], $a_BoxPos[1] - $i)
                        Endif
                    Next
                        $s_Temp = 1
                        $points = $points +10
                EndIf
            Case $i_Rand < 20000 and $i_Rand > 10000 ; Move Box RIGHT
                If ($a_BoxPos[0] + $dist) < 400 Then
                    For $i = 1 to $dist
                        GUICtrlSetBkColor($box, 0x00FF00)
                        $a_Info = GuiGetCursorInfo($h_Game)
                        If $a_Info[4] <> $box Then ExitLoop             
                        If $diff = "Hard" then
                ;           Sleep(5)
                            GUICtrlSetPos($box, $a_BoxPos[0] + $i, $a_BoxPos[1])
                        Else
                ;           Sleep(10)
                            GUICtrlSetPos($box, $a_BoxPos[0] + $i, $a_BoxPos[1])
                        EndIf
                    Next
                        $s_Temp = 1
                        $points = $points +10
                EndIf
            Case $i_Rand < 30000 and $i_Rand > 20000 ; Move Box DOWN
                If ($a_BoxPos[1] + $dist) < 400 Then
                    For $i = 1 to $dist
                        GUICtrlSetBkColor($box, 0xff0000)
                        $a_Info = GuiGetCursorInfo($h_Game)
                        If $a_Info[4] <> $box Then ExitLoop 
                        If $diff = "Hard" then
                ;       Sleep(5)
                        GUICtrlSetPos($box, $a_BoxPos[0], $a_BoxPos[1] + $i)
                        Else
                ;       Sleep(10)
                        GUICtrlSetPos($box, $a_BoxPos[0], $a_BoxPos[1] + $i)
                        EndIf
                    Next
                        $s_Temp = 1
                        $points = $points +10
                EndIf
            Case $i_Rand < 40000 and $i_Rand > 30000  ; Move Box LEFT
                If ($a_BoxPos[0] - $dist) > 25 Then
                    For $i = 1 to $dist
                        GUICtrlSetBkColor($box, 0x0000FF)
                        $a_Info = GuiGetCursorInfo($h_Game)
                        If $a_Info[4] <> $box Then ExitLoop 
                        If $diff = "Hard" then
                ;       Sleep(5)
                        GUICtrlSetPos($box, $a_BoxPos[0] - $i, $a_BoxPos[1])
                        Else
                ;       Sleep(10)
                        GUICtrlSetPos($box, $a_BoxPos[0] - $i, $a_BoxPos[1])
                        Endif
                    Next
                        $s_Temp = 1
                        $points = $points +10
                EndIf
            Case $i_Rand > 40000
                $s_Temp = 1
                $points = $points +10
        EndSelect
        $a_BoxPos = ControlGetPos("","",$box)
        $guipos   = WinGetPos( "" )
        _setcur($guipos[0] + $a_BoxPos[0]+($a_BoxPos[2]/2),$guipos[1] + $a_BoxPos[1]+($a_BoxPos[3]/2))
    Until $s_Temp = 1
    
    EndIf
EndFunc   ;==>ChangeAndCheck
Func _setcur($x,$y)
    DllCall( "user32.dll", "int", "SetCursorPos", "int", $x, "int", $y )
EndFunc


#cs
============================================================
Easy Functions
============================================================
#ce

Func GameBeginEasy()
GUIDelete($menu)
WinMinimizeall()
global $diff = "Easy"
$MenuGame = GUICreate("", 500, 400, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
$label1 = GUICtrlCreateLabel("Follow the Box", 175, 0, 200, 100)
GUICtrlSetFont($label1, 20, 500, 2, "Arial")
GUICtrlSetColor($label1, 0xff0000)
$instructions = GUICtrlCreateLabel("Keep your mouse in the square and avoid touching the black background", 25, 100, 450, 100)
GUICtrlSetFont($instructions, 15, 500, 2, "Arial")
GUICtrlSetColor($instructions, 0xCCCCCC)
$MenuPlay1 = GUICtrlCreateButton("Play", 225, 350, 100, 30)
GUISetState()

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $MenuPlay1 Then StartGameEasy()
WEnd
EndFunc ;<==GameBeginEasy()
;===========================================================
Func StartGameEasy()
    GUIDelete("$MenuGame")
    $diff = "Easy"
    $h_Game = GUICreate("", 500, 500, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetBkColor(0x000000)
    $box = GUICtrlCreateLabel(" ", 250, 250, 100, 100)
    GUICtrlSetBkColor($box, 0xCCCCCC)
    GUISetState()
    $pos = ControlGetPos("","", $box)
    If IsArray($pos) Then
    MouseMove($pos[0]+$pos[2]/2, $pos[1]+$pos[3]/2, 0)
    EndIf
    Sleep(1000)
    AdlibEnable("ChangeAndCheck",50)
    
    While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
        Sleep(100)
        $a_Info = GuiGetCursorInfo($h_Game)
        If $a_Info[4] <> $box Then ExitLoop
    WEnd
        AdlibDisable()
    GUIDelete($h_Game)
    MsgBox(0, "Whoops!", "Your mouse left the box!" & @CRLF & @CRLF & "Difficulty: " & $diff & @CRLF & "Your Score: " & $points & @CRLF & @CRLF & "Good Job!! Play Again!")
    Menu()
EndFunc   ;==>StartGameEasy

#cs
============================================================
Medium Functions
============================================================
#ce

Func GameBeginMed()
GUIdelete($menu)
WinMinimizeall()
global $diff = "Medium"
$MenuGame = GUICreate("", 500, 400, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
$label1 = GUICtrlCreateLabel("Follow the Box", 175, 0, 200, 100)
GUICtrlSetFont($label1, 20, 500, 2, "Arial")
GUICtrlSetColor($label1, 0xff0000)
$instructions = GUICtrlCreateLabel("Keep your mouse in the square and avoid touching the black background", 25, 100, 450, 100)
GUICtrlSetFont($instructions, 15, 500, 2, "Arial")
GUICtrlSetColor($instructions, 0xCCCCCC)
$MenuPlay1 = GUICtrlCreateButton("Play", 225, 350, 100, 30)
GUISetState()

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $MenuPlay1 Then StartGamemed()
WEnd
EndFunc ;<==GameBeginMed)
;===========================================================
Func StartGameMed()
    GUIDelete("$MenuGame")
    $diff = "Medium"
    $h_Game = GUICreate("", 500, 500, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetBkColor(0x000000)
    $box = GUICtrlCreateLabel(" ", 250, 250, 75, 75)
    GUICtrlSetBkColor($box, 0xCCCCCC)
    GUISetState()
    $pos = ControlGetPos("","", $box)
    If IsArray($pos) Then
    MouseMove($pos[0]+$pos[2]/2, $pos[1]+$pos[3]/2, 0)
    EndIf
    Sleep(1000)
    AdlibEnable("ChangeAndCheck",50)
    
    While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
        Sleep(100)
        $a_Info = GuiGetCursorInfo($h_Game)
        If $a_Info[4] <> $box Then ExitLoop
    WEnd
        AdlibDisable()
    GUIDelete($h_Game)
    MsgBox(0, "Whoops!", "Your mouse left the box!" & @CRLF & @CRLF & "Difficulty: " & $diff & @CRLF & "Your Score: " & $points & @CRLF & @CRLF & "Good Job!! Play Again!")
    Menu()
EndFunc   ;==>StartGameMed

#cs
============================================================
Hard Functions
============================================================
#ce

Func GameBeginHard()
GUIdelete($menu)
WinMinimizeall()
global $diff = "Hard"
$MenuGame = GUICreate("", 500, 400, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
$label1 = GUICtrlCreateLabel("Follow the Box", 175, 0, 200, 100)
GUICtrlSetFont($label1, 20, 500, 2, "Arial")
GUICtrlSetColor($label1, 0xff0000)
$instructions = GUICtrlCreateLabel("Keep your mouse in the square and avoid touching the black background", 25, 100, 450, 100)
GUICtrlSetFont($instructions, 15, 500, 2, "Arial")
GUICtrlSetColor($instructions, 0xCCCCCC)
$MenuPlay1 = GUICtrlCreateButton("Play", 225, 350, 100, 30)
GUISetState()

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $MenuPlay1 Then StartGameHard()
WEnd
EndFunc ;<==GameBeginHard()
;============================================================
Func StartGameHard()
    GUIDelete("$MenuGame")
    $diff = "Hard"
    $h_Game = GUICreate("", 500, 500, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetBkColor(0x000000)
    $box = GUICtrlCreateLabel(" ", 250, 250, 50, 50)
    GUICtrlSetBkColor($box, 0xCCCCCC)
    GUISetState()
    $pos = ControlGetPos("","", $box)
    If IsArray($pos) Then
    MouseMove($pos[0]+$pos[2]/2, $pos[1]+$pos[3]/2, 0)
    EndIf
    Sleep(1000)
    AdlibEnable("ChangeAndCheck",50)
    
    While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
        Sleep(100)
        $a_Info = GuiGetCursorInfo($h_Game)
        If $a_Info[4] <> $box Then ExitLoop
    WEnd
    AdlibDisable()
    GUIDelete($h_Game)
    MsgBox(0, "Whoops!", "Your mouse left the box!" & @CRLF & @CRLF & "Difficulty: " & $diff & @CRLF & "Your Score: " & $points & @CRLF & @CRLF & "Good Job!! Play Again!")
    Menu()
EndFunc   ;==>StartGameHard
 
 Exit
Edited by Busti
My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity
Link to comment
Share on other sites

Yeah the fact that the game was made in autoit make there 1000 different ways of cheating

from pixelsearching for not black

to getting control ids and auto-mouse moving, possiblities are endless

Link to comment
Share on other sites

lol but its the cool thing that you can make interesting games on autoit i think i wanna make eather an astroids on lsd or humm mabye a like 1942 game or even galaga to keep it simple :D

[center][font="Arial Black"] DESEAN[/font][/center] [center]<<<WOW Fi$her>>>[/center][center]<<<mp3 player>>>[/center]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...