Untitled


SUBMITTED BY: Guest

DATE: May 24, 2014, 2:58 p.m.

FORMAT: Text only

SIZE: 3.0 kB

HITS: 64538

  1. #include <Misc.au3>
  2. #include <WinAPI.au3>
  3. #include <WindowsConstants.au3>
  4. Global $iX1, $iY1, $iX2, $iY2
  5. Mark_Rect()
  6. $aCount = InputBox("PTCircle", "Ile razy kliknąć?");ile razy
  7. $intSleep = 30000 ;odstepy (milisekundy)
  8. For $i = 1 To $aCount
  9. MouseClick("left",Random($iX1, $iX2, 1), Random($iY1, $iY2, 1))
  10. Sleep($intSleep)
  11. Send("^w")
  12. Next
  13. Func Mark_Rect()
  14. Local $aMouse_Pos, $hMask, $hMaster_Mask, $iTemp
  15. Local $UserDLL = DllOpen("user32.dll")
  16. Global $hRectangle_GUI = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST)
  17. _GUICreateInvRect($hRectangle_GUI, 0, 0, 1, 1)
  18. GUISetBkColor(0)
  19. WinSetTrans($hRectangle_GUI, "", 50)
  20. GUISetState(@SW_SHOW, $hRectangle_GUI)
  21. GUISetCursor(3, 1, $hRectangle_GUI)
  22. While Not _IsPressed("01", $UserDLL)
  23. Sleep(10)
  24. WEnd
  25. $aMouse_Pos = MouseGetPos()
  26. $iX1 = $aMouse_Pos[0]
  27. $iY1 = $aMouse_Pos[1]
  28. While _IsPressed("01", $UserDLL)
  29. $aMouse_Pos = MouseGetPos()
  30. If $aMouse_Pos[0] < $iX1 Then
  31. $iX_Pos = $aMouse_Pos[0]
  32. $iWidth = $iX1 - $aMouse_Pos[0]
  33. Else
  34. $iX_Pos = $iX1
  35. $iWidth = $aMouse_Pos[0] - $iX1
  36. EndIf
  37. If $aMouse_Pos[1] < $iY1 Then
  38. $iY_Pos = $aMouse_Pos[1]
  39. $iHeight = $iY1 - $aMouse_Pos[1]
  40. Else
  41. $iY_Pos = $iY1
  42. $iHeight = $aMouse_Pos[1] - $iY1
  43. EndIf
  44. _GUICreateInvRect($hRectangle_GUI, $iX_Pos, $iY_Pos, $iWidth, $iHeight)
  45. Sleep(10)
  46. WEnd
  47. $iX2 = $aMouse_Pos[0]
  48. $iY2 = $aMouse_Pos[1]
  49. If $iX2 < $iX1 Then
  50. $iTemp = $iX1
  51. $iX1 = $iX2
  52. $iX2 = $iTemp
  53. EndIf
  54. If $iY2 < $iY1 Then
  55. $iTemp = $iY1
  56. $iY1 = $iY2
  57. $iY2 = $iTemp
  58. EndIf
  59. GUIDelete($hRectangle_GUI)
  60. DllClose($UserDLL)
  61. EndFunc ;==>Mark_Rect
  62. Func _GUICreateInvRect($hWnd, $iX, $iY, $iW, $iH)
  63. $hMask_1 = _WinAPI_CreateRectRgn(0, 0, @DesktopWidth, $iY)
  64. $hMask_2 = _WinAPI_CreateRectRgn(0, 0, $iX, @DesktopHeight)
  65. $hMask_3 = _WinAPI_CreateRectRgn($iX + $iW, 0, @DesktopWidth, @DesktopHeight)
  66. $hMask_4 = _WinAPI_CreateRectRgn(0, $iY + $iH, @DesktopWidth, @DesktopHeight)
  67. _WinAPI_CombineRgn($hMask_1, $hMask_1, $hMask_2, 2)
  68. _WinAPI_CombineRgn($hMask_1, $hMask_1, $hMask_3, 2)
  69. _WinAPI_CombineRgn($hMask_1, $hMask_1, $hMask_4, 2)
  70. _WinAPI_DeleteObject($hMask_2)
  71. _WinAPI_DeleteObject($hMask_3)
  72. _WinAPI_DeleteObject($hMask_4)
  73. _WinAPI_SetWindowRgn($hWnd, $hMask_1, 1)
  74. EndFunc ;==>_GUICreateInvRect

comments powered by Disqus