Jump to content

catch the window


Worfox
 Share

Recommended Posts

One person beat it with dual monitors, I have dual monitors but I couldn't duplicate their solution. I believe some video drivers even have the option of preventing windows from leaving the screen. If you have a touch screen or a drawing pad it would be possible to catch it as well. Regardless all is forgiven. Just because I have looked to some of your scripts for examples :mellow:.

Just a side note, I'm disappointed in myself, I beat my catch the box by modifying my original script a little.

Giggity

Link to comment
Share on other sites

lol nice but its quite easy to beat if your running it out of scite.. well at least for me i ran it once just to see what would happen and figured out that the box moves relative to the mouse also the mouse is moved to create a distance from the box. however if you were to stop the mouse from moving the box would be created just below the mouse when the "go" button on scite was pressed, allowing me to simply move the mouse down ^^

all i did was comment 1 line out haha

#NoTrayIcon

#include <ButtonConstants.au3>

#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>

HotKeySet("^{END}", "END")

$gui = GUICreate("Catch me!", 72, 53, 193, 125, -1, $WS_EX_TOOLWINDOW)

$up = GUICtrlCreateRadio("", 31, 2, 16, 17)

$down = GUICtrlCreateRadio("", 31, 34, 16, 17)

$left = GUICtrlCreateRadio("", 8, 18, 16, 17)

$right = GUICtrlCreateRadio("", 52, 18, 16, 17)

GUICtrlCreateRadio("", 31, 18, 16, 17)

GUICtrlSetState(-1, $GUI_CHECKED)

;MouseMove(@DesktopWidth - 200, @DesktopHeight - 200)

$Mposold = MouseGetPos()

GUISetState()

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

$Mpos = MouseGetPos()

If $Mpos[1] <> $Mposold[1] Or $Mpos[0] <> $Mposold[0] Then

$winpos = WinGetPos($gui)

if ($winpos[0] < $Mpos[0] And $winpos[1] < $Mpos[1]) and ($Mpos[0] < $winpos[0] + 78 And $Mpos[1] < $winpos[1] + 77) Then

MsgBox(0, "", "YOU WIN :)")

EndIf

If $Mpos[0] > $Mposold[0] Then

GUICtrlSetState($right, $GUI_CHECKED)

WinMove($gui, "", $winpos[0] + ($Mpos[0] - $Mposold[0]), $winpos[1])

ElseIf $Mpos[0] < $Mposold[0] Then

GUICtrlSetState($left, $GUI_CHECKED)

WinMove($gui, "", $winpos[0] - ($Mposold[0] - $Mpos[0]), $winpos[1])

ElseIf $Mpos[1] < $Mposold[1] Then

GUICtrlSetState($up, $GUI_CHECKED)

WinMove($gui, "", $winpos[0], $winpos[1] - ($Mposold[1] - $Mpos[1]))

ElseIf $Mpos[1] > $Mposold[1] Then

GUICtrlSetState($down, $GUI_CHECKED)

WinMove($gui, "", $winpos[0], $winpos[1] + ($Mpos[1] - $Mposold[1]))

EndIf

$Mposold = MouseGetPos()

EndIf

WEnd

Func End()

Exit

EndFunc ;==>End

A great place to start Autoit 1-2-3

Link to comment
Share on other sites

  • 8 months later...

I caught the window by moving my mouse very quickly.

There is a race condition in the script. If you move your mouse fast enough you can exploit this and move the window a few pixels closer to your mouse per loop. By repeatedly swiping your mouse quickly one direction, then slowly the other, you can move the windows closer to your mouse.

I don't feel that writing a script to do this is cheating (we are on a scripting forum), but I feel that I solved the real puzzle.

Edit: Found diagonals are even more effective. I was able to beat it in about 20 seconds using this technique.

Edited by Prab
Link to comment
Share on other sites

LOL that is amusing for a while... maybe have the window stay stationary but when the mouse cursor gets with in 30 pixles it moves the oposite direction??

Link to comment
Share on other sites

  • 2 weeks later...

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...