lolp1 Posted July 14, 2006 Posted July 14, 2006 Hello, I'm wondering if it is possible to run 2 pixel Check sums at the same time. Here is a example from the help file ; Wait until something changes in the region 0,0 to 50,50 ; Get initial checksum $checksum = PixelChecksum(0,0, 50,50) ; Wait for the region to change, the region is checked every 100ms to reduce CPU load While $checksum = PixelChecksum(0,0, 50, 50) Sleep(100) WEnd MsgBox(0, "", "Something in the region has changed!") I wan't to run two of these, but at the same time! Is it possible?
Nomad Posted July 14, 2006 Posted July 14, 2006 (edited) Hello, I'm wondering if it is possible to run 2 pixel Check sums at the same time. Here is a example from the help file ; Wait until something changes in the region 0,0 to 50,50 ; Get initial checksum $checksum = PixelChecksum(0,0, 50,50) ; Wait for the region to change, the region is checked every 100ms to reduce CPU load While $checksum = PixelChecksum(0,0, 50, 50) Sleep(100) WEnd MsgBox(0, "", "Something in the region has changed!") I wan't to run two of these, but at the same time! Is it possible?That's called multi-threading, and AutoIt doesn't support multi-threading. But if you search the forums you'll find that it is possible, but could have unforseen side-effects with the engine driving AutoIt. Nomad Edit: If you absolutely need these at the same time and don't want to multi-thread, you can create a second compiled script containing the second pixelchecksum and course of action and have it run at the same time as your main script. Edited July 14, 2006 by Nomad
evilertoaster Posted July 14, 2006 Posted July 14, 2006 you could also do 'virtual' multithreading with somthing like AdlibEnable() but that's like our 'virtual' multi-tasking processors, they just switch jobs really fast^^
Administrators Jon Posted July 14, 2006 Administrators Posted July 14, 2006 It doesn't sound like you want to run both at the same time, just check two regions at once which is a subtle difference ; Wait until something changes in the region 0,0 to 50,50 or 100, 100 to 200,200 ; Get initial checksums $checksum = PixelChecksum(0,0, 50,50) $checksum2 = PixelChecksum(100,100, 200,200) ; Wait for the region to change, the region is checked every 100ms to reduce CPU load While $checksum = PixelChecksum(0,0, 50, 50) And $checksum2 = PixelChecksum(100,100, 200, 200) Sleep(100) WEnd MsgBox(0, "", "Something in one of the regions has changed!")
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