ID:263782
 
Code:
mob
Click(location,control,params)
var/p[] = params2list(params)
var/py = p["icon-x"]
var/px = p["icon-y"]
var/icon/palette = new(icon)
usr << "[palette.GetPixel(px,py)] (color)"


Problem description: When clicking a mob, GetPixel() doesn't send the rgb value in px,py. Am I using the this proc correctly?

What exactly are you tying to accomplish? In the DM Ref. it says that it returns the color value of the pixel in location(px,py) in the icon.
GetPixel() doesn't return a pixel or any icons. It returns the color in hex code, I think.
In response to Kakashi24142
In the DM Ref. it says that it returns the color value of the pixel in location(px,py) in the icon.

Exactly. But, as I said, no color is outputted when I click on a mob (with an icon).
In response to DivineO'peanut
Ah, I see what you mean. I tried out the code and it seemed ot have returned null for some odd reason. Maybe this is a bug?
Please? I really need this problem solved!
Are you specifying an icon state for new/icon()? If the icon has an icon state with a null label then you don't need to.

Also, where you're clicking on the mob could be mask in the palette icon. If it is, then GetPixel() will return null.
In response to D4RK3 54B3R
The icon has an icon state with a null label, and I specified where I was clicking using the px/py variables. I don't think the location is masked because the icon is the same icon the mob uses, and even when the icon is displayed on something the value returned is still null. :-/
Oh please? It can't be that hard!