MatthewGale Posted March 24, 2010 Share Posted March 24, 2010 (edited) I know little about scripting for AutoIt so I figured I would ask to see if there is anyone that could help out. I'm looking to write a script so that when I press a key such as F12 it clicks in 2 spots on the screen. The first problem I'm having is that due to restrictions on the computer I'm on I can't install the customized scite so I'm having problems getting the position of the boxes that need to be clicked. I would imagine the best way would be to use the window info to click on it but am not sure how to write the script for it. Here are the two windows that would need to be clicked. >>>> Window <<<< Title: DCC Lead Transfer System 2.2 Class: WindowsForms10.window.8.app.0.378734a Position: 911, 736 Size: 369, 260 Style: 0x16C80000 ExStyle: 0x00010108 Handle: 0x000101F8 >>>> Control <<<< Class: WindowsForms10.SysListView32.app.0.378734a Instance: 1 ClassnameNN: WindowsForms10.SysListView32.app.0.378734a1 Name: ListView1 Advanced (Class): [NAME:ListView1] ID: 66054 Text: Position: 12, 69 Size: 339, 102 ControlClick Coords: 39, 29 Style: 0x56010141 ExStyle: 0x00000200 Handle: 0x00010206 >>>> Mouse <<<< Position: 965, 856 Cursor ID: 0 Color: 0xFFFFFF >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< You are logged in as an LTS receiver You can receive "PS1LIVE, App Terms and Conditions and 605 - Spring Fax PS1" transfers. There are currently no active transfers. View My Transfer History... Cancel This Transfer Accept This Transfer >>>> Hidden Text <<<< >>>> Window <<<< Title: DCC Lead Transfer System 2.2 Class: WindowsForms10.window.8.app.0.378734a Position: 911, 736 Size: 369, 260 Style: 0x16C80000 ExStyle: 0x00010108 Handle: 0x000101F8 >>>> Control <<<< Class: WindowsForms10.BUTTON.app.0.378734a Instance: 2 ClassnameNN: WindowsForms10.BUTTON.app.0.378734a2 Name: Button1 Advanced (Class): [NAME:Button1] ID: 66052 Text: Accept This Transfer Position: 107, 177 Size: 119, 23 ControlClick Coords: 58, 13 Style: 0x5601000B ExStyle: 0x00000000 Handle: 0x00010204 >>>> Mouse <<<< Position: 1079, 948 Cursor ID: 0 Color: 0x000000 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< You are logged in as an LTS receiver You can receive "PS1LIVE, App Terms and Conditions and 605 - Spring Fax PS1" transfers. There are currently no active transfers. View My Transfer History... Cancel This Transfer Accept This Transfer >>>> Hidden Text <<<< Thanks in advance for any help, it's much appreciated and would make my job much easier (and more profitable). Edited March 24, 2010 by MatthewGale Link to comment Share on other sites More sharing options...
bogQ Posted March 24, 2010 Share Posted March 24, 2010 (edited) F12 It is reserved by Windows, according to its API. So try some other key Open help file HotKeySet ControlClick ControlSend or MouseMove MouseClick Send Every command in help file have example on the botom of its page so that you can learn from it. Edited March 24, 2010 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. Link to comment Share on other sites More sharing options...
MatthewGale Posted March 24, 2010 Author Share Posted March 24, 2010 Ugh, due to restrictions set on this computer I can't access the information in the help file. It says that The program cannot display the webpage. Link to comment Share on other sites More sharing options...
bogQ Posted March 24, 2010 Share Posted March 24, 2010 Added htm version for that commands 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. Link to comment Share on other sites More sharing options...
MatthewGale Posted March 24, 2010 Author Share Posted March 24, 2010 Thanks I appreciate it! Link to comment Share on other sites More sharing options...
GEOSoft Posted March 24, 2010 Share Posted March 24, 2010 Thanks I appreciate it!Also if you check my signature, I have an online version of the help file that you may be able to access. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
MatthewGale Posted March 24, 2010 Author Share Posted March 24, 2010 HotKeySet("{Esc}", "PressEsc") Func Presses() ; ... can do stuff here HotKeySet("{Esc}") ControlClick ( "DCC Lead Transfer System 2.2", "", 66054 [, left [, 1 [, 34[,27 ]]]] ) Sleep 5 ControlClick ( "DCC Lead Transfer System 2.2", "Accept This Transfer", 66052 [, left [, 1 [, 46[,13 ]]]] ) HotKeySet("{Esc}", "PressEsc") EndFunc Would have thought this would do it but I'm not having any luck... Link to comment Share on other sites More sharing options...
GEOSoft Posted March 24, 2010 Share Posted March 24, 2010 And what do you have in your PressEsc() function? George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
bogQ Posted March 24, 2010 Share Posted March 24, 2010 (edited) You dont need [, left [, 1 [, 46[,13 ]]]] its , "left" , 1 , 46, 13 [] is there to mark that its optional default data You can do it like this ControlClick ( "DCC Lead Transfer System 2.2", "", "66054" ) Or add more options ControlClick ( "DCC Lead Transfer System 2.2", "", "66054" , "left" , 1 , 34 , 27 ) And your probably missing loop while 1 wend Your sleep command isnt correct Sleep(5000) ;five seconds Edited March 24, 2010 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. Link to comment Share on other sites More sharing options...
GEOSoft Posted March 24, 2010 Share Posted March 24, 2010 I have a hunch he's not even getting that far yet. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
MatthewGale Posted March 24, 2010 Author Share Posted March 24, 2010 HotKeySet("{Esc}", "PressEsc") Func PressEsc() ControlClick ( "DCC Lead Transfer System 2.2", "", "66054" , "left" , 1 , 34 , 27 ) Sleep 5 ControlClick ( "DCC Lead Transfer System 2.2", "", "66052" , "left" , 1 , 46 , 13 ) EndFunc Still not going anywhere with this... I don't need it to loop I just want to hit escape and have it click the two spots. The reason I want this program is we are occasionally transferred live leads and the first person to click it gets the lead. I'm trying to create a script that will allow me to click it as quick as possible. I can't understand why the code isn't working but then again... I'm a sales guy not a programmer. Link to comment Share on other sites More sharing options...
bogQ Posted March 24, 2010 Share Posted March 24, 2010 (edited) You need loop or the script will exit before you press any esc button So put loop and change your Sleep 5 to Sleep(5) 5 = 5 miliseconds for 5 seconds put 5000 HotKeySet("{KEY}","somefunc") While 1 Wend Func somefunc() EndFunc Edited March 24, 2010 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. 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