Jump to content

Little problem using colors


Recommended Posts

I want to make an automated bot for minesweeper, but for begining tooltips are fine. I msgboxed $x in both cases, when my mouse was over a mine, and when it wasn't. I've put those values in the If statements. I always get the third message. What's wrong? Should I use the color in other format, like HEX?

WinActivate("Minesweeper")
WinWaitActive("Minesweeper")

Send("xyzzy")
Send("{LSHIFT}")

$x = PixelGetColor(0, 0)

While 1
    If $x = "16777215" Then
        ToolTip("MINE!!!")
    ElseIf $x = "0" Then
        ToolTip("No mine")
    Else
        ToolTip("lol... what did you do?")
    EndIf
WEnd
Link to comment
Share on other sites

Shouldn't you be getting that all the time as you only PixelGetColor in one particular place at 0,0 and it is not either 0 or 16777215. You don't need to write it in hex but decimal is fine. One option I have for you is to make a PixelGetColor inside the loop 1 that keeps getting to new postion for you to use and something about the layout of the blocks would be another thing to work on

Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

Link to comment
Share on other sites

Shouldn't you be getting that all the time as you only PixelGetColor in one particular place at 0,0 and it is not either 0 or 16777215. You don't need to write it in hex but decimal is fine. One option I have for you is to make a PixelGetColor inside the loop 1 that keeps getting to new postion for you to use and something about the layout of the blocks would be another thing to work on

Yay thank you! I didn't thought at putting the pixelgetcolor inside the loop. That was the problem. The next step I thought of is to move the mouse from left to right on each row, and check for the color from time to time, when it goes from one block to another, and then click it.
Link to comment
Share on other sites

anytime Minesweeper was fun and a thing to script for. I have it on Vista (I think it is the best windows, btw just for people ut there that think of xp as the best) and it is displayed really nice I had programmed a version with a embedded query that slowed time down to a fraction of time or speed up time and a chance to view where the mines where located all programmed using asm and a hex editor

Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...