Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap('top')
- m.setTextScale(1)
- m.setCursorPos(1,1)
- m.setBackgroundColor(colors.black)
- m.clear()
- --ColoneA = 2
- --ColoneB = 17
- Ligne = {3,7,11,15,19,23}
- EMC = 10
- RYG = {} -- table de couleur 1 - 100%
- --print("la base")
- function def()
- --print("def")
- plage(RYG,1,20,colors.red)
- plage(RYG,21,70,colors.yellow)
- plage(RYG,71,100,colors,green)
- RYG = {} --table de couleur 1 - 100%
- Tab = {}
- ta = {}
- Box= {
- A = {},
- B = {}
- }
- end
- function
- for i = 1, 6 do
- Box.A[i] = {X = 2, Y = Ligne[i]}
- Box.B[i] = {X = 17, Y = Ligne[i]}
- end
- end
- function Box(box,color)
- m.setBackgroundColor(color)
- for i = box.X, box.X+11 do
- for u = box.Y,box.Y+3 do
- m.setCursorPos(i,u)
- m.write(" ")
- end
- end
- m.setBackgroundColor(colors.black)
- end
- function Table(ta,x,y,text,color_text,color_fond)
- --print("Table")
- ta = {PosX = x,PosY = y,Text = text,Color_Text = color_text,Color_Fond = color_fond}
- return(ta)
- end
- function plage(ta,min,max,element)
- --print("plage")
- for i = min,max do
- ta[i] = element
- end
- end
- function PrintM (tab)
- --print(tab.Color_Text)
- m.setTextColor(tab.Color_Text)
- m.setBackgroundColor(tab.Color_Fond)
- --print("test")
- m.setCursorPos(tab.PosX,tab.PosY)
- m.write(tab.Text)
- end
- --################# MAIN CODE ##########################
- repeat
- def()
- EMC = EMC + 1
- Box(Box.A[1],colors.blue)
- Tab.Titre = Table(Tab.Titre,ColoneA+5,Ligne[1].Y+1,"main",colors.red,colors.white)
- Tab.RF = Table(Tab.RF, Box.B[2].X,Box.B[2].Y,EMC,colors.yellow,colors.blue)
- PrintM(Tab.Titre)
- PrintM(Tab.RF)
- sleep(1)
- until EMC > 100
- --m.clear()
- --m.setCursorPos(1,1)
- --m.setTextScale(4)
- --m.setTextColor(colors.red)
- --m.write('ya un blem mon gars')
Add Comment
Please, Sign In to add comment