Jump to content
Sign in to follow this  
goldenedge

Clicking within an image

Recommended Posts

goldenedge

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?

Share this post


Link to post
Share on other sites
water

Which program do you try to automate?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
goldenedge

autoit v3 the file extension is .au3 or are you talking about what im using it for?

Edited by goldenedge

Share this post


Link to post
Share on other sites
water

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 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Bert

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.

Share this post


Link to post
Share on other sites
water

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 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
goldenedge

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

Share this post


Link to post
Share on other sites
water

Me too :huh:


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
goldenedge

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

Share this post


Link to post
Share on other sites
jdelaney

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.

Share this post


Link to post
Share on other sites
Bert

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

agreed

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  

×