Sign in to follow this  
Followers 0
UnknownWarrior

Pixel Based Help?

14 posts in this topic

Hey i dont know ANYTHING at all about pixel stuff, so i was wondering from scrap if you could help from the pic given:

http://img130.imageshack.us/my.php?image=helpic8dh.jpg

I want those faces on the right to do this example'my idea'': When the FIRST face disappears i want to send ctrl t, but you cannot do the face since there is many faces on my game... so if you could monitor the very bottom part of that yellow bar(there health bar) to the bottomest of it as u can for thef irst face, that would be great, and some how code that sad.gif i know how to do rest probably

Only thing i know how to do with my idea is Send(^t)

But i have no idea how to do any pixel stuff so if anyone needs the pixel coordniate or w/e tehre called, the pixel colored things from my game or something, i can get from whatever you ask me to :)

Share this post


Link to post
Share on other sites



You know... If you read the help file under all the Pixel() functions, you'd find that it is fairly easy to achieve an outcome. But it does require some work on your behalf other than a post in the forum. As your other threads have pointed out, effort is rewarded.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Yes i admit it, those others things i could ahve found out after a LONG time but seriously, pixel stuff i hate and will always hate, but my idea will make me popular through this one site, really popular, ican help but i just wont be able to figure it ALL out :)

Share this post


Link to post
Share on other sites

Bump :)

Share this post


Link to post
Share on other sites

Why don't you show SOMETHING you've done... like an effort? Regardless of fail or succeed, I'm sure someone is more apt to help someone that has put forth an effort rather than someone begging for scraps... Don't take this rudely (or do, I don't care either way), but I wouldn't lift a finger until you showed something other than

pixel stuff i hate and will always hate

... See what I'm saying?

If you have a question or a concern on a function, post that here, that's what this forum is... the "Support Forum", not the "Hey will you write me forum", that's at www.rentacoder.com I believe.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Believe Me smoke, ive tried and failed many times on pixel stuff, theres no point in showing you since i practically did nothing on succeeding at all with my idea since i dont UNDERSTAND pixel stuff in any way. I said ill help whoever wants to help me with whatever they need tehy can tell me what to do, and if you reallllly want me to show you what ive done youll laugh becuz it probably doesnt even revolve around my idea

I dont even know how to read the pixel colors and stuff :)

Edited by UnknownWarrior

Share this post


Link to post
Share on other sites

Just use Au3Info.exe, put your mouse over the location you want to check, and press ctrl+alt+f (pause the info). Then, you'll see PixelColor = 0xRRGGBB, where RR, GG, and BB are values from 00 to FF (hex values). Record that value, and use it.

If you really don't get it, look it up on the internet.

Hmm, now that I've written that I see how bad a description it is.. guess it's too simple to describe in more detail.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Thx green, i thought i would have to do something with PixelCheckSum, guess not lol, but how do i do it for it will read if a certain color goes away it will send a function?

What function should i use to use the pixel colors that ive gotten and etc? to read it then send my function?

Only good guess of mine is PixelCheckSum or PixelGetColor

Edited by UnknownWarrior

Share this post


Link to post
Share on other sites

Bump, green can you come help me quick :) i got my colors and everything rdy, i jsut ened to know what function that will do what i sed i wanted it to do in the above post

Share this post


Link to post
Share on other sites

Not sure what you're trying to do, but I can give you a very brief rundown of the functions and their uses.

PixelChecksum ( left, top, right, bottom [, step] )

This will generate a sum specific to the colors the the area specified. If you check the sum a second time and it is different than the first, you know at least 1 pixel has changed in that area.

PixelGetColor ( x , y )

Gets the pixel color at the location specified by x and y. The returned value is in decimal (which I find hard to use for colors), so use Hex($Color, 6) to get the hex value of the color.

PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] )

Search the specified area for a specific color (can be hex or decimal, but I suggest using hex). If the color is found, it returns an array of size 2 - the x coord of the color is array[0], and the y coord is array[1].

To find if a specific color is in a specific location, use PixelGetColor. To see if a color is in an area, use PixelSearch. To check if the yellow bar has changed size, you can use either PixelGetColor on both sides of the bar, or PixelCheckSum on the bar area to see if it is different from what you want.

Share this post


Link to post
Share on other sites

Ehhh this pixel stuff is confusing, can u just give me a small code to get me started for my tellow bar thing i want. If that yellow bar disappears i want it to send ^T

Send(^t) is all i know for now :) and the pixel stuff for the lowest part of bar is this...

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xFFFF00 Dec: 16776960

whatever that means can u help :mellow:

Share this post


Link to post
Share on other sites

No code from me, you can figure it out. You have everything you need, you just have to put it in writing.

Share this post


Link to post
Share on other sites

@UW: It isn't hard. if you can ride a bike, you can do this. The way to approach this is simply think step by step what you want to do. To get started, what you want to ask is this: What happens first? You want to get the window name.

1. get window name. - how do you get the window name? (hint - look in the help file)

write the code that gets the name and post it. I will help you, but you have to make a effort on your part first.

Share this post


Link to post
Share on other sites

Ehhh this pixel stuff is confusing, can u just give me a small code to get me started for my tellow bar thing i want. If that yellow bar disappears i want it to send ^T

Send(^t) is all i know for now :) and the pixel stuff for the lowest part of bar is this...

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xFFFF00 Dec: 16776960

whatever that means can u help :mellow:

1st: Send(^t) or Send('^t')?

2nd: You have to have Window location Coordinates along with the Hex Color.

So if I wanted to search an area on let's say WindowA << title, and I'm using Client Coords (AutoInfo.exe / Options / Coords / Client) I might do something like:

xy-----------------------

| |

| |

----------------------xy

Imagine the area above what I want to search:

Let's say that:

Top Left X = 0

Top Left Y = 0

Bottom Right X = 100

Bottom Right Y = 200

; We got these coords using AutoInfo for the area we want to search.

Opt('MouseCoordMode', 2); using 2 because using client coords
Opt('PixelCoordMode', 2); using 2 because using client coords
Local $Window2Search = 'WindowA'
Local $TopLeftX = 0
Local $TopLeftY = 0
Local $BottomRightX = 100
Local $BottomRightY = 200
Local $Color = 0xFFFF00

While 1
    If Not WinActive($Window2Search) Then WinActivate($Window2Search)
    $PixSearch = PixelSearch($TopLeftX, $TopLeftY, $BottomRightX, $BottomRightY, $Color)
    If Not @error And IsArray($PixSearch) Then
        MsgBox(0, 'Info', 'The Color was found at X: ' & $PixSearch[0] & ' Y: ' & $PixSearch[1])
    EndIf
    Sleep(10)
WEnd

There is an example using PixelSearch, but most of that can be integrated with all the Pixel Functions


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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