Sign in to follow this  
Followers 0
kindlin

PixelGetColor/Active Window Info not getting right color

10 posts in this topic

#1 ·  Posted (edited)

I'm trying to make a little bot for Diablo 2 and I'm having an issue with one part of it.

When not in an actual game or the loading screen up to it (at the start screen, account screen, char select screen, or lobby) PixelGetColor and Active Window Info mess up.

Active window Info, if you hover the mouse over any single pixel for more then a fraction of a second(sometimes a very very small fraction of a second, if not instantaneously) the "dec" color reads off as 1842204 instead of the actual color, no mater what the actual color is or even if the pixel changes color (like the moving fire that the title is engulfed in). At first I didn't even notice this because i only checked a few choice pixels to get the information i wanted. Then I noticed that all the pixels I just checked, even though one was gold, one dark, and one straight black, where all the same dec color. When I tried PixelGetColor is always always read back 1842204 too, even on the pixels that for a split second would show there real color.

I tried moving the mouse there and watching as the active window info showed the correct dec for a second and simultaniously doing the PixelGetColor

Mousemove("500,442,0") ; i tried it with and without instant movement, no difference

Mousemove("599,442,0") ; i also tried all different combinations of pixels it could go to or whatnot. no difference.

$i=PixelGetColor(599,442) ; i tried doing 2 PixelGetColor's after each other in differnt orders and all that. no difference

Send("^!f") ; this did infact show the true color as 8684676

If $i=8684676 then MsgBox(4096,"worked?","IT WORKED") ; 8684676 was the color window info would display for about .1 seconds

If $i=1842204 then MsgBox(4096,"worked?","nope....") ; before reverting to 1842204

Not once did I get an IT WORKED, unfortunately. Then I thought, maybe its the programing of the something else. So I took a screen shot, figuring that if the computer actually did think it would all be the same color the SS would be 1 color. But the SS was as vibrant as it looked on my screen and when mousing over the SS with active window view I got the correct colors too.

I was able to work around not being able to get a color in everything besides one thing, where I cant think of any way I could get around this.

If one of you know a command that will say if I can or can not type (if it the thing opens, I have a pane to type in, if it doesn't open I have non) then that would work to. Ether that or a fix to this very annoying thing.

If I can't find a fix for this then I'm going to have an incomplete bot that will mess up whenever the thing doesn't load right (1 in 25?).

PS: how do I make my code all special and stuff like I've seen other people do.

EDIT: I need to test this, but I might not be able to do this at all if I cant fix this the weird color thing. How disappointing.

Edited by kindlin

Share this post


Link to post
Share on other sites



So apparently I can't edit twice, so I'll just post a reply. (i was just gonna add a simple "edit2:")

I'm posting this in the bu forum too because I don't know where it truly belongs, and 2 posts = twice the chance of getting help, right?

Share this post


Link to post
Share on other sites

So apparently I can't edit twice, so I'll just post a reply. (i was just gonna add a simple "edit2:")

I'm posting this in the bu forum too because I don't know where it truly belongs, and 2 posts = twice the chance of getting help, right?

Wrong, wrong and well, wrong.

First wrong: :: waves hand :: "This is not the support forum you're looking for." This is for AutoItX, you're not using AutoItX.

Second wrong: Double posting. Just plain stupid is what it is. Nobody likes it, don't do it. It confuses you when you have to check two threads. It splits any useful information up. It confuses people when they answer a question and then find the same question from the same person again.

Third wrong: You posted in the Bug Reports forum with something that is not an AutoIt bug.

Fourth wrong (unannounced): You can edit a post as many times as you want.

I'm going to move this to the proper forum and delete the one in Bug Reports.

Share this post


Link to post
Share on other sites

Wrong, wrong and well, wrong.

First wrong: :: waves hand :: "This is not the support forum you're looking for." This is for AutoItX, you're not using AutoItX.

Second wrong: Double posting. Just plain stupid is what it is. Nobody likes it, don't do it. It confuses you when you have to check two threads. It splits any useful information up. It confuses people when they answer a question and then find the same question from the same person again.

Third wrong: You posted in the Bug Reports forum with something that is not an AutoIt bug.

Fourth wrong (unannounced): You can edit a post as many times as you want.

I'm going to move this to the proper forum and delete the one in Bug Reports.

1) I'm sorry, I guess didn't see the other forum :P

2)Good points, sorry about that too. I just didn't know which i should put it in because I need help.

3)And I put it in the bug forum because it IS "buggy." Just not sure what program is going buggy.

4)The edit button disappeared, and yes I am logged in, thats the first thing I checked. Its just gone. Maybe it teleported somewhere without me noticing it there.

Share this post


Link to post
Share on other sites

Does anybody have any idea whats causing this or how to fix it? Or maybe even an idea of how I would figure out how to fix it?

Share this post


Link to post
Share on other sites

I am having the same problem inside a poker client. The values of PixelGetColor do not match the values displayed in the Active Window Info. Is there a solution for this?... or are there just some graphics that AutoIt does not work with?

Share this post


Link to post
Share on other sites

Did you try to use the other color setting in the window info tool?

I tried both RGB and BGR mode.

One other thing that may be related to this: There is a scroll screen with lines of text describing the available poker tables. When you click on a line, the line becomes highlighted and the Window Info tool sees "some" of the highlighted text under "Visible Window Text". The text that it does not see is also in the area that Pixelgetcolor seems to always see as white (even though it is not).

Share this post


Link to post
Share on other sites

hey,

ive done some d2 bots too and must say that game is perfect for autoit bots^^

when ur on the lobby screen or char screen u do not need pixel search. it wont work because colors change a little over time.(due to fire on the D2 logo on the main screen for example)so u would need to use a wider shading range when doing pixel search or just not use pixelsearch at all. since all screens but the "actual-game-one" are static and do not change, u can just get the x and y coordinates, save them to mouse move + click and thats it. ingame the pixelsearch function works fine and u can/should use it.

hope i could help u. if not or u have further questions, do n0ot hestitate to PM me...

Zephir.

Share this post


Link to post
Share on other sites

I am having the same problem inside a poker client. The values of PixelGetColor do not match the values displayed in the Active Window Info. Is there a solution for this?... or are there just some graphics that AutoIt does not work with?

I figured it out. I was using mousecoordmode instead of pixelcoordmode.

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