Sign in to follow this  
Followers 0
crovax

anyone for pixel checksum help?

5 posts in this topic

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 :whistle:.

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.

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Thank you, bert! Works fine now xD.

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  
Followers 0