1bitconverter.dm:14:error:GetPixel:undefined proc
1bitconverter.dm:15:error:r:undefined var
1bitconverter.dm:15:error:g:undefined var
1bitconverter.dm:15:error:b:undefined var
1bitconverter.dm:16:error:rgb:undefined var
1bitconverter.dm:16:error:SwapColor:undefined proc
1bitconverter.dm:18:error:rgb:undefined var
1bitconverter.dm:18:error:SwapColor:undefined proc
1bitconverter.dm:3::warning: operation has no effect here
What im trying to do, is if the pixel is darker than half, then it turns black, else it turns white. And to call the for every pixel in your icon. What the effect is, im trying to get a 1-bit icon convereter to turn a regular icon, into well a 1-bit icon. I ddi it by hand by checking the colors hues here:
And heres the code:
mob/verb/Convert()
src.icon='1-bit.dmi'
src.Converter()
mob/var
X=1
Y=1
numba=1
mob/proc/Converter()
src.icon='1-bit.dmi'
X=1
Y=1
numba=1
Loop
GetPixel(X,Y,null,dir=0,frame=1,moving=0)
if(30*r+59*g+11*b > 7650)
SwapColor(rgb,0,0,0)
else
SwapColor(rgb,255,255,255)
if(numba>=32)
Y+=1
numba=1
goto Loop
numba+=1
X=numba
goto Loop
Except I wouldn't really know, because no one knows how to use it anyways. And you can replace "Loop" with a while() loop. goto Labels in here are unnecessary.
You could always just change the icon/icon_state instead of doing all this complicated stuff.