Jump to content

Just another game


gamerman2360
 Share

Recommended Posts

#include <misc.au3>
 HotKeySet("{space}", "Start")
 Global $i = 1, $user32 = DllOpen("user32.dll"), $duration = 15000
 
 ToolTip("Tap the spacebar as fast as you can.  No, holding it down will not work...", 10, 10)
 While Not IsDeclared("started")
     Sleep(100)
 WEnd
 
 $durationstamp = TimerInit()
 $curTime = 0
 While $curTime < $duration
     Sleep(50)
     $curTime = TimerDiff($durationstamp) 
     ToolTip(Round($duration-$curTime), 10, 10)
     If _IsPressed("20", $user32) And Mod($i, 2) Then
         $i += 1
         ConsoleWrite($i)
     ElseIf Not _IsPressed("20", $user32) And Not Mod($i, 2) Then
         $i += 1
         ConsoleWrite($i)
     EndIf
 WEnd
 MsgBox(0, "Score", "You got " & Round($i/2))
 
 Func Start()
     Assign("started", True, 2)
 EndFunc
Speaking of stupid games: http://www.pagetutor.com/idiot/idiot.html

Link to comment
Share on other sites

Lol i made one of these!!

#include <GuiConstants.au3>
$time = TimerInit()
Global $Box = GUICreate("Click Me!", 100, 100, -1, -1, $WS_POPUP, BitOr($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
    GUISetBkColor(0xFF0000,$box)
    $WIN = GUICtrlCreateButton("Click Me!", 25, 25, 50,50)
    GUISetState()
MouseClick("Left",0,0)
Global $speed = 15
While 1
    Global $window = WinGetPos("Click Me!")
    Global $mouse = MouseGetPos()
    $msg = GuiGetMsg()
    If $msg = $WIN Then
                GuiSetState(@SW_HIDE, $Box)
                $time2 = TimerDiff($time)
                $sec = Round($time2/1000,2)
        MsgBox(0,"Congratulations!", "Congratulations! You Won!"&@CRLF&"And it only took you "&$sec&" Seconds.")
        Exit
    Endif

    If $mouse[0] > $window[0]-5 And $mouse[0]<$window[0]+200 Then
        MoveRight()
    
    If $Msg = $GUI_EVENT_CLOSE then Exit
    EndIf
    
    If $mouse[0] < $window[0]+205 And $mouse[0]>$window[0] Then
        MoveLeft()
    EndIf
    
    If $mouse[1] > $window[1]-5 And $mouse[1] < $window[1]+200 Then
        MoveDown()                      
    EndIf
    
    If $mouse[1] < $window[1]+205 And $mouse[1] > $window[1] Then
        MoveUp()
    EndIf
    WinTrap(2,2, @desktopwidth-100, @desktopheight-100)
    _MouseTrap(2,2, @desktopwidth-4, @desktopheight-4)
WEnd

Func MoveRight()
    WinMove("Click Me!","", $window[0]+$speed, $window[1])
EndFunc

Func MoveLeft()
    WinMove("Click Me!","", $window[0]-$speed, $window[1])
EndFunc

Func MoveDown()
    WinMove("Click Me!","", $window[0], $window[1]+$speed)
EndFunc

Func MoveUp()
    WinMove("Click Me!","", $window[0], $window[1]-$speed)
EndFunc

Func WinTrap($iLeft, $iTop, $iWidth, $iHeight)
  Local $aPos, $iRight, $iBottom

  $iRight = $iLeft + $iWidth
  $iBottom = $iTop + $iHeight
  
  If $iLeft < 0 Or $iTop < 0 Or $iRight > @DesktopWidth Or $iBottom > @DesktopHeight Then
     SetError (1)
     Return 0
  EndIf
  $aPos = WinGetPos("Click Me!")
  
  Select
     Case $aPos[0] > $iRight
        WinMove("Click Me!","",$iLeft, $aPos[1])
     Case $aPos[0] < $iLeft
        WinMove("Click Me!","",$iRight, $aPos[1])
     Case $aPos[1] > $iBottom
        WinMove("Click Me!","",$aPos[0], $iTop)
     Case $aPos[1] < $iTop
        WinMove("Click Me!","",$aPos[0], $iBottom)
        
  EndSelect
  
EndFunc  ;==>_MouseTrap

Func _MouseTrap($iLeft, $iTop, $iWidth, $iHeight)
  Local $aPos, $iRight, $iBottom

  $iRight = $iLeft + $iWidth
  $iBottom = $iTop + $iHeight
  
  If $iLeft < 0 Or $iTop < 0 Or $iRight > @DesktopWidth Or $iBottom > @DesktopHeight Then
     SetError (1)
     Return 0
  EndIf
  $aPos = MouseGetPos()
  
  Select
     Case $aPos[0] > $iRight
        MouseMove($iLeft, $aPos[1], 0)
     Case $aPos[0] < $iLeft
        MouseMove($iRight, $aPos[1], 0)
     Case $aPos[1] > $iBottom
        MouseMove($aPos[0], $iTop, 0)
     Case $aPos[1] < $iTop
        MouseMove($aPos[0], $iBottom, 0)
        
  EndSelect
  
EndFunc  ;==>_MouseTrap
Edited by Paulie
Link to comment
Share on other sites

Lol i made one of these!!

It says I win instantly :/

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

Lol i made one of these!!

#include <GuiConstants.au3>
$time = TimerInit()
Global $Box = GUICreate("Click Me!", 100, 100, -1, -1, $WS_POPUP, BitOr($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
    GUISetBkColor(0xFF0000,$box)
    $WIN = GUICtrlCreateButton("Click Me!", 25, 25, 50,50)
    GUISetState()
MouseClick("Left",0,0)
Global $speed = 15
While 1
    Global $window = WinGetPos("Click Me!")
    Global $mouse = MouseGetPos()
    $msg = GuiGetMsg()
    If $msg = $WIN Then
                GuiSetState(@SW_HIDE, $Box)
                $time2 = TimerDiff($time)
                $sec = Round($time2/1000,2)
        MsgBox(0,"Congratulations!", "Congratulations! You Won!"&@CRLF&"And it only took you "&$sec&" Seconds.")
        Exit
    Endif

    If $mouse[0] > $window[0]-5 And $mouse[0]<$window[0]+200 Then
        MoveRight()
    
    If $Msg = $GUI_EVENT_CLOSE then Exit
    EndIf
    
    If $mouse[0] < $window[0]+205 And $mouse[0]>$window[0] Then
        MoveLeft()
    EndIf
    
    If $mouse[1] > $window[1]-5 And $mouse[1] < $window[1]+200 Then
        MoveDown()                      
    EndIf
    
    If $mouse[1] < $window[1]+205 And $mouse[1] > $window[1] Then
        MoveUp()
    EndIf
    WinTrap(2,2, @desktopwidth-100, @desktopheight-100)
    _MouseTrap(2,2, @desktopwidth-4, @desktopheight-4)
WEnd

Func MoveRight()
    WinMove("Click Me!","", $window[0]+$speed, $window[1])
EndFunc

Func MoveLeft()
    WinMove("Click Me!","", $window[0]-$speed, $window[1])
EndFunc

Func MoveDown()
    WinMove("Click Me!","", $window[0], $window[1]+$speed)
EndFunc

Func MoveUp()
    WinMove("Click Me!","", $window[0], $window[1]-$speed)
EndFunc

Func WinTrap($iLeft, $iTop, $iWidth, $iHeight)
  Local $aPos, $iRight, $iBottom

  $iRight = $iLeft + $iWidth
  $iBottom = $iTop + $iHeight
  
  If $iLeft < 0 Or $iTop < 0 Or $iRight > @DesktopWidth Or $iBottom > @DesktopHeight Then
     SetError (1)
     Return 0
  EndIf
  $aPos = WinGetPos("Click Me!")
  
  Select
     Case $aPos[0] > $iRight
        WinMove("Click Me!","",$iLeft, $aPos[1])
     Case $aPos[0] < $iLeft
        WinMove("Click Me!","",$iRight, $aPos[1])
     Case $aPos[1] > $iBottom
        WinMove("Click Me!","",$aPos[0], $iTop)
     Case $aPos[1] < $iTop
        WinMove("Click Me!","",$aPos[0], $iBottom)
        
  EndSelect
  
EndFunc  ;==>_MouseTrap

Func _MouseTrap($iLeft, $iTop, $iWidth, $iHeight)
  Local $aPos, $iRight, $iBottom

  $iRight = $iLeft + $iWidth
  $iBottom = $iTop + $iHeight
  
  If $iLeft < 0 Or $iTop < 0 Or $iRight > @DesktopWidth Or $iBottom > @DesktopHeight Then
     SetError (1)
     Return 0
  EndIf
  $aPos = MouseGetPos()
  
  Select
     Case $aPos[0] > $iRight
        MouseMove($iLeft, $aPos[1], 0)
     Case $aPos[0] < $iLeft
        MouseMove($iRight, $aPos[1], 0)
     Case $aPos[1] > $iBottom
        MouseMove($aPos[0], $iTop, 0)
     Case $aPos[1] < $iTop
        MouseMove($aPos[0], $iBottom, 0)
        
  EndSelect
  
EndFunc  ;==>_MouseTrap

Can you even beat this???

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

The highest i can get is 102

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

Lol i made one of these!!

#include <GuiConstants.au3>
$time = TimerInit()
Global $Box = GUICreate("Click Me!", 100, 100, -1, -1, $WS_POPUP, BitOr($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
    GUISetBkColor(0xFF0000,$box)
    $WIN = GUICtrlCreateButton("Click Me!", 25, 25, 50,50)
    GUISetState()
MouseClick("Left",0,0)
Global $speed = 15
While 1
    Global $window = WinGetPos("Click Me!")
    Global $mouse = MouseGetPos()
    $msg = GuiGetMsg()
    If $msg = $WIN Then
                GuiSetState(@SW_HIDE, $Box)
                $time2 = TimerDiff($time)
                $sec = Round($time2/1000,2)
        MsgBox(0,"Congratulations!", "Congratulations! You Won!"&@CRLF&"And it only took you "&$sec&" Seconds.")
        Exit
    Endif

    If $mouse[0] > $window[0]-5 And $mouse[0]<$window[0]+200 Then
        MoveRight()
    
    If $Msg = $GUI_EVENT_CLOSE then Exit
    EndIf
    
    If $mouse[0] < $window[0]+205 And $mouse[0]>$window[0] Then
        MoveLeft()
    EndIf
    
    If $mouse[1] > $window[1]-5 And $mouse[1] < $window[1]+200 Then
        MoveDown()            
    EndIf
    
    If $mouse[1] < $window[1]+205 And $mouse[1] > $window[1] Then
        MoveUp()
    EndIf
    WinTrap(2,2, @desktopwidth-100, @desktopheight-100)
    _MouseTrap(2,2, @desktopwidth-4, @desktopheight-4)
WEnd

Func MoveRight()
    WinMove("Click Me!","", $window[0]+$speed, $window[1])
EndFunc

Func MoveLeft()
    WinMove("Click Me!","", $window[0]-$speed, $window[1])
EndFunc

Func MoveDown()
    WinMove("Click Me!","", $window[0], $window[1]+$speed)
EndFunc

Func MoveUp()
    WinMove("Click Me!","", $window[0], $window[1]-$speed)
EndFunc

Func WinTrap($iLeft, $iTop, $iWidth, $iHeight)
  Local $aPos, $iRight, $iBottom

  $iRight = $iLeft + $iWidth
  $iBottom = $iTop + $iHeight
  
  If $iLeft < 0 Or $iTop < 0 Or $iRight > @DesktopWidth Or $iBottom > @DesktopHeight Then
     SetError (1)
     Return 0
  EndIf
  $aPos = WinGetPos("Click Me!")
  
  Select
     Case $aPos[0] > $iRight
        WinMove("Click Me!","",$iLeft, $aPos[1])
     Case $aPos[0] < $iLeft
        WinMove("Click Me!","",$iRight, $aPos[1])
     Case $aPos[1] > $iBottom
        WinMove("Click Me!","",$aPos[0], $iTop)
     Case $aPos[1] < $iTop
        WinMove("Click Me!","",$aPos[0], $iBottom)
        
  EndSelect
  
EndFunc  ;==>_MouseTrap

Func _MouseTrap($iLeft, $iTop, $iWidth, $iHeight)
  Local $aPos, $iRight, $iBottom

  $iRight = $iLeft + $iWidth
  $iBottom = $iTop + $iHeight
  
  If $iLeft < 0 Or $iTop < 0 Or $iRight > @DesktopWidth Or $iBottom > @DesktopHeight Then
     SetError (1)
     Return 0
  EndIf
  $aPos = MouseGetPos()
  
  Select
     Case $aPos[0] > $iRight
        MouseMove($iLeft, $aPos[1], 0)
     Case $aPos[0] < $iLeft
        MouseMove($iRight, $aPos[1], 0)
     Case $aPos[1] > $iBottom
        MouseMove($aPos[0], $iTop, 0)
     Case $aPos[1] < $iTop
        MouseMove($aPos[0], $iBottom, 0)
        
  EndSelect
  
EndFunc  ;==>_MouseTrap
>:ph34r: I can't click it...

LOL, I got the box selected and all I had to do was press enter(3.94s) :lmao:.. All that teleporting kinda makes it unfair... If I only had a touch screen.

Edited by gamerman2360
Link to comment
Share on other sites

>:ph34r: I can't click it...

LOL, I got the box selected and all I had to do was press enter(3.94s) :lmao:.. All that teleporting kinda makes it unfair... If I only had a touch screen.

Well, i dunno if you noticed, but the mouse loops from one side to the other as well. so you can just follow it through

I was trying to figure out how to make the 'Enter' thing not work, but i can't get it to

Link to comment
Share on other sites

HotKeySet("{ENTER}", "nothing")

Maybe?

Well, that would block enter for everything. What about moving the button all around a window, so we arn't clicking and opening anything/everything on our file infested, disorganized desktops... Or is that just me. Also you could try making 2 buttons, one is default but is hidden and does nothing. O, and make sure tab dosn't work.

104 on the space game without a bot...

How?? Lol...

I have an idea to expand further on the game :lmao:!!

Link to comment
Share on other sites

v2 :lmao:

"63ms off adv, 0.1ms lowest, hit space 14 times." Remember, you are only allowed to change the first line. Your supposed to hit space as many or as few times as you want in mode 1.

Global $mode = 1
#cs $mode
$mode affects the grading process/type of game
0 - # of hits (hit as fast as you can) [Default]
1 - adverage of how close you were to each second
(try to hit it every second., lower is better)
#ce

#include <misc.au3>
ToolTip("Waiting on the hotkey.", 10, 10)
Do
    Sleep(200)
Until HotKeySet("{Space}", "Start")
Global $i = 1, $user32 = DllOpen("user32.dll"), $duration = 15000, $timesofhit

$msg = "Tap the spacebar as fast as you can.  No, holding it down will not work..."
If $mode == 1 Then $msg = "Tap the spacebar at each second.  The timer is in miliseconds (s/1000)."
ToolTip($msg, 10, 10)
While Not IsDeclared("started")
    Sleep(100)
WEnd

$durationstamp = TimerInit()
$curTime = 0
Sleep(250); so the first won't count
While $curTime < $duration
    Sleep(50)
    $curTime = TimerDiff($durationstamp)
    ToolTip(Round($duration-$curTime), 10, 10)
    If _IsPressed("20", $user32) And Mod($i, 2) Then
        $i += 1
        $timesofhit &= $curTime & ";"
        ConsoleWrite($i)
    ElseIf Not _IsPressed("20", $user32) And Not Mod($i, 2) Then
        $i += 1
        ConsoleWrite($i)
    EndIf
WEnd
ToolTip("")

ConsoleWrite(@LF & "$timesofhit=" & $timesofhit & @CRLF)
$msg = " points!"
If $mode == 1 And $timesofhit Then; Need to hit at least once
    $timesofhit = StringSplit($timesofhit, ";")
    $i = 0
    $lowest = 500
    For $iteration = 1 To $timesofhit[0] - 2; last is blank
        $hit = Mod($timesofhit[$iteration], 1000)
        If $hit > 500 Then $hit = Abs($hit - 1000); if you hit too soon
        $i += $hit
        If $lowest > $hit Then $lowest = $hit
        ConsoleWrite("$hit=" & $hit & @LF)
    Next
    ConsoleWrite("$i=" & $i & @LF)
    $i /= $timesofhit[0]-1; adverage it
    $i *= 2; for that Round($i/2) thing below
    $msg = "ms off (adverage), with " & Round($lowest,1) & "ms off being the lowest.  You hit space " & $timesofhit[0]-1 & " times."
EndIf
MsgBox(0, "Score", "You got " & Round($i/2) & $msg)
Exit

Func Start()
    Assign("started", True, 2)
EndFunc
Edit:

111 on the space game... without a bot.

#)

P.S. My bot only got 25 at most.

Lol, what was the bot? Edited by gamerman2360
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...