#RequireAdmin
#AutoIt3Wrapper_UseX64=n ; Set to Y or N depending on your situation/preference!!
#include-once
#include <WinAPIFiles.au3> ; for _WinAPI_Wow64EnableWow64FsRedirection
#include <ScreenCapture.au3> ;_ScreenCapture_CaptureWnd etc. ;using this in the example to create a test image, otherwise not neccessary here
$dll = DllOpen("user32.dll")
$color = 0
$gap = 42
$counter = 1
$xf = 0
$yf = 0
$xn = 0
$xb = 0
$Res = 0
$yb = 0
$yn = 0
$xl = 0
$yl = 0
$str = ""
$mul = 0
$ska = 0
Local $aCoord[2]=["0", "0"]
Opt("SendKeyDownDelay", 105)
AutoItSetOption("CaretCoordMode", 1)
AutoItSetOption("MouseCoordMode", 1)
AutoItSetOption("PixelCoordMode", 1)
#Region When running compiled script, Install needed DLLs if they don't exist yet
If Not FileExists("ImageSearchDLLx32.dll") Then FileInstall("ImageSearchDLLx32.dll", "ImageSearchDLLx32.dll", 1);FileInstall ( "source", "dest" [, flag = 0] )
If Not FileExists("ImageSearchDLLx64.dll") Then FileInstall("ImageSearchDLLx64.dll", "ImageSearchDLLx64.dll", 1)
If Not FileExists("msvcr110d.dll") Then FileInstall("msvcr110d.dll", "msvcr110d.dll", 1);Microsoft Visual C++ Redistributable dll x64
If Not FileExists("msvcr110.dll") Then FileInstall("msvcr110.dll", "msvcr110.dll", 1);Microsoft Visual C++ Redistributable dll x32
#EndRegion
Local $h_ImageSearchDLL = -1; Will become Handle returned by DllOpen() that will be referenced in the _ImageSearchRegion() function
#Region TESTING/Example
Local $bTesting = true; Change to TRUE to turn on testing/example
If $bTesting Then
_ImageSearchStartup()
OnAutoItExitRegister(_ImageSearchShutdown)
While 1
$gap = 35
$counter = 0
$xf = 0
$yf = 0
$xn = 0
$yn = 0
$ska = 0
if($mul>=9)then
$xl = 0
$yl = 0
$mul = 0
$Res = 0
$str = ""
Send($str)
EndIf
If ($xl == 0) Then
$Res = _ImageSearchArea("checker.bmp", 0, 630, 412, 713, 467, $xl, $yl, 60)
$Res = _ImageSearchArea("checker3.bmp", 0, 630, 412, 713, 467, $xl, $yl, 60)
$Res = _ImageSearchArea("checker2.bmp", 0, 630, 412, 713, 467, $xl, $yl, 60)
$Res = _ImageSearchArea("checker4.bmp", 0, 630, 412, 713, 467, $xl, $yl, 60)
If ($xl > 0) Then
Sleep(800)
$Res = _ImageSearchArea("checker.bmp", 0, 630, 412, 713, 467, $xl, $yl, 60)
$Res = _ImageSearchArea("checker4.bmp", 0, 630, 412, 713, 467, $xl, $yl, 60)
$Res = _ImageSearchArea("checker3.bmp", 0, 630, 412, 713, 467, $xl, $yl, 60)
$Res = _ImageSearchArea("checker2.bmp", 0, 630, 412, 713, 467, $xl, $yl, 60)
EndIf
EndIf
If($Res == 0)Then
$str = ""
$xl = 0
$yl = 0
EndIf
If ($xl > 0) Then
$file = FileOpen("coords.txt", 1)
FileWriteLine($file, $xl&" "&$yl)
$color = PixelGetColor($xl-24, $yl-36)
$xb = $xl-24
$yb = $yl-36
;~ TrayTip("color", "0x" & Hex($color,6), 7000)
$xf = $xb-10+($gap*$mul)
$yf = $yb-10
$xn = $xf
$oc = 0
$yn = $yf
While (($xn < $xf+24)And($yn < $yf+19))
$color1 = PixelGetColor($xn, $yn)
If($color1 == $color) Then
$counter = $counter+1
EndIf
If($xn >= $xf+23) Then
$yn = $yn+1
$xn = $xf
If(($oc < $counter)And($counter>1)) Then
ExitLoop
EndIf
$oc = $counter
EndIf
$xn = $xn+1
WEnd
If ($counter >= 5) Then
$ska = 1
$str = $str&"s"
Sleep(10)
EndIf
$var1 = 24
$oc = $counter
$counter2=$counter
$oc = $counter2
While(($xn < $xf+$var1)And($yn < $yf+19))
$color1 = PixelGetColor($xf+$var1, $yn)
If($color1 == $color) Then
$counter2 = $counter2+1
EndIf
If($yn >= $yf+18) Then
$var1 = $var1-1
$yn = $yf
FileWriteLine($file, $counter2&" - A")
If(($oc < $counter2)And($counter2>1)) Then
If (($counter2 >= 8)And($ska == 0)) Then
$str = $str&"a"
Sleep(10)
$counter = 999
EndIf
ExitLoop
EndIf
$oc = $counter2
EndIf
$yn = $yn+1
WEnd
$oc = $counter
$counter3 = $counter
While(($xn < $xf+23)And($yn < $yf+19))
$color1 = PixelGetColor($xn, $yn)
If($color1 == $color) Then
$counter = $counter+1
EndIf
If($yn >= $yf+18) Then
$xn = $xn+1
$yn = $yf
If(($oc < $counter)And($counter>1)) Then
ExitLoop
EndIf
$oc = $counter
EndIf
$yn = $yn+1
WEnd
If ($counter-$counter3 >= 5) Then
if ($ska == 0) Then
$str = $str&"d"
Sleep(10)
$counter = 999
EndIf
EndIf
$var1 = 24
$oc = $counter
While(($xn < $xf+$var1)And($yn < $yf+19))
If($counter >= 999) Then
ExitLoop
EndIf
$color1 = PixelGetColor($xf+$var1, $yn)
If($color1 == $color) Then
$counter = $counter+1
EndIf
If($yn >= $yf+18) Then
$var1 = $var1-1
$yn = $yf
If(($oc < $counter)And($counter>1)) Then
ExitLoop
EndIf
$oc = $counter
EndIf
$yn = $yn+1
WEnd
If ($counter > 0) Then
If (($counter <= 10)And($ska == 0)) Then
$str = $str&"w"
Sleep(10)
EndIf
FileWriteLine($file, $counter&" - COUNT ALL")
EndIf
$mul = $mul+1
if ($counter < 4) Then
FileWriteLine($file, $str&" - TYPE")
Send($str)
$str = ""
$mul = 0
$xl = 0
$yl = 0
Sleep(200)
EndIf
FileClose($file)
EndIf
Sleep(10)
WEnd
EndIf
Exit
#EndRegion TESTING/Example
#Region ImageSearch Startup/Shutdown
Func _ImageSearchStartup()
_WinAPI_Wow64EnableWow64FsRedirection(True)
$sOSArch = [MENTION=5283864]Osar[/MENTION]ch ;Check if running on x64 or x32 Windows [MENTION=5283864]Osar[/MENTION]ch Returns one of the following: "X86", "IA64", "X64" - this is the architecture type of the currently running operating system.
$sAutoItX64 = @AutoItX64 ;Check if using x64 AutoIt ;@AutoItX64 Returns 1 if the script is running under the native x64 version of AutoIt.
If $sOSArch = "X86" Or $sAutoItX64 = 0 Then
cr("+>" & [MENTION=5283864]Osar[/MENTION]ch=" & $sOSArch & [MENTION=546457]tab[/MENTION] & "@AutoItX64=" & $sAutoItX64 & [MENTION=546457]tab[/MENTION] & "therefore using x32 ImageSearch DLL")
$h_ImageSearchDLL = DllOpen("ImageSearchDLLx32.dll")
If $h_ImageSearchDLL = -1 Then Return "DllOpen failure"
ElseIf $sOSArch = "X64" And $sAutoItX64 = 1 Then
cr("+>" & [MENTION=5283864]Osar[/MENTION]ch=" & $sOSArch & [MENTION=546457]tab[/MENTION] & "@AutoItX64=" & $sAutoItX64 & [MENTION=546457]tab[/MENTION] & "therefore using x64 ImageSearch DLL")
$h_ImageSearchDLL = DllOpen("ImageSearchDLLx64.dll")
If $h_ImageSearchDLL = -1 Then Return "DllOpen failure"
Else
Return "Inconsistent or incompatible Script/Windows/CPU Architecture"
EndIf
Return True
EndFunc ;==>_ImageSearchStartup
Func _ImageSearchShutdown()
DllClose($h_ImageSearchDLL)
_WinAPI_Wow64EnableWow64FsRedirection(False)
cr(">" & "_ImageSearchShutdown() completed")
Return True
EndFunc ;==>_ImageSearchShutdown
#EndRegion ImageSearch Startup/Shutdown
#Region ImageSearch UDF;slightly modified
; ------------------------------------------------------------------------------
;
; AutoIt Version: 3.0
; Language: English
; Description: Functions that assist with Image Search
; Require that the ImageSearchDLL.dll be loadable
;
; ------------------------------------------------------------------------------
;===============================================================================
;
; Description: Find the position of an image on the desktop
; Syntax: _ImageSearchArea, _ImageSearch
; Parameter(s):
; $findImage - the image to locate on the desktop
; $tolerance - 0 for no tolerance (0-255). Needed when colors of
; image differ from desktop. e.g GIF
; $resultPosition - Set where the returned x,y location of the image is.
; 1 for centre of image, 0 for top left of image
; $x $y - Return the x and y location of the image
; $transparency - TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of
; the color to be used as transparency; can be omitted if
; not needed
;
; Return Value(s): On Success - Returns True
; On Failure - Returns False
;
; Note: Use _ImageSearch to search the entire desktop, _ImageSearchArea to specify
; a desktop region to search
;
;===============================================================================
Func _ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0)
Return _ImageSearchArea($findImage, $resultPosition, 0, 0, @DesktopWidth, @DesktopHeight, $x, $y, $tolerance, $transparency)
EndFunc ;==>_ImageSearch
Func _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $tolerance = 0, $transparency = 0);Credits to Sven for the Transparency addition
If Not FileExists($findImage) Then Return "Image File not found"
If $tolerance < 0 Or $tolerance > 255 Then $tolerance = 0
If $h_ImageSearchDLL = -1 Then _ImageSearchStartup()
If $transparency <> 0 Then $findImage = "*" & $transparency & " " & $findImage
If $tolerance > 0 Then $findImage = "*" & $tolerance & " " & $findImage
$result = DllCall($h_ImageSearchDLL, "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)
If @error Then Return "DllCall Error=" & @error
If $result = "0" Or Not IsArray($result) Or $result[0] = "0" Then Return False
$array = StringSplit($result[0], "|")
If (UBound($array) >= 4) Then
$x = Int(Number($array[2])); Get the x,y location of the match
$y = Int(Number($array[3]))
If $resultPosition = 1 Then
$x = $x + Int(Number($array[4]) / 2); Account for the size of the image to compute the centre of search
$y = $y + Int(Number($array[5]) / 2)
EndIf
Return True
EndIf
EndFunc ;==>_ImageSearchArea
;===============================================================================
;
; Description: Wait for a specified number of seconds for an image to appear
;
; Syntax: _WaitForImageSearch, _WaitForImagesSearch
; Parameter(s):
; $waitSecs - seconds to try and find the image
; $findImage - the image to locate on the desktop
; $tolerance - 0 for no tolerance (0-255). Needed when colors of
; image differ from desktop. e.g GIF
; $resultPosition - Set where the returned x,y location of the image is.
; 1 for centre of image, 0 for top left of image
; $x $y - Return the x and y location of the image
; $transparency - TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of
; the color to be used as transparency can be omitted if
; not needed
;
; Return Value(s): On Success - Returns 1
; On Failure - Returns 0
;
;
;===============================================================================
Func _WaitForImageSearch($findImage, $waitSecs, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0)
$waitSecs = $waitSecs * 1000
$startTime = TimerInit()
While TimerDiff($startTime) < $waitSecs
Sleep(100)
If _ImageSearch($findImage, $resultPosition, $x, $y, $tolerance, $transparency) Then
Return True
EndIf
WEnd
Return False
EndFunc ;==>_WaitForImageSearch
;===============================================================================
;
; Description: Wait for a specified number of seconds for any of a set of
; images to appear
;
; Syntax: _WaitForImagesSearch
; Parameter(s):
; $waitSecs - seconds to try and find the image
; $findImage - the ARRAY of images to locate on the desktop
; - ARRAY[0] is set to the number of images to loop through
; ARRAY[1] is the first image
; $tolerance - 0 for no tolerance (0-255). Needed when colors of
; image differ from desktop. e.g GIF
; $resultPosition - Set where the returned x,y location of the image is.
; 1 for centre of image, 0 for top left of image
; $x $y - Return the x and y location of the image
; $transparent - TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of
; the color to be used as transparent; can be omitted if
; not needed
;
; Return Value(s): On Success - Returns the index of the successful find
; On Failure - Returns 0
;
;
;===============================================================================
Func _WaitForImagesSearch($findImage, $waitSecs, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0)
$waitSecs = $waitSecs * 1000
$startTime = TimerInit()
While TimerDiff($startTime) < $waitSecs
For $i = 1 To $findImage[0]
Sleep(100)
If _ImageSearch($findImage[$i], $resultPosition, $x, $y, $tolerance, $transparency) Then
Return $i
EndIf
Next
WEnd
Return False
EndFunc ;==>_WaitForImagesSearch
#EndRegion ImageSearch UDF;slightly modified
#Region My Custom ConsoleWrite/debug Function
Func cr($text = "", $addCR = 1, $printTime = False) ;Print to console
Static $sToolTip
If Not @Compiled Then
If $printTime Then ConsoleWrite(@HOUR & ":" & [MENTION=287308]Min[/MENTION] & ":" & [MENTION=301518]sec[/MENTION] & ":" & [MENTION=912041]mse[/MENTION]C & " ")
ConsoleWrite($text)
If $addCR >= 1 Then ConsoleWrite(@CR)
If $addCR = 2 Then ConsoleWrite(@CR)
Else
If $printTime Then $sToolTip &= @HOUR & ":" & [MENTION=287308]Min[/MENTION] & ":" & [MENTION=301518]sec[/MENTION] & ":" & [MENTION=912041]mse[/MENTION]C & " "
$sToolTip &= $text
If $addCR >= 1 Then $sToolTip &= @CR
If $addCR = 2 Then $sToolTip &= @CR
ToolTip($sToolTip)
EndIf
Return $text
EndFunc ;==>cr
#EndRegion My Custom ConsoleWrite/debug Function
Leave a Thanks, dont just download and run. Thats not cool.
Not that i know much about autoit, But i thought xigncode shuts down BDO if autoit is running in the background? Just what I've read around some forums without trying my self of course. Pretty sure i saw a thread on here with someone trying to find out how to bypass xigncode to run autoit. If my comment is retarded and completely wrong i wont be offended by the lack of a response.
Not that i know much about autoit, But i thought xigncode shuts down BDO if autoit is running in the background? Just what I've read around some forums without trying my self of course. Pretty sure i saw a thread on here with someone trying to find out how to bypass xigncode to run autoit. If my comment is retarded and completely wrong i wont be offended by the lack of a response.
Xigncode does not detect AutoIt or AutoHotKey.
It does not even block SendMessage or VK_Keys.
The only problem is that the client is an elevated process, thats why normal macro doesnt work.
Edit:
This is a full source. With ImageSearch function + Perfect timing.
You might want to change the Coordinates though as it may different from you.
Xigncode does not detect AutoIt or AutoHotKey.
It does not even block SendMessage or VK_Keys.
The only problem is that the client is an elevated process, thats why normal macro doesnt work.
Oh, Well thanks for clearing that up. Would i have to compile the files in the zip my self for this bot to work? I know nothing about autoit. Going to install it and give this a try in a few here. I'll leave a thanks and my feedback as soon as i get it running.
EDIT :
Figured it out. Installed Autoit, Just gotta figure which of the 3 files to use, lol. Looks like I'll have to play with the coordinates since everything is failing. Welp, You get my thanks. I personally wont bother with it any further since I'm paranoid. Cheers m8.
If I am correct, I remember there are 3 Sources there.
1 to control the space bar
2 to control the perfect fishing
3 to control the anti-captcha (WASD)
and I dont know what or how exactly coords.txt does.
Are you able to make it work? I have the scripts launched but it seems to fail when hooking. It also doesn't do anything during the captcha section. Any tips or advice?
it's working for the Space bar , which for catching the fish , but failed badly in timing the GOOD catch , not to mention the captcha script . I guess the script didnt able to scan my monitor as how it should be .
it's working for the Space bar , which for catching the fish , but failed badly in timing the GOOD catch , not to mention the captcha script . I guess the script didnt able to scan my monitor as how it should be .
It scans but apparently you have to edit the coordinates from the sources to get it working in your own desktop resolution.
If you read the source, I think there's a snippet there that it scans in 600x600 something like that and of course that predetermined coordinate IS not what it is in your own resolution. Thus, it will scan on the different location.
AutoIt + Black Desert Online 12/11/2016 - Black Desert - 3 Replies Hello,
cant make AutoIt work in BDO looks like xigncode3 , block anyone have a solution how to bypass it trued as admin "doesnt work" , and drvRadar Pro "xigncode3 closing BDO client".