2016年6月1日 星期三

OverWach 鬥陣特攻 圖像辨識 自動攻擊外掛

1. $searchColor為偵測顏色
2. 按END暫停, 按INSERT切換單點或連發模式, 按HOME離開程式.
3. 請把下面程式碼複製貼上至你新開的.au3檔(https://www.dropbox.com/s/8wsodc44r7c6y61/Pixel_Aimbot.au3?dl=0)
4. 打開au3檔, 按F5執行(https://www.autoitscript.com/site/autoit/downloads/)

ps. $SettingsGUI為TRUE可以顯示瞄準區塊,為FALSE可以隱藏瞄準區塊

; +--------------------------------------------------------------------------------------------------------------+
; | Triggerbot: Proof of Concept                                                                                     |
#include <GUIConstants.au3>
#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <WinAPI.au3>
#include <Array.au3>
Opt("MouseClickDelay", 0)
Opt('MouseCoordMode', 2)
Opt('PixelCoordMode', 2)
Opt("MouseClickDownDelay", 0)
;MODIFY TO YOUR LIKINGS!!
Global $SettingShootBoundWidth = 45
Global $SettingShootBoundHeight = 150
Global $SettingSearchAreaWidth = 25
Global $SettingSearchAreaHeight = 125
Global $SettingAimMode = False ;False = triggerbot, True = aimbot
Global $SettingsGUI = True ;Show GUI?
Global $SettingHoldClick = False ;Rapid fire = true, Single fire = false
Global $SettingAimBotStepSize = 30 ;Lower the value = slower aimbot, higher equal faster aimbot
;MODIFY TO YOUR LIKINGS!!

;HotKeys
HotKeySet("{HOME}", "Stop")
HotKeySet("{END}", "Pause")
HotKeySet("{INS}", "HoldClickOn")
HotKeySet("{DELETE}", "SwitchAimMode")
;Game Handle
Global $WindowClass = "[CLASS:TankWindowClass]"
Global $WindowHandle = WinGetHandle($WindowClass)
;Settings
Global $SettingTriggerBot = True
Global $SettingRunning = True
Global $SettingShooting = False
Global $IsUserShooting = False
;Color to search for
Global $SearchColor = 0xEB1D2F
;Game window size
Global $size = WinGetClientSize($WindowHandle)
If $size = 0 Then
MsgBox(16, "Error", "Game is not running, cannot grab resolution!" & @CRLF & "Exiting...")
Exit
EndIf
Global $x_ratio = $size[0] / 1920
Global $y_ratio = $size[1] / 1080
Global $middleX = $size[0]/2
Global $middleY = $size[1]/2
;Search Area
Global $SearchAreaBoundsX = [$middleX - ($SettingSearchAreaWidth* $x_ratio),  $middleX + ($SettingSearchAreaWidth * $x_ratio)]
Global $SearchAreaBoundsY = [$middleY - ($SettingSearchAreaHeight * $y_ratio), $middleY + ($SettingSearchAreaHeight/2 * $y_ratio)]
Global $SearchAreaPoints[4] = [$SearchAreaBoundsX[0],$SearchAreaBoundsY[0],$SearchAreaBoundsX[1],$SearchAreaBoundsY[1]]
;Shoot Area
Global $ShootBoundsX[2] = [$middleX - ($SettingShootBoundWidth * $x_ratio), $middleX + ($SettingShootBoundWidth * $x_ratio)]
Global $ShootBoundsY[2] = [$middleY - ($SettingShootBoundHeight * $y_ratio), $middleY + ($SettingShootBoundHeight/2 * $y_ratio)]
Global $ShootAreaPoints[4] = [$ShootBoundsX[0], $ShootBoundsY[0], $ShootBoundsX[1], $ShootBoundsY[1]]
;Draw GUI
If $SettingsGUI Then
   DrawSearchAreaGUI($SearchAreaPoints, 0x66FF33, "Search")
   DrawSearchAreaGUI($ShootAreaPoints, 0x0000FF, "Shoot")
   $frmBot = GUICreate("Pixel Triggerbot" & "1.0" & " - OFF", 270, 145, 0, 0, -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW), 0)
   $lblPixel = GUICtrlCreateLabel("Pixel Found: 0,0" , 4, 0, 280, 24)
   GUICtrlSetFont(-1, 10, 600, 0, "Segoe UI")
   GUICtrlSetColor(-1, 0x330000)
   $lblStatus = GUICtrlCreateLabel("Status: Running", 4, 20, 240, 17)
   GUICtrlSetFont(-1, 10, 600, 0, "Segoe UI")
   GUICtrlSetColor(-1, 0x330000)
   $lblMode = GUICtrlCreateLabel("Mode: Single Click", 4, 40, 240, 17)
   GUICtrlSetFont(-1, 10, 600, 0, "Segoe UI")
   GUICtrlSetColor(-1, 0x330000)
   $lblHelpMsg1 = GUICtrlCreateLabel("Press INSERT to change modes", 4, 60, 240, 17)
   GUICtrlSetFont(-1, 10, 600, 0, "Segoe UI")
   GUICtrlSetColor(-1, 0xFF0000)
   $lblHelpMsg2 = GUICtrlCreateLabel("Press END to pause", 4, 80, 240, 17)
   GUICtrlSetFont(-1, 10, 600, 0, "Segoe UI")
   GUICtrlSetColor(-1, 0xFF0000)
   $lblHelpMsg3 = GUICtrlCreateLabel("Press HOME to end", 4, 100, 240, 17)
   GUICtrlSetFont(-1, 10, 600, 0, "Segoe UI")
   GUICtrlSetColor(-1, 0xFF0000)
   GUISetState()
EndIf
;Mainbot
While $SettingRunning
   WinActivate($WindowHandle)
   If $SettingsGUI Then
 If Not $SettingTriggerBot Then
GUICtrlSetData($lblStatus,"Status: Paused")
 Else
GUICtrlSetData($lblStatus,"Status: Searching For Pixel")
 EndIf
   EndIf
   TryShoot()
WEnd
Func TryShoot()
   While $SettingTriggerBot
 If  Not IsUserPressing() Then
ShootGun()
StopShooting()
 EndIf
   WEnd
EndFunc
;Check if gun can shoot and draws a box around the pixel found
Func CanShootGun($coord)
   If IsArray($coord) = 1 Then
 If $SettingsGUI Then
DrawFoundCoordArea($coord)
GUICtrlSetData($lblPixel,"Pixel Found: " & $coord[0] & "," & $coord[1])
 EndIf
 If Not $SettingAimMode Then
If $coord[0] >= $ShootBoundsX[0] And $coord[0] <= $ShootBoundsX[1] And  $coord[1] >= $ShootBoundsY[0] And $coord[1] <= $ShootBoundsY[1] Then
Return True
Else
  Return False
EndIf
 Else
MoveMouse($coord[0], $coord[1])
Return True
 EndIf
   Else
 Return False
   EndIf
EndFunc
Func IsUserPressing()
   Return Not $SettingShooting And _IsPressed("01")
EndFunc
Func StopShooting()
   If $SettingShooting And $SettingHoldClick Then
 MouseUp("left")
 $SettingShooting = False
   EndIf
EndFunc
Func MoveMouse($x, $y)
   Local $MoveToX = ($x - $middleX)
   Local $MoveToY = ($y - $middleY)
   If $MoveToX Then
 If Abs($MoveToX) < $SettingAimBotStepSize Then
 $iMoving = $MoveToX
 Else
 $iMoving = $SettingAimBotStepSize
 If ($MoveToX) < 0 Then $iMoving *= -1
 EndIf
 _MouseMovePlus($iMoving, 0)
   EndIf

   If $MoveToY Then
 If Abs($MoveToY) < $SettingAimBotStepSize Then
 $iMoving = $MoveToY
 Else
 $iMoving = $SettingAimBotStepSize
 If ($MoveToY) < 0 Then $iMoving *= -1
 EndIf
 _MouseMovePlus(0, $iMoving)
   EndIf
EndFunc
Func _MouseMovePlus($x, $y)
    DllCall("user32.dll", _
"none", _
"mouse_event", _
            "long",  1 , _
            "long",  $x, _
            "long",  $y, _
            "long",  0, _
"long",  0)
EndFunc
Func _MouseClickFast2($x = 0, $y = 0, $User32 = "User32.dll")
    DllCall($User32, "none", "mouse_event", "long", 2, "long", $x, "long", $y, "long", 0, "long", 0) ; 32770 0x8002 BitOR($MOUSEEVENTF_ABSOLUTE, $MOUSEEVENTF_LEFTDOWN)
    DllCall($User32, "none", "mouse_event", "long", 4, "long", $x, "long", $y, "long", 0, "long", 0) ; 32772 0x8004 BitOR($MOUSEEVENTF_ABSOLUTE, $MOUSEEVENTF_LEFTUP)
EndFunc

Func ShootGun()
   While CanShootGun(SearchPixel())
 If $SettingHoldClick Then
$SettingShooting = true
MouseDown("left")
 Else
_MouseClickFast2("left")
 EndIf
   WEnd
EndFunc

Func SearchPixel()
   Return PixelSearch($SearchAreaPoints[0], $SearchAreaPoints[1],$SearchAreaPoints[2], $SearchAreaPoints[3], $searchColor,15)
EndFunc
Func DrawSearchAreaGUI($Points, $Color, $comment = "")
   Local $DrawAreaWidth = $Points[2] - $Points[0]
   Local $DrawAreaHeight = $Points[3] - $Points[1]
   Local $AreaGUI = GUICreate("", $DrawAreaWidth + 2, $DrawAreaHeight + 2, $Points[0], $Points[1], $WS_POPUP, BitOR($WS_EX_LAYERED, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TRANSPARENT)))
   GUISetBkColor(0xABCDEF)
   _WinAPI_SetLayeredWindowAttributes($AreaGUI, 0xABCDEF, 0xA0)
   WinSetOnTop($AreaGUI, "", 1)
   GUISetState()
   $hDC = _WinAPI_GetWindowDC($AreaGUI)
   $hPen = _WinAPI_CreatePen($PS_SOLID, 2, $Color)
   $obj_orig = _WinAPI_SelectObject($hDC, $hPen)
   _WinAPI_DrawLine($hDC, 0, 1, $DrawAreaWidth, 0)
   _WinAPI_DrawLine($hDC, 1, 0, 0, $DrawAreaHeight)
   _WinAPI_DrawLine($hDC, $DrawAreaWidth, $DrawAreaHeight, $DrawAreaWidth, 0)
   _WinAPI_DrawLine($hDC, $DrawAreaWidth, $DrawAreaHeight, 0, $DrawAreaHeight)
   _WinAPI_SetTextColor($hDC, 0x000000)
   _WinAPI_SetBkMode($hDC, $TRANSPARENT)
   $tRECT = DllStructCreate($tagRect)
   DllStructSetData($tRECT, "Left", 5)
   DllStructSetData($tRECT, "Top", 5)
   DllStructSetData($tRECT, "Right", 250)
   DllStructSetData($tRECT, "Bottom", 50)
   _WinAPI_DrawText($hDC, $comment, $tRECT, 0)
EndFunc   ;==>DrawArea
Func DrawFoundCoordArea($FoundCoord)
   Local $hDC, $hPen, $o_Orig
   Local $FoundAreaPoints[4] = [$FoundCoord[0] - 5, $FoundCoord[1] - 5, $FoundCoord[0] + 5, $FoundCoord[1] + 5]
   Local $FoundAreaWidth = $FoundAreaPoints[2] - $FoundAreaPoints[0]
   Local $FoundAreaHeight = $FoundAreaPoints[3] - $FoundAreaPoints[1]
   Local $FoundTopLine[4] = [$FoundAreaPoints[0], $FoundAreaPoints[1], $FoundAreaPoints[0] + $FoundAreaWidth, $FoundAreaPoints[1]]
   Local $FoundBottomLine[4] = [$FoundAreaPoints[0], $FoundAreaPoints[1], $FoundAreaPoints[0], $FoundAreaPoints[1] + $FoundAreaHeight]
   Local $FoundLeftLine[4] = [$FoundAreaPoints[0] + $FoundAreaWidth, $FoundAreaPoints[1], $FoundAreaPoints[0] + $FoundAreaWidth, $FoundAreaPoints[1] + $FoundAreaHeight]
   Local $FoundRightLine[4] = [$FoundAreaPoints[0], $FoundAreaPoints[1] + $FoundAreaHeight, $FoundAreaPoints[0] + $FoundAreaWidth, $FoundAreaPoints[1] + $FoundAreaHeight]
   $hDC = _WinAPI_GetWindowDC(0) ; DC of entire screen (desktop)
   $hPen = _WinAPI_CreatePen($PS_SOLID, 2, 0xFF0000)
   $o_Orig = _WinAPI_SelectObject($hDC, $hPen)
   _WinAPI_DrawLine($hDC, $FoundTopLine[0], $FoundTopLine[1], $FoundTopLine[2], $FoundTopLine[3])
   _WinAPI_DrawLine($hDC, $FoundLeftLine[0], $FoundLeftLine[1], $FoundLeftLine[2], $FoundLeftLine[3])
   _WinAPI_DrawLine($hDC, $FoundRightLine[0], $FoundRightLine[1], $FoundRightLine[2], $FoundRightLine[3])
   _WinAPI_DrawLine($hDC, $FoundBottomLine[0], $FoundBottomLine[1], $FoundBottomLine[2], $FoundBottomLine[3])
   ; refresh desktop (clear cross)
   _WinAPI_RedrawWindow(_WinAPI_GetDesktopWindow(), 0, 0, $RDW_INVALIDATE + $RDW_ALLCHILDREN)
   ; clear resources
   _WinAPI_SelectObject($hDC, $o_Orig)
   _WinAPI_DeleteObject($hPen)
   _WinAPI_ReleaseDC(0, $hDC)
EndFunc
;hotkey functions
Func Pause()
   $SettingTriggerBot = Not $SettingTriggerBot
EndFunc
Func SwitchAimMode()
   $SettingAimMode = Not $SettingAimMode
   If $SettingAimMode Then
 $SearchColor = 0xFF0000
   Else
 $SearchColor = 0xEB1D2F
   EndIf
EndFunc
Func HoldClickOn()
   StopShooting()
   $SettingHoldClick = Not $SettingHoldClick
   If $SettingHoldClick Then
 If $SettingsGUI Then
GUICtrlSetData($lblMode,"Mode: Rapid Fire")
 EndIf
   Else
 If $SettingsGUI Then
GUICtrlSetData($lblMode,"Mode: Single Fire")
 EndIf
   EndIf
EndFunc
Func Stop()
   Exit
EndFunc

1 則留言:

[CentOS] httpd port 9000 to 80

<VirtualHost *:80>     ServerName domain.name     ProxyRequests Off     ProxyVia Block     ProxyPreserveHost On     <Proxy *...