hier mal 2 Scripte aus langweiligen phasen
zum ersten ein maus-informations-tool
Spoiler anzeigen
#NoTrayIcon
#include <array.au3>
#include <arraymore.au3>
#include <GUIConstantsEx.au3>
#include <ListBoxConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <WinAPI.au3>
$start = TimerInit()
HotKeySet("^{END}", "raus")
HotKeySet("!p", "play")
$exStyles = BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES)
$GUI = GUICreate("Colors", 178, 436, 190, 122, $WS_SIZEBOX, BitOR($WS_EX_TOOLWINDOW, $WS_EX_WINDOWEDGE))
$List = GUICtrlCreateListView("Colors ", 0, 0, 177, 418, BitOR($LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER, $LVS_REPORT))
GUICtrlSetResizing(-1, $GUI_DOCKBORDERS)
_GUICtrlListView_SetExtendedListViewStyle($List, $exStyles)
$hImage = _GUIImageList_Create(11, 11)
_GUICtrlListView_SetImageList($List, $hImage, 1)
GUISetState(@SW_SHOW)
Dim $arcolor[1] = [0], $n, $ncoli, $Mouseposold = MouseGetPos(), $Pixel, $Posis[1][2] = [[0, 0]]
If FileExists(@ScriptDir & "\positions.ini") Then IniDelete(@ScriptDir & "\positions.ini", "POS")
While 1
$Mousepos = MouseGetPos()
If GUIGetMsg() = $GUI_EVENT_CLOSE Then raus()
If $Mousepos[0] <> $Mouseposold[0] Or $Mousepos[1] <> $Mouseposold[1] Then
$n += 1
$color = Hex(PixelGetColor($Mousepos[0], $Mousepos[1]), 6)
$colindex = _ArraySearch($arcolor, $color, 0, 0, 0, 1)
If $colindex = -1 Then
_ArrayAdd($arcolor, 1 & "x" & $color)
ToolTip($n & " : " & $Mousepos[0] & " , " & $Mousepos[1] & _
@CRLF & $arcolor[UBound($arcolor) - 1])
_GUICtrlListView_AddItem($List, $arcolor[UBound($arcolor) - 1], $ncoli)
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($List, "0x" & $color, 11, 11))
$ncoli += 1
Else
$listindex = _GUICtrlListView_FindInText($List, $arcolor[$colindex])
$spl = StringSplit($arcolor[$colindex], "x")
$spl[1] += 1
$arcolor[$colindex] = $spl[1] & "x" & $spl[2]
ToolTip($n & " : " & $Mousepos[0] & ", " & $Mousepos[1] & _
@CRLF & $arcolor[$colindex])
_GUICtrlListView_SetItem($List, $arcolor[$colindex], $listindex)
EndIf
$Pixel += dif($Mousepos[0], $Mouseposold[0]) + dif($Mousepos[1], $Mouseposold[1])
$Mouseposold = MouseGetPos()
_Array2dAdd($Posis, $Mousepos[0] & "|" & $Mousepos[1])
EndIf
WEnd
Func play()
For $i = 1 To $n
MouseMove($Posis[$i][0], $Posis[$i][1], 1)
Sleep(25)
Next
raus()
EndFunc ;==>play
Func raus()
ToolTip("")
GUISetState(@SW_HIDE)
Local $arcsort[1][2], $max[6] = [0, 0, 0, 0, 0, 0]
Local Const $LOGPIXELSX = 88
$ScreenDC = _WinAPI_GetDC(0)
$DPI = _WinAPI_GetDeviceCaps($ScreenDC, $LOGPIXELSX)
_WinAPI_ReleaseDC(0, $ScreenDC)
$arcolor[0] = UBound($arcolor) - 1
For $i = 1 To $arcolor[0]
$spl = StringSplit($arcolor[$i], "x")
_Array2dAdd($arcsort, $spl[1] & "|" & $spl[2])
Next
_ArrayDisplay($arcsort, "Farben")
For $i = 1 To UBound($arcsort) - 1
If $arcsort[$i][0] >= $max[0] Then
$max[0] = Number($arcsort[$i][0]) ;Num 1
$max[1] = $i ;Index 1
EndIf
Next
For $i = 1 To UBound($arcsort) - 1
If $arcsort[$i][0] >= $max[2] And $arcsort[$i][0] < $max[0] Then
$max[2] = Number($arcsort[$i][0]) ; Num 2
$max[3] = $i ; Index 2
EndIf
Next
For $i = 1 To UBound($arcsort) - 1
If $arcsort[$i][0] >= $max[4] And $arcsort[$i][0] < $max[2] Then
$max[4] = Number($arcsort[$i][0]) ; Num 3
$max[5] = $i ; Index 3
EndIf
Next
ToolTip($n & " : " & $Mousepos[0] & ", " & $Mousepos[1] & @CRLF & $color)
MsgBox(0, @UserName, $Mousepos[0] & "," & $Mousepos[1] & _
@CRLF & _
@CRLF & $n & " Bewegungen gezählt." & _
@CRLF & "Die Maus wurde über " & $Pixel & " Pixel & " & Round($Pixel * 2.54 / $DPI, 2) & " cm bewegt." & _
@CRLF & @DesktopHeight * @DesktopWidth & " Pixel insgesamt." & _
@CRLF & Round($Pixel / (@DesktopHeight * @DesktopWidth) * 100, 2) & "% aller Pixel überquert." & _
@CRLF & _
@CRLF & $ncoli & " Verschiedene farben." & _
@CRLF & $n & " Farben." & _
@CRLF & "Meist verwendete Farbe: " & $arcsort[$max[1]][1] & " (" & $max[0] & ")" & _
@CRLF & "2te Farbe: " & $arcsort[$max[3]][1] & " (" & $max[2] & ")" & _
@CRLF & "3te Farbe: " & $arcsort[$max[5]][1] & " (" & $max[4] & ")" & _
@CRLF & _
@CRLF & "Data lost: " & Round($Pixel / $n, 2) & "%" & _
@CRLF & "Runtime: " & Round(TimerDiff($start) / 1000) & " sec.")
Exit
EndFunc ;==>raus
Func dif($Dif1, $Dif2)
Local $Result
If $Dif1 > $Dif2 Then
$Result = $Dif1 - $Dif2
ElseIf $Dif1 < $Dif2 Then
$Result = $Dif2 - $Dif1
ElseIf $Dif1 = $Dif2 Then
$Result = 0
EndIf
Return $Result
EndFunc ;==>dif
und zum anderen ein kleines spiel: Catch the window!
mit der einzigen Regel: Catch the window!
Spoiler anzeigen
#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 :D")
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
Edit: Na, wie habt ihr das fenster gefangen?