Jump to content

Help with mouse cords


Recommended Posts

HIHI =D

I have script for mouse cordinates.

looks like this.

HotKeySet("z","jPos")

While 1

Sleep(100)

WEnd

Func jPos()

$jPos = MouseGetPos()

MsgBox(0, "Mouse x,y:", $jPos[0] & "," & $jPos[1])

EndFunc

It works, i get cords. I need a lot of cordinates to add to my script 100+

So how i can mod this script to write cordinates itself.

So if i press Hotkey Z, Autoit gets cordinates, and writes itself falowing

MouseClick("left", 1183, 348, 1)

Sleep( 100 )

so each time i press hotkey, autoit writes new line like this with new cordinates.

Link to comment
Share on other sites

I suggest for start that you use IniWrite to store coordinates, add key as date or similar and read them all with IniReadSection so that MouseClick can use them.

script to write itself isn't good idea if your planning to make exe of first script for distribution.

if you think it is that you do have FileWrite _FileWriteToLine _FileWriteFromArray and other commands that can help you.

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

I suggest for start that you use IniWrite to store coordinates, add key as date or similar and read them all with IniReadSection so that MouseClick can use them.

script to write itself isn't good idea if your planning to make exe of first script for distribution.

if you think it is that you do have FileWrite _FileWriteToLine _FileWriteFromArray and other commands that can help you.

Its just help script for making another script. im using cordinates script, running background, pumping hotkey and i have new autoitfile open and active window and all the cordinates will be writed there for me.. its just so i dont have to write em myself fewhundred times.

Link to comment
Share on other sites

Using screen coordinates to automate a program isn't a good idea because it highly depends on screen resolution and window position.

Which program do you try to automate? Often there is a more reliable way to do what you want!

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Using screen coordinates to automate a program isn't a good idea because it highly depends on screen resolution and window position.

Which program do you try to automate? Often there is a more reliable way to do what you want!

Window and screen reso is allwyas fixed, cos im using program so.

MouseClick("left", 1105, 346, 1) ;NEED TO BE CHANGED WHEN HOT KEY PRESSED

Sleep( 100 )

MouseClick("left", 639, 586, 1) ;Extracting

Sleep( 100 )

MouseClick("left", 641, 561, 1) ;Extracting

Sleep( 100 )

MouseClick("left", 1105, 346, 1) ;NEED TO BE CHANGED WHEN HOT KEY PRESSED

Sleep( 100 )

MouseClick("left", 639, 586, 1) ;Extracting

Sleep( 100 )

MouseClick("left", 641, 561, 1) ;Extracting

Sleep( 100 )

MouseClick("left", 1105, 346, 1) ;NEED TO BE CHANGED WHEN HOT KEY PRESSED

Sleep( 100 )

MouseClick("left", 639, 586, 1) ;Extracting

Sleep( 100 )

MouseClick("left", 641, 561, 1) ;Extracting

Sleep( 100 )

MouseClick("left", 1105, 346, 1) ;NEED TO BE CHANGED WHEN HOT KEY PRESSED

Sleep( 100 )

MouseClick("left", 639, 586, 1) ;Extracting

Sleep( 100 )

MouseClick("left", 641, 561, 1) ;Extracting

Sleep( 100 )

MouseClick("left", 1105, 346, 1) ;NEED TO BE CHANGED WHEN HOT KEY PRESSED

Sleep( 100 )

MouseClick("left", 639, 586, 1) ;Extracting

Sleep( 100 )

MouseClick("left", 641, 561, 1) ;Extracting

Sleep( 100 )

MouseClick("left", 1105, 346, 1) ;NEED TO BE CHANGED WHEN HOT KEY PRESSED

Sleep( 100 )

MouseClick("left", 639, 586, 1) ;Extracting

Sleep( 100 )

MouseClick("left", 641, 561, 1) ;Extracting

Sleep( 100 )

And this code i need to repeat few hundred times..

MouseClick("left", 1105, 346, 1) ;NEED TO BE CHANGED WHEN HOT KEY PRESSED

Sleep( 100 )

it has allways different cordinates.

I know them, and i need to write them down. But its pain to do so.

Easyer would be, I move mouse where it have to be, press hotkey and set of code will be dont in new autoitscript , wich would be active window same time.

MouseClick("left", 1105, 346, 1) ;NEED TO BE CHANGED WHEN HOT KEY PRESSED

Sleep( 100 )

MouseClick("left", 639, 586, 1) ;Extracting

Sleep( 100 )

MouseClick("left", 641, 561, 1) ;Extracting

Sleep( 100 )

This is one set of code, wich i need to repeat a lot times.

Link to comment
Share on other sites

for ;NEED TO BE CHANGED WHEN HOT KEY PRESSED

I think your looking something like this instead hotkey?

#include <Misc.au3>
If _IsPressed('5A') Then; Z key
Do
     Sleep(10)
Until Not _IsPressed('5A'); Z key
EndIf

edit: and loop can help you for repeating something

For $x = 1 to 100

next
Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

But I still don't know which program you try to automate.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...