crovax Posted March 2, 2007 Share Posted March 2, 2007 hey there ppl, of course, im a noob....but i have a question i couldnt find the answer to in help file or forums with pixel checksum. I dont have the coordinates right yet in the snippet, but..well heres the snippet first..terrible I know, but thats why I'm here . Global $traderequest = Pixelchecksum(Left,top,right,bottom);notice if a trade request has opened If $traderequest = Pixelchecksum(left,top,right,bottom) Then;different checksum Execute( Trade() ) EndIf While $traderequest = Pixelchecksum(left,top,right,bottom) ;same as global checksum sleep(100) WEnd Ok, what I'm asking is: was global the right choice, and did I even declare it right? I was unable to get coordinates, but when I have them, I am trying to monitor a certain square of the screen for pixel change, when it does change, I need to trigger Trade(), but any other time it just needs to monitor for change. I see all the newbie posts and I understand that its overwhelming, but if anyone would like to help, I would appreciate it greatly. Also, I have candy. Link to comment Share on other sites More sharing options...
lolp1 Posted March 2, 2007 Share Posted March 2, 2007 You could use: $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 Trade() I think.. anyways. Link to comment Share on other sites More sharing options...
crovax Posted March 3, 2007 Author Share Posted March 3, 2007 Execute( FirstRun() ) sleep(1000) $traderequest = PixelChecksum( 525, 500, 398, 380 ); has to get checksum after FirstRun While $traderequest = PixelChecksum( 525, 500, 398, 380 ); pause as long as checksum stays the same Sleep(100) WEnd Execute( Trade() ) ;when the checksum changes, continue program normally What I'm trying to do is get the checksum for a certain area, then continue the script when the checksum changes in that area. One problem I'm having is I'm not really sure how to set the coords (left, top, right, bottom..Am I supposed to just take the x Coord for left and Y for top and make a rectangle with Right as X coords and Y for bottom coords?) Maybe its related, but when I run the script I get "Error Allocating Memory" when it gets to the checksum part of the script. Also, I just dont think this part of the script works right anyway. Any help would be appreciated. Link to comment Share on other sites More sharing options...
BrettF Posted March 3, 2007 Share Posted March 3, 2007 PixelChecksum ( left, top, right, bottom) left: left coordinate of rectangle. top: top coordinate of rectangle. right: right coordinate of rectangle. bottom: bottom coordinate of rectangle. Taken from the good ol' helpfile Also. I would think that: left would have to be less then right and top would have to be less then bottom. Hope that helps Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
crovax Posted March 3, 2007 Author Share Posted March 3, 2007 Thank you, bert! Works fine now xD. 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