Jump to content

Running PixelGetColor in background


Leo87
 Share

Recommended Posts

Hi, I'm new in using AutoIt and was working to make a simple bot for a game. I have some part of the script here..

Do
    ControlSend($win ,"" ,"" ,"2")  ;send key 2 for the 2nd Skill
    Sleep(1000) ;stop for 1 sec
    ControlSend($win ,"" ,"" ,"1") ;send key 1 for the 1st Skill
    Sleep(1000) ;stop for 1 sec
    If PixelGetColor(102,146, $handle) <> 0xFF8242 Then ;Look if HP is less than specified (Only Instant HP should be used)
        ControlSend($win ,"" ,"" ,"4") ;Press 9 for + instant HP
    EndIf


    If PixelGetColor(93,159, $handle) <> 0x187DFF Then;Look if MP less than specified (Only Instant MP should be used)
        ControlSend($win ,"" ,"" ,"0") ;Press 0 for + instant MP
        Sleep(500)
    EndIf



Until PixelGetColor(466,124, $handle) <> 0x426D8C ;Keep repeating until the selected monster died

As my control are running in background, i have one big problem here;

I could not fully run this bot on background. This means I have to make some part of the game open so that this script would work. So i figure it out, since all the key and mouse click is running on background, there left the PixelGetColor command that does not do so.

So I would like to ask, Could I run the PixelGetColor in background? If can hope you can teach me. If Cannot, how do i solve this function?

FYI, the PixelGetColor is used to check the HP and MP of the game.

Hope someone can help me with this.

Really Thanks..

Leo

Link to comment
Share on other sites

  • 1 year later...
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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