Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Ce programme [cree pas TriiNoxYs] est libre de droits ;)
- -- Si vous le modifier/publiez/presentez/etc, SVP pensez a citer son auteur.
- -- Consultez tout les autres scripts de TriiNoxys sur le lien pastein.com/benjfn71
- -- Ou sur la page de TriiNoxYs: pastebin.com/u/TriiNoxYs
- -- COMMANDES:
- -- Molette de souris: Selectionner la couleur
- -- Clic Gauche: Colorier
- -- Clic Droit: Copier une couleur
- -- C: Tout effacer
- -- V: Colorier de la couleur selectionner
- -- T: Fermer
- 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)
- elseif value == 20 then --Lettre T
- break
- end
- end
- end
- colorScreen(32768)
- shell.run("clear")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement