Sign in to follow this  
Followers 0
Natas70

pixelgetcolor / pixelchecksum

2 posts in this topic

i am working on a magic the gathering bot (MTGO) i have the first part of the script working, logging on, stretching the screen to a specified area, so i know that no matter what resolution it is on, it will always be in the same position on the screen. I am at the point of waiting for a trade. I have it checking for pixelchecksum area for the pop up window "to accept trade" and it triggers that the area has changed. but when i pixelchecksum checks a different area for the "yes" button, i have it set for the correct value and it accepts trades, but the next time it loads mtgo and checks for the trade again, it will not accept the trade because the checksum value is different. The button hasn't moved, it hasn't changed color.

I am currently programming and testing on a laptop, would this cause any problems, it never goes into power options or screensaver mode, so that should not cause a problem. i have seen some say something about changeing background color, but if mtgo is present, what does the background have to do with it?

pixelchecksum,getcolor, seem to be failry straight forward, check location for color or sum, and return that value, i just don't get why the value is changing without the color and location changing.

Can anyone suggest what i am potentially missing or something to try. If you have any questions that might help you help me, please let me know

Thanx in advance.

James

while $bot = "run"
    $checksum = PixelChecksum(495,237, 785,237)
; Wait for the region to change, the region is checked every 100ms to reduce CPU load
    While $checksum = PixelChecksum(495,237, 785,237)   
             Sleep(500)
                WEnd

    mousemove (920,470); move mouse over buttons to make sure they are not highlighted
    mousemove (470,470)
    Sleep(500)
    $checkcolor = pixelchecksum(525,455,750,485)
    ToolTip( $bot & "  " & $checkcolor, 0, 0);show the value of the checkcolor
    if $checkcolor = "2716828899"  then 
        intrade ()
        mouseclick ("left",920,455)
    EndIf
    if $checkcolor = "3193836742" then mouseclick ("left",635,470); trade canceled by host
    mousemove (920,455)
WEnd
exit

Share this post


Link to post
Share on other sites



i am working on a magic the gathering bot (MTGO) i have the first part of the script working, logging on, stretching the screen to a specified area, so i know that no matter what resolution it is on, it will always be in the same position on the screen. I am at the point of waiting for a trade. I have it checking for pixelchecksum area for the pop up window "to accept trade" and it triggers that the area has changed. but when i pixelchecksum checks a different area for the "yes" button, i have it set for the correct value and it accepts trades, but the next time it loads mtgo and checks for the trade again, it will not accept the trade because the checksum value is different. The button hasn't moved, it hasn't changed color.

I am currently programming and testing on a laptop, would this cause any problems, it never goes into power options or screensaver mode, so that should not cause a problem. i have seen some say something about changeing background color, but if mtgo is present, what does the background have to do with it?

pixelchecksum,getcolor, seem to be failry straight forward, check location for color or sum, and return that value, i just don't get why the value is changing without the color and location changing.

Can anyone suggest what i am potentially missing or something to try. If you have any questions that might help you help me, please let me know

Thanx in advance.

James

while $bot = "run"
    $checksum = PixelChecksum(495,237, 785,237)
; Wait for the region to change, the region is checked every 100ms to reduce CPU load
    While $checksum = PixelChecksum(495,237, 785,237)   
             Sleep(500)
                WEnd

    mousemove (920,470); move mouse over buttons to make sure they are not highlighted
    mousemove (470,470)
    Sleep(500)
    $checkcolor = pixelchecksum(525,455,750,485)
    ToolTip( $bot & "  " & $checkcolor, 0, 0);show the value of the checkcolor
    if $checkcolor = "2716828899"  then 
        intrade ()
        mouseclick ("left",920,455)
    EndIf
    if $checkcolor = "3193836742" then mouseclick ("left",635,470); trade canceled by host
    mousemove (920,455)
WEnd
exit
Try making it so that it accepts if the color has changed at all. Quick example:

$Color = PixelGetColor(1, 1)
Do
$Last = $Color
$Color = PixelGetColor(1, 1)
Until $Last <> $Color

PS: Sorry if I didn't get the parameters right, I'm on a MacBook right now.


For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

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