天天看点

uTorrent刷上传量

#include <AutoItConstants.au3>
#include <MsgBoxConstants.au3>

Global Const $USERIP = "192.168.192.1:40719"
;Local Const $USERIP = "192.168.192.1:52308"
;Local Const $USERIP = "192.168.121.130:48781"
Global Const $TIMES = 100100
Global Const $dlPath = "W:\TEMP"
Global $torrentX, $torrentY

Main()

Func Main()
   Sleep(3000)
   Local $hWnd = WinGetHandle("μTorrent 3.5.5  (build 45852) [32-bit]")
   If @error Then
	 MsgBox($MB_SYSTEMMODAL, "", "An error occurred when trying to retrieve the window handle")
	 Exit
   EndIf

   Local $mainwndPos = WinGetPos($hWnd)

   Local $ctrlPos = ControlGetPos($hWnd,"","[CLASS:ReBarWindow32]")
   If @error Then
	  MsgBox($MB_SYSTEMMODAL, "", "An error from ControlGetPos")
	  Exit
   EndIf

   $torrentX = $mainwndPos[0] + $ctrlPos[0] + 20
   $torrentY = $mainwndPos[1] + $ctrlPos[1] + 50 + 65

   ;MouseMove($torrentX,$torrentY)

   Local $iColor = PixelGetColor($torrentX,$torrentY)
   For $i = $TIMES To 1 Step -1
	   ;MsgBox($MB_SYSTEMMODAL, "", "Count down!" & @CRLF & $i)
	  For $j = 20*20 To 1 Step -1
		 $iColor = PixelGetColor($torrentX,$torrentY)
		 ;MsgBox($MB_SYSTEMMODAL, "", "The decimal color is: " & $iColor)
		 ;MsgBox($MB_SYSTEMMODAL, "", "The hex color is: " & Hex($iColor, 6))
		 If $iColor = 0xABD679 or $iColor = 0x86C43F Then
			ExitLoop
		 EndIf
		 Sleep(3000)
	  Next
	  DownTorrent()
   Next
EndFunc


Func DownTorrent()
   Sleep(5000)
   Local $iColor = PixelGetColor($torrentX,$torrentY)

   If $iColor = 0xABD679 or $iColor = 0x86C43F Then
	  ;MsgBox($MB_SYSTEMMODAL, "", "Seeding")
	  MouseMove($torrentX,$torrentY, 0)
	  MouseClick($MOUSE_CLICK_RIGHT)
	  Sleep(1000)
	  Send("t")
	  ;Sleep(1000)
	  ;MouseMove(600, 160, 0)
	  ;MouseClick($MOUSE_CLICK_LEFT)
	  Sleep(1000)
   EndIf


   DirRemove($dlPath,$DIR_REMOVE)

   Sleep(1000)
   DirCreate($dlPath)
   Sleep(1000)

   MouseMove($torrentX,$torrentY, 0)
   MouseClick($MOUSE_CLICK_RIGHT)
   Sleep(1000)
   Send("h")
   Sleep(1000)
   MouseMove($torrentX,$torrentY, 0)
   MouseClick($MOUSE_CLICK_RIGHT)
   Sleep(1000)
   Send("s")
   Sleep(1000)
   MouseMove($torrentX + 50, $torrentY + 300, 0)
   MouseClick($MOUSE_CLICK_RIGHT)
   Sleep(1000)
   Send("a")
   Sleep(1000)
   Send($USERIP)
   Sleep(1000)
   Send("!o")
EndFunc