HiNoTora Posted April 28, 2013 Posted April 28, 2013 HIHI =DI have script for mouse cordinates.looks like this.HotKeySet("z","jPos")While 1 Sleep(100)WEndFunc jPos() $jPos = MouseGetPos() MsgBox(0, "Mouse x,y:", $jPos[0] & "," & $jPos[1]) EndFuncIt 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 falowingMouseClick("left", 1183, 348, 1)Sleep( 100 )so each time i press hotkey, autoit writes new line like this with new cordinates.
bogQ Posted April 28, 2013 Posted April 28, 2013 (edited) 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 April 28, 2013 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) 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.
HiNoTora Posted April 28, 2013 Author Posted April 28, 2013 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.
water Posted April 28, 2013 Posted April 28, 2013 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 2024-07-28 - Version 1.6.3.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 (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
HiNoTora Posted April 28, 2013 Author Posted April 28, 2013 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 PRESSEDSleep( 100 )MouseClick("left", 639, 586, 1) ;ExtractingSleep( 100 )MouseClick("left", 641, 561, 1) ;ExtractingSleep( 100 )MouseClick("left", 1105, 346, 1) ;NEED TO BE CHANGED WHEN HOT KEY PRESSEDSleep( 100 )MouseClick("left", 639, 586, 1) ;ExtractingSleep( 100 )MouseClick("left", 641, 561, 1) ;ExtractingSleep( 100 )MouseClick("left", 1105, 346, 1) ;NEED TO BE CHANGED WHEN HOT KEY PRESSEDSleep( 100 )MouseClick("left", 639, 586, 1) ;ExtractingSleep( 100 )MouseClick("left", 641, 561, 1) ;ExtractingSleep( 100 )MouseClick("left", 1105, 346, 1) ;NEED TO BE CHANGED WHEN HOT KEY PRESSEDSleep( 100 )MouseClick("left", 639, 586, 1) ;ExtractingSleep( 100 )MouseClick("left", 641, 561, 1) ;ExtractingSleep( 100 )MouseClick("left", 1105, 346, 1) ;NEED TO BE CHANGED WHEN HOT KEY PRESSEDSleep( 100 )MouseClick("left", 639, 586, 1) ;ExtractingSleep( 100 )MouseClick("left", 641, 561, 1) ;ExtractingSleep( 100 )MouseClick("left", 1105, 346, 1) ;NEED TO BE CHANGED WHEN HOT KEY PRESSEDSleep( 100 )MouseClick("left", 639, 586, 1) ;ExtractingSleep( 100 )MouseClick("left", 641, 561, 1) ;ExtractingSleep( 100 )And this code i need to repeat few hundred times.. MouseClick("left", 1105, 346, 1) ;NEED TO BE CHANGED WHEN HOT KEY PRESSEDSleep( 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 PRESSEDSleep( 100 )MouseClick("left", 639, 586, 1) ;ExtractingSleep( 100 )MouseClick("left", 641, 561, 1) ;ExtractingSleep( 100 )This is one set of code, wich i need to repeat a lot times.
bogQ Posted April 28, 2013 Posted April 28, 2013 (edited) 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 April 28, 2013 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) 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.
water Posted April 28, 2013 Posted April 28, 2013 But I still don't know which program you try to automate. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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
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