All pastes #829543 Raw Edit

Unnamed

public text v1 · immutable
#829543 ·published 2007-12-23 07:06 UTC
rendered paste body
; lunchtime scripting whee
; by pegasus, thanks to comicsans

AutoItSetOption ("MouseCoordMode", "0")
AutoItSetOption ("PixelCoordMode", "0")

HotKeySet("{ESC}", "getOut")

Func getOut()
	MouseUp("left")
	Exit(0)
EndFunc

WinActivate("Lunchtimers")
WinWaitActive("Lunchtimers")

$top = 196
$left = 254
$bottom = 738
$right = 1011

$px = $left+(($right-$left)/2)
$py = $top+(($bottom-$top)/2)

Func coordsInShape ($x, $y)
	ToolTip(Abs($x - $px) & Abs($y - $py))
	If Abs($x - $px) < 14 and Abs($y - $py) < 14 Then Return True
	Return False
EndFunc

While True
	For $y = $top to $bottom step 14
		For $x = $left to $right step 14
			If PixelGetColor($x, $y) <> 16777215 And Not coordsInShape($x, $y) Then
				MouseMove($x, $y, 1)
				MouseDown("left")
				MouseMove($px, $py, 1)
				MouseUp("left")
			EndIf
		Next
	Next
WEnd