ControlClick in D3 Windowmode

04/09/2013 00:31 FoGzone#1
Also ich habe folgendes Problem:

Ich möchte, dass mein Script via ControlClick in meinem D3 Fenster (Fenster Modus) klickt. Das Problem ist nur, dass nichts passiert...

Code:
ControlClick("Diablo V1", "", "","left",1,141,387)
	Sleep (800)
	ControlClick("Diablo V1", "", "","left",1,153,192)
	Sleep (800)
	ControlClick("Diablo V1", "", "","left",1,145,249)
Wo liegt da mein Problem?
04/09/2013 00:40 butter123#2
Quote:
Originally Posted by FoGzone View Post
Wo liegt da mein Problem?
also dein problem ist, dass controlclick nicht bei d3 ankommt :D

naja mit controlclick ists halt so ne sache das funktioniert nicht überall. wenns nicht klappt kann man da nichts machen.
04/09/2013 00:50 FoGzone#3
Quote:
Originally Posted by butter123 View Post
also dein problem ist, dass controlclick nicht bei d3 ankommt :D

naja mit controlclick ists halt so ne sache das funktioniert nicht überall. wenns nicht klappt kann man da nichts machen.
Naja aber irgendwie muss es ja machbar sein.
Ich habe bei meiner Suche nach einer Lösung einen kleinen Test gefunden.

Code:
#include <GUIConstants.au3>

$fenster = GUICreate("testgui",400,300)
$button = GUICtrlCreateButton("button1",20,20,100,50)
$label = GUICtrlCreateLabel("Klicks: ",20,80,50,50)
GUISetState()

$klicks = 0

While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_Event_Close
ExitLoop
Case $button
$klicks = $klicks+1
GUIctrlSetData($label, "Klicks: "&$klicks)
EndSwitch
sleep(30)
WEnd
Exit
Code:
HotKeySet ("{NUMPAD1}","_Start")
HotKeySet ("{NUMPAD2}","_Exit")

While 1
Sleep (10)
WEnd


Func _Start()
While 1
Sleep (100)
ControlClick("testgui", "", "button1")
Sleep(500)
WEnd
EndFunc

Func _Exit()
Exit
EndFunc
So wie es hier steht klappt alles.
Ändere ich allerdings das Ganze so um, dass er auf die Koordinaten des Buttons (hab die mit dem Window Tool geholt und ja auch darauf geachtet, dass es die Koordinaten innerhalb des Fensters sind) klickt, passiert nichts mehr
04/09/2013 17:15 YatoDev#4
ich würde gerne mal so nebenbei gerne mal alle controlclick / controlsend alternativen hier aufgelistet haben wenn es geht :)

und zum thread : gewöhn dir an #RequireAdmin am anfang des scripts zu schreiben . bei einigen leute besonders wenn du was released ist mir aufgefallenb funktioniert manches nicht richtig ohne admin rechte
04/18/2013 09:16 FoGzone#5
Ich habs endlich geschafft :D

Code:
#requireAdmin

HotKeySet ("{NUMPAD1}","_Start")
HotKeySet ("{NUMPAD2}","_Exit")

Opt ('WinTitleMatchMode','2') ; Helps With Getting The Window Information...
$Title = 'Diablo III' ; The Name Of The Game...
$Full = WinGetTitle ($Title) ; Get The Full Title..
$HWnD = WinGetHandle ($Full) ; Get The Handle
$iButton = 'left' ; Button The Mouse Will Click I.E. "Left Or Right"
$iClicks = '1' ; The Number Of Times To Click
$iX = '187' ; The "X" Pos For The Mouse To Click
$iY = '360' ; The "Y" Pos For The Mouse To Click


While 1
Sleep (10)
WEnd


Func _Start()
Sleep (100)
If IsHWnD ($HWnD) And WinExists ($Full) <> '0' Then ; Win Check
ControlClick ($HWnD, '','', $iButton, $iClicks, $iX, $iY) ; Clicking The Window While Its Minmized
EndIf
Sleep(500)
EndFunc

Func _Exit()
Exit
EndFunc