Sign in to follow this  
Followers 0
YaBoy

Help with PixelGet Color

16 posts in this topic

#1 ·  Posted (edited)

got it

Edited by YaBoy

Share this post


Link to post
Share on other sites



can someone please help me?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Instead of doing this:

MouseMove(190,63)
MouseDown("left")
MouseUp("left")oÝ÷ Ù:ò¶¬jëh×6
MouseClick("Left", 190,63)
oÝ÷ Ø    l¡«2¢é'£âÅéFzШÑzÛ«Ëax1 À½©nzÚrh¯'­Ê¢jZ­è­¶axqÂ+a¶¬jëh×6 If PixelGetColor(507, 212) = 5B5B5F ThenoÝ÷ Ù*¯+aÆ®¶­sbbWVÄvWD6öÆ÷"SrÂ#"ÃbÒT#T#TbFV

And don't bump your post after just 24 minutes. Wait a few hours before bumping.

Edited by Paulie

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I tried this:

If Hex(PixelGetColor(507, 212),6) = 5B5B5F Then

And I get this error:

The hex number doesnt show up in pink color. Only the 5 does.

Edited by YaBoy

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

It compiles, but it still stops before the if statement. The macro just stops and terminates.

All I want is when I click here it will continue if it gets that color.

So this is the only code I really need:

MouseClick("Left", 190,63)

If PixelGetColor(507, 212) = "5987167" Then 

MouseMove(186,63)
MouseDown("left")
MouseUp("left")
MouseMove(186,63)
MouseDown("left")
MouseUp("left")
EndIf

but its not working, have any other ideas what I can do/use?

AND BTW, When I use code for a message box to tell me the decimal and hex number it gives me different numbers then the Window AutoIt tool one.

Edited by YaBoy

Share this post


Link to post
Share on other sites

...AND BTW, When I use code for a message box to tell me the decimal and hex number it gives me different numbers then the Window AutoIt tool one.

I do not usually post to threads that involves games, but the problem the OP is having might be related to the settings within the "AutoIt Window Info" tool. See my post here: http://www.autoitscript.com/forum/index.ph...st&p=289130

Another way to get this type of info is to make your own tool:

Opt("MouseCoordMode", 0) ;0 = relative coords to the active window
;Opt("MouseCoordMode",1) ;1 = absolute screen coordinates (default)
;Opt("MouseCoordMode",2) ;2 = relative coords to the client area of the active window

HotKeySet("{ESC}", "Terminate")

If Opt("MouseCoordMode") = 0 Then $var = "window"
If Opt("MouseCoordMode") = 1 Then $var = "screen"
If Opt("MouseCoordMode") = 2 Then $var = "client"

While 1
    $pos = MouseGetPos()
    $pgc = PixelGetColor($pos[0], $pos[1])
    ToolTip("Press ESC to exit" & @CR & $var & "  x: " & $pos[0] & ", y: " & $pos[1] & @CR & $pgc)
    Sleep(100)
WEnd

Func Terminate()
    ClipPut("If PixelGetColor(" & $pos[0] & ", " & $pos[1] & ') = "' & $pgc & '" Then')
    Exit
EndFunc   ;==>Terminate
After you have learned a bit out which MouseCoordMode mode you wish to operate in,

change which "Opt" line is remarked out in the little tool above,

run the code,

place the mouse over the pixel of interest,

press the Esc key to exit the script,

paste the contents of the clipboard into the script that you are writing...

later


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

I do not usually post to threads that involves games, but the problem the OP is having might be related to the settings within the "AutoIt Window Info" tool. See my post here: http://www.autoitscript.com/forum/index.ph...st&p=289130

Another way to get this type of info is to make your own tool:

Opt("MouseCoordMode", 0) ;0 = relative coords to the active window
;Opt("MouseCoordMode",1) ;1 = absolute screen coordinates (default)
;Opt("MouseCoordMode",2) ;2 = relative coords to the client area of the active window

HotKeySet("{ESC}", "Terminate")

If Opt("MouseCoordMode") = 0 Then $var = "window"
If Opt("MouseCoordMode") = 1 Then $var = "screen"
If Opt("MouseCoordMode") = 2 Then $var = "client"

While 1
    $pos = MouseGetPos()
    $pgc = PixelGetColor($pos[0], $pos[1])
    ToolTip("Press ESC to exit" & @CR & $var & "  x: " & $pos[0] & ", y: " & $pos[1] & @CR & $pgc)
    Sleep(100)
WEnd

Func Terminate()
    ClipPut("If PixelGetColor(" & $pos[0] & ", " & $pos[1] & ') = "' & $pgc & '" Then')
    Exit
EndFunc   ;==>Terminate
After you have learned a bit out which MouseCoordMode mode you wish to operate in,

change which "Opt" line is remarked out in the little tool above,

run the code,

place the mouse over the pixel of interest,

press the Esc key to exit the script,

paste the contents of the clipboard into the script that you are writing...

later

That tool does help, thanks.

But, the script stops and terminates soon before the if statement. It hits to enter cave, then thats when I put my if statement in(Dont proceed unless you see this color) Which could be from 5 secs to 1 min. It just ends.

Any suggestions?

Share this post


Link to post
Share on other sites

...(Dont proceed unless you see this color)...

Then you need a delay. Perhaps the Do/Until loop that I sent you via PM might work.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

I tried sir. The script doesnt stop, its still running, but when I enter the cave, I stop. I just stand there and it doesnt proceed. But I see the script still active on the bottom right of my toolbar.

Share this post


Link to post
Share on other sites

I tried sir. The script doesnt stop, its still running, but when I enter the cave, I stop. I just stand there and it doesnt proceed. But I see the script still active on the bottom right of my toolbar.

Not being a gamer, I'm not sure if your game reports the correct mouse positions back to the OS and hence AutoIt. Perhaps others out there know a bit more about "The Realm Online".


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

well the game is played right off the desktop, doesnt take up a full screen or nothing. you can run multiple clients at once.

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

got it

Edited by YaBoy

Share this post


Link to post
Share on other sites

OMG so many unnecessary lines of code! :):D :D

Please replace this:

MouseMove(190,63)
MouseDown("left")
MouseUp("left")oÝ÷ Ùh­Øb±«­¢+Ù5½Õͱ¥¬ ÅÕ½Ðí±ÐÅÕ½Ðì°ÄäÀ°Ø̤

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

got it

Edited by YaBoy

Share this post


Link to post
Share on other sites

...Because PixelGetColor isnt working

Or something is not right about the PixelGetColor line that you have written. The script executes the lines after the WinWaitActive line (see below) within a fraction of a second. After the MouseUp, the script checks for the color, sees that it does not = "5987167" and skips to the EndIf. You are going to have to tell the script to wait between the MouseUp and the "If PixelGetColor" line.

WinWaitActive("Cave Entrance","")

MouseMove(190,63)

MouseDown("left")

MouseUp("left")

If PixelGetColor(505, 212) = "5987167" Then

Maybe a gamer can tell you how to debug your code, seeing the video did not help me any... or you might want to just play the game as a human. :-)


[size="1"][font="Arial"].[u].[/u][/font][/size]

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