Jump to content
Sign in to follow this  
HiNoTora

Help with mouse cords

Recommended Posts

HiNoTora

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.

Share this post


Link to post
Share on other sites
bogQ

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.

 

Share this post


Link to post
Share on other sites
HiNoTora

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.

Share this post


Link to post
Share on other sites
water

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 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
HiNoTora

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.

Share this post


Link to post
Share on other sites
bogQ

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.

 

Share this post


Link to post
Share on other sites
water

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


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  

×