Jump to content

Fifteen Second Fury


erifash
 Share

Recommended Posts

Just click the box as many times as you can in 15 seconds. Pretty addicting! :lmao:

Global Const $GUI_EVENT_CLOSE = -3
Global Const $GUI_ENABLE = 64
Global Const $GUI_DISABLE = 128
Global Const $WS_CAPTION = 0x00C00000
Global Const $WS_SYSMENU = 0x00080000

Opt("GUIOnEventMode", 1)

Global $timer = 0, $points = 0, $box

$gui = GUICreate("Click the Box", 400, 300, -1, -1, $WS_CAPTION + $WS_SYSMENU)
$box = GUICtrlCreateLabel("", 192, 142, 13, 13)

GUICtrlSetBkColor($box, 0x44DD44)
GUISetBkColor(0x4488FF)
GUICtrlSetOnEvent($box, "_EventHandler")
GUISetOnEvent($GUI_EVENT_CLOSE, "_EventHandler", $gui)
GUISetState()

While 1
   Sleep(100)
   If not $timer Then ContinueLoop
   $diff = Round(15 - TimerDiff($timer) / 1000)
   WinSetTitle($gui, "", "Click the Box   -   " & $diff)
   If $diff <= 0 Then
      WinSetTitle($gui, "", "Click the Box")
      GUICtrlSetPos($box, 192, 142, 13, 13)
      GUICtrlSetState($box, $GUI_DISABLE)
      MsgBox(4096, "Score", $points)
      GUICtrlSetState($box, $GUI_ENABLE)
      $points = 0
      $timer = 0
   EndIf
WEnd

Func _EventHandler()
   Switch @GUI_CtrlId
      Case $GUI_EVENT_CLOSE
         Exit
      Case $box
         If not $timer Then $timer = TimerInit()
         GUICtrlSetPos($box, Random(10, 377), Random(10, 277), 13, 13)
         $points += 1
   EndSwitch
EndFunc

My personal best is 21.

Edited by erifash
Link to comment
Share on other sites

err.. i get the whole one line thing when i post it

I hate those Code Boxes

Global Const $GUI_EVENT_CLOSE = -3
Global Const $GUI_ENABLE = 64
Global Const $GUI_DISABLE = 128
Global Const $WS_CAPTION = 0x00C00000
Global Const $WS_SYSMENU = 0x00080000

Opt("GUIOnEventMode", 1)

Global $timer = 0, $points = 0, $box

$gui = GUICreate("Click the Box", 400, 300, -1, -1, $WS_CAPTION + $WS_SYSMENU)
$box = GUICtrlCreateLabel("", 192, 142, 13, 13)

GUICtrlSetBkColor($box, 0x44DD44)
GUISetBkColor(0x4488FF)
GUICtrlSetOnEvent($box, "_EventHandler")
GUISetOnEvent($GUI_EVENT_CLOSE, "_EventHandler", $gui)
GUISetState()

While 1
    Sleep(100)
    If Not $timer Then ContinueLoop
    $diff = Round(15 - TimerDiff($timer) / 1000)
    WinSetTitle($gui, "", "Click the Box   -   " & $diff)
    If $diff <= 0 Then
        WinSetTitle($gui, "", "Click the Box")
        GUICtrlSetPos($box, 192, 142, 13, 13)
        GUICtrlSetState($box, $GUI_DISABLE)
        MsgBox(4096, "Score", $points)
        GUICtrlSetState($box, $GUI_ENABLE)
        $points = 0
        $timer = 0
    EndIf
WEnd

Func _EventHandler()
    Switch @GUI_CtrlId
        Case $GUI_EVENT_CLOSE
            Exit
        Case $box
            If Not $timer Then $timer = TimerInit()
            GUICtrlSetPos($box, Random(10, 377), Random(10, 277), 13, 13)
            $points += 1
    EndSwitch
EndFunc   ;==>_EventHandler

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

err.. i get the whole one line thing when i post it

Thats odd because I haven't had that problem in ages. Anyway pasting in to wordpad first should remedy the problem.

Edit: Gary beat me.

Edited by SolidSnake
HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Link to comment
Share on other sites

Got 928 with a 4 line http://www.autoitscript.com/fileman/index.php?act=list&op=get&target=Bot.au3. :lmao:

Edit: Uploaded a http://www.autoitscript.com/fileman/users/SOLIDSNAKE/Botting.htm of the bot as a test of wink. However it only scores 803 in the video. :ph34r:

Edited by SolidSnake
HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Link to comment
Share on other sites

  • 9 months later...

I made a bot.. only worked half the time.....

anyway, 28 personal best, lol

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/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...