I try write simple pixelsearch bot to Metin2, but i cannot send Conntrolclick (left) to inactive window here is the script;
Opt ('WinTitleMatchMode','2')
Opt("WinWaitDelay", 100)
Opt("WinTitleMatchMode", 4)
Opt("WinDetectHiddenText", 1)
Opt("PixelCoordMode", 2)
Opt("MouseCoordMode", 2)
Global $HWnD, $Full, $Title, $iButton
$Title = 'METIN2'
$Full = WinGetTitle ($Title)
$HWnD = WinGetHandle ($Full)
$metin = "METIN2"
$Pickup = 0
$left = 'left'
While $Pickup = 0
$cross = Pixelgetcolor( 575, 53, $metin)
IF $cross <> 0xfffbff Then
mobsearch()
Endif
IF $cross = 0xfffbff Then
Sleep(3000)
Endif
WEnd
Func mobsearch()
$coord = PixelSearch(100, 150, 650, 540, 0xEB1609, 50, 10)
If Not @error Then
ControlClick ($HWnD, '','', $left, 1, $coord[0],$coord[1])
Sleep(500)
;Call ("fight")
EndIf
EndFunc
Func fight()
;advanced options goes here
Endfunc
Any ideas to solve this problem ?
Sorry 4 my english..