Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variables primaires
- local bleu, vert, jaune, rouge, gris, blanc, lvert, orange, marron, noir, lbleu = colors.lightBlue, colors.green, colors.yellow, colors.red, colors.lightGray, colors.white, colors.lime, colors.orange, colors.brown, colors.black, colors.lightBlue
- local functionOn = 0
- local function text(texte, couleur)
- term.setTextColor(couleur)
- write(texte)
- end
- local function SwitchT(temps)
- if temps >= 7 and temps <= 18 then
- return true
- else
- return false
- end
- end
- local function Start()
- -- Positionnement Programmes
- for x=1,9 do
- for y=1,6 do
- paintutils.drawPixel(x, y, jaune)
- end
- end
- for x=10,18 do
- for y=1,6 do
- paintutils.drawPixel(x, y, lvert)
- end
- end
- for x=1,9 do
- for y=7,12 do
- paintutils.drawPixel(x, y, orange)
- end
- end
- for x=10,18 do
- for y=7,12 do
- paintutils.drawPixel(x, y, blanc)
- end
- end
- -- Noms programmes
- term.setTextColor(noir) --Ne pas toucher
- -- Temps
- term.setBackgroundColor(jaune)
- term.setCursorPos(3,3)
- write("Temps")
- -- Liquide
- term.setTextColor(lbleu)
- term.setBackgroundColor(lvert)
- term.setCursorPos(11,3)
- write("Liquide")
- -- Energie
- term.setTextColor(rouge)
- term.setBackgroundColor(orange)
- term.setCursorPos(2,9)
- write("Energie")
- term.setTextColor(noir)
- -- Infos
- term.setBackgroundColor(blanc)
- term.setCursorPos(12,9)
- write("Infos")
- local bc1 = false
- while bc1 == false do
- local event, button, xpos, ypos = os.pullEvent("monitor_touch")
- if (xpos >= 1 and xpos <= 9) and (ypos >= 1 and ypos <=6) then
- functionOn = 1
- bc1 = true
- elseif (xpos >= 10 and xpos <= 18 and ypos >= 1 and ypos <=6) then
- functionOn = 2
- bc1 = true
- end
- end
- end
- local function Temps() -- Programme du Temps
- local day = os.day()
- local times = os.time()
- local time = textutils.formatTime(times, true)
- term.setBackgroundColor(blanc)
- term.clear()
- term.setCursorPos(4,3)
- text("Il est ", bleu)
- text(time, vert)
- term.setCursorPos(4,5)
- text(" le ", bleu)
- text(day, orange)
- if SwitchT(os.time()) then
- for x=14,17 do
- for y=2,5 do
- paintutils.drawPixel(x, y, jaune)
- end
- end
- else
- for x=14,17 do
- for y=2,5 do
- paintutils.drawPixel(x, y, noir)
- end
- end
- paintutils.drawPixel(14, 2, blanc)
- paintutils.drawPixel(15, 2, gris)
- paintutils.drawPixel(14, 3, gris)
- paintutils.drawPixel(15, 3, gris)
- end
- for x=1,4 do
- for y=9,12 do
- paintutils.drawPixel(x, y, blanc)
- end
- end
- for x=5,8 do
- for y=9,12 do
- paintutils.drawPixel(x, y, lvert)
- end
- end
- sleep(0.7)
- end
- -- Boucle Start
- while true do
- if functionOn == 0 then
- Start()
- elseif functionOn == 1 then
- Temps()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement