m = wrap("monitor")
term.redirect(m)
function colorScreen(color)
for a = 0,59 do
for b = 0,19 do
paintutils.drawPixel(a,b,color)
end
end
end
function setScreen(color)
local s = {}
for i =1,51 do
s[i] = {}
for j =1,19 do
s[i][j] = color
end
end
return s
end
shell.run("clear")
local screen = setScreen(16)
local color = {1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768}
local i = 1
while true do
paintutils.drawPixel(1,1,color[i])
event,value,x,y = os.pullEvent()
if event == "mouse_click" or event == "mouse_drag" then
if value == 1 then
screen[x][y] = i
paintutils.drawPixel(x,y,color[i])
elseif value == 2 then
i = screen[x][y]
end
elseif event == "mouse_scroll" then
i = i + value
if i < 1 then i = 1
elseif i > 16 then i = 16 end
elseif event == "key" then
if value == 46 then -- Lettre C
colorScreen(32768)
screen = setScreen(16)
elseif value == 47 then -- Lettre V
colorScreen(color[i])
screen = setScreen(i) shestartup
elseif value == 20 then --Lettre T
break
end
end
end
colorScreen(32768)
shell.run("clear")
HELP I DONT UNDERTSAND what i did wrong
[Tasteful editing, and code tags added -Cranium]