Sobiech Posted May 12, 2009 Share Posted May 12, 2009 (edited) Hi, this is my first post on this forum So, i have a small problem with cords#include <Process.au3>HotKeySet('{F1}', 'quit')$Ini = @ScriptDir & '\Ustawienia_G.ini'$WindowName = IniRead($Ini, "Ustawienia", "D2WindowName", "Diablo II")Opt("MouseCoordMode", 2);1=absolute, 0=relative, 2=client$millisecondsToDelay = 1000;change this if you wantSleep(3000) Sleep ($millisecondsToDelay) MouseClick ("left",391,335,1,0); Login to BN Europe Sleep ($millisecondsToDelay) MouseClick("left",327,225,1,0); Move cursor to acc box Sleep ($millisecondsToDelay) MouseClick("left",327,225,1,0); Move cursor to acc box Sleep ($millisecondsToDelay) Send("HoC-InFlames"); Send account Sleep ($millisecondstodelay) MouseClick("left",270,278,1,0); Go to password box Sleep ($millisecondsToDelay) Send("mypassword"); Send password Sleep ($millisecondsToDelay) MouseClick("left",316,359,1,0); Click on "Sign Up"Func quit() ExitEndFuncHere is my small script to mouse moves. Cords are prepared to windowed game . I get cordinates from thisMouseGetPos()Opt('MouseCoordMode')#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6Opt('MustDeclareVars', 2)#include <WinAPI.au3>Sleep(2000)_Main()Func _Main() Local $hwnd = GUICreate("test") Local $tPoint = _WinAPI_GetMousePos() Local $tPoint2 = _WinAPI_GetMousePos(True, $hwnd) MsgBox(4096, "Mouse Pos", _ "X = " & DllStructGetData($tPoint, "X") & @LF & "Y = " & DllStructGetData($tPoint, "Y") & @LF & @LF & _ "Client" & @LF & "X = " & DllStructGetData($tPoint2, "X") & @LF & "Y = " & DllStructGetData($tPoint2, "Y"))EndFunc ;==>_MainWhat is the problem? i copyied cords to first script (suggested client window) but every times when i run project again these cords is changing Something like "missclick".Srry for my english skills i am not sure i wrote this correct Why mouse dont click in the correct position? Edited May 12, 2009 by Sobiech This world is crazy Link to comment Share on other sites More sharing options...
KenNichols Posted May 12, 2009 Share Posted May 12, 2009 MouseCoordMode 2=relative coords to the client area of the active windowTry - CODEWinActivate ( "title" [, "text"] ) [topic="21048"]New to AutoIt? Check out AutoIt 1-2-3![/topic] Need to make a GUI? You NEED KODA FormDesigner! Link to comment Share on other sites More sharing options...
Sobiech Posted May 12, 2009 Author Share Posted May 12, 2009 Hmm i still have "miss click" , maybe my mouse script is wrong? i dont understand, i wrote good cords This world is crazy Link to comment Share on other sites More sharing options...
Sobiech Posted May 12, 2009 Author Share Posted May 12, 2009 No1 have idea what is wrong with this? (bump) This world is crazy Link to comment Share on other sites More sharing options...
Sobiech Posted May 17, 2009 Author Share Posted May 17, 2009 (edited) Ok now i know MouseGetPos() Opt('MouseCoordMode', 2) Sleep(2000) $pos = MouseGetPos() MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1]) This is good script to get cords from my active window Edited May 17, 2009 by Sobiech This world is crazy Link to comment Share on other sites More sharing options...
Inverted Posted May 17, 2009 Share Posted May 17, 2009 (edited) Here is an interactive version Opt('MouseCoordMode', 2) While 1 $pos = MouseGetPos() Tooltip($pos[0] &" "& $pos[1]) Sleep (15) WEnd End the script using the tray icon. Edited May 17, 2009 by Inverted Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now