Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 16:40

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

Advertisement



ControlClick Coords

Discussion on ControlClick Coords within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
omer36's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
ControlClick Coords

hey hey...

kurz und knapp:

wie bekomm ich die "ControlClick Coords" raus, ohne den autoitwindowinfo tool zu benutzen?

hab schon einiges versucht aber klappt iwie nichts....

mfg
omer36 is offline  
Old 10/23/2010, 22:10   #2
 
lolkop's Avatar
 
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
Quote:
Originally Posted by omer36 View Post
hey hey...

kurz und knapp:

wie bekomm ich die "ControlClick Coords" raus, ohne den autoitwindowinfo tool zu benutzen?

hab schon einiges versucht aber klappt iwie nichts....

mfg
das sind relative coors zum control...
controlgetpos mit den aktuellen coors in verbindung setzen, und du erhälst coors die immer passen, egal wo sich das fester befindet.
lolkop is offline  
Old 10/23/2010, 22:22   #3
 
omer36's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
hää kapier ich irgentwie nicht :S

kannste ma bitte nen kleinen bsp geben?

controlgetpos gibt mir nur die Position und Size wieder...
wie soll ich daraus und den normalen koordinaten den control entnehmen?
omer36 is offline  
Old 10/23/2010, 22:44   #4
 
PenGuin :O's Avatar
 
elite*gold: 2
Join Date: Mar 2008
Posts: 1,778
Received Thanks: 1,222
Du hast GUI Position...
Und Controlposition

GUI Left + Control Left = x
GUI Top + Control Top = y

ganz einfache Mathematik, wo ist das Problem?
PenGuin :O is offline  
Old 10/23/2010, 23:39   #5
 
omer36's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
-.-!

PHP Code:
$size WinGetPos("ControlClick Coords - Mozilla Firefox")
MsgBox(0"Active window stats (x,y,width,height):"$size[0] & " " $size[1] & " " $size[2] & " " $size[3])
;= -
,-819361056

$pos 
ControlGetPos("ControlClick Coords - Mozilla Firefox""""MozillaWindowClass2")
MsgBox("",""$pos[0] & ", "$pos[1] & ", "$pos[2] & ", "&$pos[3] )


; = 
Position:    0109
; = Size:    1920887


;normale maus 767359




;suche in dem bsp das -->  767228 
blick grad 0 durch, was ich falsch mache
omer36 is offline  
Old 10/24/2010, 00:17   #6
 
lolkop's Avatar
 
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
die kann man so nicht errechnen -.-
das sind einfach nur relative koordinaten...

nehmen wir mal als beispiel den windows rechner (calc.exe)
das anzeige control hat diese daten:
Code:
Position: 11, 10
Size:      385, 50
wenn ich jetzt das window info tool nutze, und in diesem feld irgendwo hinzeige, bekomme ich für die coors einen wert (x, y) zwischen 0, 0 und 385, 50

ausgehend von diesem control.

lasse ich mir beispielsweise den die controlclick coors vom ersten pixel ganz oben links anzeigen, so erhalte ich 0, 0. das liegt einfach nur daran, das der abstand vom beginn des controls genau 0 beträgt.

ganz unten rechts würde ich dementsprechend als coos die control size etrhalten, da der abstand vom beginn des controls die maximale entfernung beträgt.
lolkop is offline  
Old 10/24/2010, 00:41   #7
 
PenGuin :O's Avatar
 
elite*gold: 2
Join Date: Mar 2008
Posts: 1,778
Received Thanks: 1,222
Bitte:

Code:
Func _GetControlPos($hWnd, $hControl)
	Local $ControlPos[2]
	$WinPos = WinGetPos($hWnd)
	$CtrlPos = ControlGetPos($hWnd, "", $hControl)
	$ControlPos[0] = $WinPos[0] + ($CtrlPos[0] + ($CtrlPos[2] / 2))
	$ControlPos[1] = $WinPos[1] + ($CtrlPos[1] + ($CtrlPos[3] / 2))
	Return $ControlPos
EndFunc
Gibt die Mitte des Controls zurück, als Array.
0. Index = x
1. index = y

relativ zum ganzen Fenster..
$hWnd = Fensterhandle
$hControl = ControlID
PenGuin :O is offline  
Thanks
1 User
Old 10/24/2010, 01:27   #8
 
elite*gold: 0
Join Date: Feb 2009
Posts: 542
Received Thanks: 112
PHP Code:
HotKeySet("{F1}","_a"

While 


    Sleep
(200

WEnd 


Func _a
() 

    While 

$size 
WinGetPos("[active]"
$NMSG=GUIGETMSG() 
$POS=MOUSEGETPOS() 
$Size1 $Size[0
$Size2 $Size[1

TOOLTIP(($POS[0]-$Size1)&" / "&($POS[1]-$Size2)) 


WEnd 

EndFunc 
maxi39 is offline  
Thanks
1 User
Old 10/24/2010, 01:31   #9
 
lolkop's Avatar
 
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
ich war davon aus gegangen, dass er die aktuellen control coors der maus allgemein anzeigen will. und um das wirklich genau umzusetzen, müsste man jeden windowstyle extra behandeln... desweiteren müsste man auf menüs prüfen, da auch diese den relativen bezugspunkt ändern könnten...

der grundaufbau der funktion würde so aussehen:
Code:
Func GetControlClickCoors()
	Local $return[2], $mouse_pos[2], $win_pos[2], $control_pos[2]
	Local $title, $cid, $style
	$title = WinGetHandle('[ACTIVE]')
	$cid = ControlGetFocus($title)
	$mouse_pos = MouseGetPos()
	$win_pos = WinGetPos($title, '')
	$control_pos = ControlGetPos($title, '', $cid)
	If IsArray($mouse_pos) And IsArray($win_pos) And IsArray($control_pos) Then
		$return[0] = $mouse_pos[0]-($win_pos[0]+$control_pos[0])
		$return[1] = $mouse_pos[1]-($win_pos[1]+$control_pos[1])
	EndIf
	Return $return
EndFunc
in diese rechnung müsste man jetzt natürlich noch die ganzen style parameter aufnehmen, da die position immer relativ zur fenster position gemessen wird... wenn das fenster nun aber noch eine titelbar hat, stimmt das ganze zb schon nichtmehr... dann kommt es natürlich noch auf die kantenbreiten an, ob das fenster sunken edges hat, und so weita....
lolkop is offline  
Thanks
1 User
Old 10/24/2010, 01:49   #10
 
omer36's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
ohh mann... -.-

hätte nicht gedacht, dass es so umständlich wird...

warum kann ich den teil nicht iwie vom au3 infotool rauskopieren...


danke trozdem, aber wird wohl nix ^^
omer36 is offline  
Reply


Similar Threads Similar Threads
controlclick?
04/15/2010 - AutoIt - 9 Replies
mal ne frage irgendwie bekomme ich keinen controlclick hin ControlClick ("METIN2","", ]]]) was da falsch?
AutoHotKey help (ControlClick)
12/12/2009 - Conquer Online 2 - 2 Replies
Hi there, I'm working on a background macro for skills (all skills), but I'm having a problem when trying to make it work for SH or healing spells. The problem is with this: ControlClick, x300 y230,ahk_id %id%,,left,2,d This should double click in the 300,230 coords (horse slot) to unequip it. It sends the left click (if I close the equip window will start walking in that direction) but it doesn't sends double click for unequip. Here is the code I've done so far for skills (the code still...
Screen Coords <--> Map Coords using autoit
04/21/2009 - CO2 Programming - 1 Replies
Someone might like this. I provide an example of how to convert screen coords into map coords and visa versa. So that if your using autoit or some other mouse clicking macro tool, then you can get it to accurately get the mouse coordinates to click to move to a map-coordinate location. This method works by using autoit to look at the current player coordinates (_MemoryRead()), and performing some clicks on the screen to take map coordinate samples for mouse clicks in different locations....
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 +2. The time now is 16:40.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

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