Jump to content

Clicking within an image


Recommended Posts

Im trying to make a bot to click an image at a certain spot currently right now it will find the image and click on it but not in a certain location. Here is the code im using

While 1
Global $iX, $iY
$search = _WaitForImageSearch("C:\Users\joey\Desktop\autoit stuff\test\12.png", 60, 1, $iX, $iY, 0)
If $search = 1 Then
Sleep(1000)
MouseClick("left", $iX, $iY, 1, 1)
Sleep(500)
ExitLoop
EndIf
WEnd

the image (12.png) is 335 x 83 px and i need it to click at 302 x 69

Any suggestions?

Link to comment
Share on other sites

Which program do 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

What I mean is: Why do you want to search for an image and then click on it in a specific location?

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

Im trying to make a bot to click an image at a certain spot currently right now it will find the image and click on it but not in a certain location. Here is the code im using

While 1
Global $iX, $iY
$search = _WaitForImageSearch("C:\Users\joey\Desktop\autoit stuff\test\12.png", 60, 1, $iX, $iY, 0)
If $search = 1 Then
Sleep(1000)
MouseClick("left", $iX, $iY, 1, 1)
Sleep(500)
ExitLoop
EndIf
WEnd

the image (12.png) is 335 x 83 px and i need it to click at 302 x 69

Any suggestions?

Yes - seeing how you used the word "Bot" and you want to click an image this strongly leads me to believe you are trying to automate a game which is against forum rules. Now, if you are not doing this, then I would suggest you be MUCH more forth coming on what is the NAME OF THE PROGRAM you wish for AutoIt to run for you. Right now you are on unstable ground.
Link to comment
Share on other sites

YogiBear,

please be patient ;)

I wanted the user to tell us what kind of bot he tries to write. Now he is warned :shifty:

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

Im trying to have a script that will take pictures such as a screen shot of my desktop and click on it then open up the things inside i don't have a definite use for it yet since i haven't been able to figure this part out but i may use it to click on certain fields on a website or have it check things for me on my own personal website but i would need it to be able to click images in a certain area

Link to comment
Share on other sites

Me too :huh:

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

Okay well how about this aside from the monitoring of my website i would also like to create a script to regulate my grades for school but the website my school uses is all based on images all but the grades so it would need to be able to click on specific parts in order to view my grades then later i can have it take a screenshot and send it to me

as for my website in the home page there is a banner which has 2 parts to it the website itself and then the forum but its all in one picture and then the script can check for other various things

Link to comment
Share on other sites

run-on sentences make concepts hard to grasp.

Everything but the grades are images?

Use the _IE* functions, and a tool that can read into the DOM object (IE developer tools) to find what to search for.

Screenshots would help back-up your claim

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
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...