Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 12:42

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



ControlClick, _MouseClickPlus without ID

Discussion on ControlClick, _MouseClickPlus without ID within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2015
Posts: 6
Received Thanks: 0
ControlClick, _MouseClickPlus without ID

I've been troubled with this for a long time...I just ended up using common mouseclick but now i really need to click on a window (game) in BACKGROUND.

So
Code:
ControlClick("WindowName","","","right/left",x,y,times)
doesn't work exactly right, that is it actually click on the named window but only where the mouse is positioned, not in x,y.
And _MouseClickPlus:
Code:
Func _MouseClickPlus($handle, $Button = "left", $X = "", $Y = "", $Clicks = 1)
  Local $MK_LBUTTON    =  0x0001
  Local $WM_LBUTTONDOWN   =  0x0201
  Local $WM_LBUTTONUP    =  0x0202

  Local $MK_RBUTTON    =  0x0002
  Local $WM_RBUTTONDOWN   =  0x0204
  Local $WM_RBUTTONUP    =  0x0205

  Local $WM_MOUSEMOVE    =  0x0200

  Local $i              = 0
  Local $user32 = DllOpen("user32.dll")

  Select
  Case $Button = "left"
     $Button     =  $MK_LBUTTON
     $ButtonDown =  $WM_LBUTTONDOWN
     $ButtonUp   =  $WM_LBUTTONUP
  Case $Button = "right"
     $Button     =  $MK_RBUTTON
     $ButtonDown =  $WM_RBUTTONDOWN
     $ButtonUp   =  $WM_RBUTTONUP
  EndSelect

  If $X = "" OR $Y = "" Then
     $MouseCoord = MouseGetPos()
     $X = $MouseCoord[0]
     $Y = $MouseCoord[1]
  EndIf
  For $i = 1 to $Clicks
     DllCall($user32, "int", "SendMessage", "hwnd",$handle, "int", $WM_MOUSEMOVE, "int", 0, "long", _MakeLong($X, $Y))

     DllCall($user32, "int", "SendMessage", "hwnd", $handle, "int", $ButtonDown, "int", $Button, "long", _MakeLong($X, $Y))

     DllCall($user32, "int", "SendMessage", "hwnd", $handle,  "int", $ButtonUp, "int", $Button, "long", _MakeLong($X, $Y))
  Next
EndFunc

Func _MakeLong($LoWord,$HiWord)
Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
EndFunc
simply doesn't work, even specifing
Code:
AutoItSetOption("MouseCoordmode", 0)
at the biginning. I thought that the fact I'm using a 64 bit system might be a problem but even with
Code:
#AutoIt3Wrapper_UseX64
Strange fact: I've already made background bot in the same game using
Code:
ControlSend ( "Name", "", "", "commands")
Does anyone ever had the same problem (and solved it) or has suggestion to solve this? Of course I've searched for similar topic in this forum but I've never found a proper solution...
Gedix is offline  
Old 02/11/2015, 18:05   #2
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
How about using #RequireAdmin.
alpines is offline  
Old 02/11/2015, 18:12   #3
 
elite*gold: 0
Join Date: Feb 2015
Posts: 6
Received Thanks: 0
Quote:
Originally Posted by alpines View Post
How about using #RequireAdmin.
Well I use it in every bot i made, since without it almost no action with the game would work xD
Gedix is offline  
Old 02/11/2015, 18:28   #4
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Maybe the game is blocking such inputs. Which game do you want to access by these commands?
alpines is offline  
Old 02/11/2015, 18:39   #5
 
elite*gold: 0
Join Date: Feb 2015
Posts: 6
Received Thanks: 0
Quote:
Originally Posted by alpines View Post
Maybe the game is blocking such inputs. Which game do you want to access by these commands?
Metin2, mmorpg online.
Gedix is offline  
Old 02/11/2015, 22:43   #6
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
If you're playing on the official servers with active HackShield then you need a bypass do send inputs to the window.
alpines is offline  
Old 02/11/2015, 23:18   #7
 
elite*gold: 0
Join Date: Feb 2015
Posts: 6
Received Thanks: 0
Quote:
Originally Posted by alpines View Post
If you're playing on the official servers with active HackShield then you need a bypass do send inputs to the window.
I'm not playing on the official server...the thing I do not understand is why controlSend should work and controlClick not. I mean, both functions send input to the window right?
Gedix is offline  
Old 02/12/2015, 13:50   #8
 
elite*gold: 0
Join Date: Jan 2008
Posts: 32
Received Thanks: 7
I got a similar probleme last days.. Solved it for me since I specified a controlID

Code:
ControlClick(WindowName, "", "[CLASS:XXXX; INSTANCE:XXXX]", "left", 1, x, y)
Clonko is offline  
Old 02/12/2015, 14:19   #9
 
elite*gold: 0
Join Date: Feb 2015
Posts: 6
Received Thanks: 0
Quote:
Originally Posted by Clonko View Post
I got a similar probleme last days.. Solved it for me since I specified a controlID

Code:
ControlClick(WindowName, "", "[CLASS:XXXX; INSTANCE:XXXX]", "left", 1, x, y)
Yes but, as i specified in the title, I have no controlID of the game (searched with Autoit Window Info and similar programs) nor other information except for the title and class. Specifing class as the third parameter doesn't work either. So what kind of parameter should i put there?
Gedix is offline  
Old 02/12/2015, 18:19   #10
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
The DirectX Control has no ID that could be used to identify it.
alpines is offline  
Old 02/12/2015, 21:54   #11
 
elite*gold: 0
Join Date: Feb 2015
Posts: 6
Received Thanks: 0
Quote:
Originally Posted by alpines View Post
The DirectX Control has no ID that could be used to identify it.
Ok, so no ID can be found. Yet I don't understand why does controlSend work, while controlClick does not!
Gedix is offline  
Reply


Similar Threads Similar Threads
ControlClick
11/12/2014 - AutoIt - 8 Replies
$EnemyVp = PixelSearch($AutoShootBackAreaX1,$AutoShootBackAre aY1,$AutoShootBackAreaX2,$AutoShootBackAreaY2,0x0D 7600,20) If IsArray($EnemyVp) Then ControlClick($WindowHandle,"",$ControlID ,"left",1,$EnemyVp-25,$EnemyVp) ControlClick($WindowHandle,"",$ControlID ,"left",1,$EnemyVp-25,$EnemyVp) ControlClick($WindowHandle,"",$ControlID ,"left",1,$EnemyVp-25,$EnemyVp) FileWrite($FileHandle,@HOUR & ":" & @MIN & ":" & @SEC & "Enemy detected. Shooting back with coords: " &...
Spiel Blockt ControlClick//Game is blocking ControlClick? any Idea?
01/02/2014 - AutoIt - 6 Replies
GAME: TALES OF PIRATES II ---------------------- GERMAN: Hiho leute .... bin gerade eig, fertig mit pointern etc.. zu finden und wollte gerade einen test run machen wo mein chara einfach mal ne runde läuft so und nun ist das, dass problem das, Tales of Pirates II , ControlClick blockiert -.- ... mir wurden "MouseEvents" vorgeschlagen, Ok gehen aber das sind ja nur link/rechts klicks ... brauche aber das die Maus sich bewegt und ich dabei im hintergrund noch was machen kann sowie...
ControlClick -Help
02/17/2012 - AutoIt - 1 Replies
Hallo, Ganz kurz; Ich hab Probleme mit ControlKlick könnt ihr den MouseClick für mich ihn Controlklick schreiben? MouseClick("left", 922, 324)
controlclick?
04/15/2010 - AutoIt - 9 Replies
mal ne frage irgendwie bekomme ich keinen controlclick hin ControlClick ("METIN2","", ]]]) was da falsch?
ControlClick
01/10/2009 - GW Bots - 47 Replies
Hi Leute, Also, ich wollte mal einen Bot schreiben der im Hintergrund läuft, sodass ich nebenbei auf einem anderen Account spielen kann. Nun habe ich folgendes Problem: Die Idee war folgende: ich wollte den Bot ganz einfach alle Taschen des Inventars öffnen lassen und ihn dann per ControlClick wieder schließen lassen. Dies soll für mich erstmal eine Art Übung sein, um später eine Sellfunc. drauß zu machen. Nun ist meine Frage.. Wieso passiert da nichts? Er öffnet nur das Inventar,...



All times are GMT +1. The time now is 12:43.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.