Jump to content
Sign in to follow this  

Controlclick dosent work in my script :/

Recommended Posts


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
    IF $cross = 0xfffbff Then

Func mobsearch()
$coord = PixelSearch(100, 150, 650, 540, 0xEB1609, 50, 10)
If Not @error Then
    ControlClick ($HWnD, '','', $left, 1, $coord[0],$coord[1])
    ;Call ("fight")
Func fight()
;advanced options goes here


Any ideas to solve this problem ?

Sorry 4 my english.. :D

Share this post

Link to post
Share on other sites


i dunno about the rest, still checking that out, but to start with, u have an little error in your very first line:

you have:

Opt ('WinTitleMatchMode','2')

And command is:

Opt ("WinTitleMatchMode",2)

And yes i am having some trouble too to get control ids on metin2 for example, creating an hidden autopickup function... i can get it to type "zzzzzzz" in the "shout" but just cant pick nothing from ground! lol

I really suppose that we just have to figure out the right control ID... maybe in some "gethandle" of one of the following controls handles:



Im working now on how that works... i'm NOT that expert and starting this new autoit phase now, so, any more help is very welkome.

btw i got those handle codes with the AutoIt window info tool althoug running game in full screen cose im in a netbook atm.


Edited by MagicianPT

Share this post

Link to post
Share on other sites

In the end those handle codes are some bug in the autoit window info tool...

Sorry my bad... back to 0 now... again! :D

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this