Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Region Change Script Help


  • Please log in to reply
1 reply to this topic
BuggyLemon
  • Members
  • 1 posts
  • Last active: Nov 02 2014 06:33 PM
  • Joined: 31 Oct 2014

Hi guys, complete noob here unfortunately...

 

I just want to make a script that will detect a the change of pixels in a region and act upon that change.

 

My question is...

 

I'm using this function:

 

http://www.autohotke...-stop-changing/

 

But how do I implement the function into my program? Do I need to save it to the same directory as the program runs from?

 

And can someone give me sample code for this process?:

 

RegionWaitChage(params here)

//after region changes

Do this

 

Thanks a lot



Oldman
  • Members
  • 2475 posts
  • Last active: Feb 18 2015 04:57 PM
  • Joined: 01 Dec 2013

You can save the function in the same directory as the script.

#Include RegionWaitChange.ahk

Or you can save the function in a ...\Lib folder.

#Include <RegionWaitChange>

A example :

#Include <RegionWaitChange>
CoordMode, Pixel, Screen
CoordMode, Mouse, Window
SetControlDelay -1
SetTitleMatchMode 2

F12::
Loop
{
	RegionWaitChange(2270, 450, 5, 5, Mozilla)
	ControlClick, X470 Y522, Mozilla,,,2, NA
	Sleep 2000
}
return

The function mentions that the coordinates in the parameter list, are relative to the window.

This is an error, the coordinates are relative to the screen --> CoordMode, Pixel, Screen.


Si ton labeur est dur et que tes résultats sont minces, souviens toi du grand chêne qui avant n'était qu'un gland....comme toi ! (anonyme) ;)

L'art de lire, c'est l'art de penser avec un peu d'aide. (É. Faguet)

Windows 3.1. Collector's Edition.     (www.avaaz.org)