Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sides = { "top", "bottom", "left", "right", "front", "back" }
- for i = 1, #sides do
- if peripheral.isPresent(sides[i]) then
- if peripheral.getType(sides[i]) == "openperipheral_bridge" then
- glass = peripheral.wrap(sides[i])
- elseif peripheral.getType(sides[i]) == "WebScreen" then
- ecran = peripheral.wrap(sides[i])
- end
- end
- end
- setcolor = ""
- timetotal = ""
- webData = ""
- Ordre = ""
- titre = ""
- premierordre = false
- decalage = 0
- etaterreur = false
- if fs.exists("config-s8UqqBJy") == false then
- local random = math.random(0,100000)
- os.setComputerLabel("WebDisplayYt"..random)
- temporaire = fs.open("config-s8UqqBJy","w")
- temporaire.writeLine("WebDisplayYt"..random)
- temporaire.close()
- temporaire = fs.open("startup","w")
- temporaire.write('while true do shell.run("pastebin run s8UqqBJy") end')
- temporaire.close()
- temporaire = fs.open("log-s8UqqBJy","w")
- temporaire.writeLine("reboot auto")
- temporaire.close()
- os.reboot()
- end
- -- Function de base ------
- function setbackground()
- local mainBox = glass.addBox(20, 20, 1, 48, 0xa0a0a0, 0.7)
- local outlineT = glass.addBox(18,18,2,2,setcolor,0.7)
- local outlineB = glass.addBox(18,68,2,2,setcolor,0.7)
- mainBox.setWidth(136)
- outlineT.setWidth(140)
- outlineB.setWidth(140)
- mainBox.setHeight(48)
- end
- function geturl(url, noCancel)
- http.request(url)
- while true do
- local e, rUrl, rmsg = os.pullEvent()
- if (e == "http_success") and (rUrl == url) then
- if rmsg then
- local data = rmsg.readAll()
- rmsg.close()
- if data then
- return "success", data
- else
- sleep(1)
- http.request(url)
- end
- else
- sleep(1)
- http.request(url)
- end
- elseif (e == "http_failure") and (rUrl == url) then
- return "failure"
- elseif (e == "chat_command") and ((trimText(rUrl:lower()) == "cancel") or (trimText(rUrl:lower()) == "home")) and not(noCancel) then
- return "cancel"
- end
- end
- end
- function centerText(text, object, scalelen)
- object.setScale(1)
- object.setX(math.ceil(((136-22)/2)-(string.len(text)*scalelen)))
- object.setText(text)
- object.setScale(scalelen)
- end
- ------ Init ------
- while ecran.isLinked() == false do
- glass.clear()
- setcolor = 0xff0000
- setbackground()
- local header = glass.addText(75,25,"Ecran No", setcolor)
- header.setScale(2)
- centerText("Ecran No", header, 2)
- local header2 = glass.addText(53,48,"Linked", setcolor)
- header2.setScale(2)
- centerText("Linked", header2, 2)
- glass.sync()
- end
- glass.clear()
- setcolor = 0xffff4d
- setbackground()
- local header = glass.addText(75,25,"En Attente", setcolor)
- header.setScale(2)
- centerText("En Attente", header, 2)
- local header2 = glass.addText(53,48,"$$link youtube", setcolor)
- header2.setScale(1)
- centerText("$$link youtube", header2, 1)
- ecran.setUrl("http://youtube.com/embed/")
- glass.sync()
- config = {}
- getconfig = fs.open("config-s8UqqBJy","r")
- config["label"] = getconfig.readLine()
- config["getAuto"] = getconfig.readLine()
- if config["getAuto"] == "Repeat activer" then
- config["playlist"] = getconfig.readLine()
- config["idvideo"] = getconfig.readLine()
- if config["playlist"] == "true" then
- playlists = {}
- playlistactuel = 1
- idPlaylist = ""
- idPlaylist = Ordre:match([[https://www.youtube.com/playlist%?list=([^>]+)]])
- resp, webData = geturl("https://www.youtube.com/playlist?list="..idPlaylist, true)
- for w in string.gmatch(webData, '<a class=%"pl%-video%-title%-link yt%-uix%-tile%-link yt%-uix%-sessionlink spf%-link %" dir=%"ltr%" href=%"%/watch%?v=([^>]+)%&list=') do
- playlists[playlistactuel] = w
- playlistactuel = playlistactuel+1
- end
- for v,idvideo in pairs(playlists) do
- playlistmax = v
- end
- playlistactuel = 1
- idvideo = playlists[1]
- else
- idvideo = config["idvideo"]
- end
- ecran.setUrl("http://youtube.com/embed/"..idvideo.."?controls=0")
- resp, webData = geturl("https://www.youtube.com/watch?v="..idvideo, true)
- titre = webData:match([[<title>([^>]+) %- YouTube</title>]])
- print("test1")
- idvideoo = idvideo
- if string.find(idvideoo,"-") == 1 then
- print("test2")
- idvideoo = string.sub(idvideoo,2)
- print("test3")
- resp, webData = geturl("https://www.youtube.com/results?search_query="..idvideoo, true);
- print("test4")
- else
- resp, webData = geturl("https://www.youtube.com/results?search_query="..idvideoo, true);
- print("test5")
- end
- timetotal = webData:match([[<span class=%"video%-time%" aria%-hidden=%"true%">([^>]+)</span></a>]])
- print("test6")
- timerRestart = true
- premierordre = true
- decalage = 0
- sleep(1)
- ecran.click(0.5555,0.5555)
- setcolor = 0x00ff00
- etat = "Repeat On"
- else
- etat = "En Attente"
- setcolor = 0xffff4d
- end
- getconfig.close()
- -- Gestion D'ordre -------
- function getordre()
- while true do
- getordree()
- end
- end
- function getordree()
- while true do
- event,face,pseudo,uuid,Ordre = os.pullEvent("glasses_chat_command")
- if Ordre == "reboot" or Ordre == "restart" then
- log(pseudo.." > a demander un redemarage")
- os.reboot()
- elseif Ordre == "shutdown" then
- ecran.setUrl("about:blank")
- glass.clear()
- glass.sync()
- log(pseudo.." > a demander un arret")
- os.shutdown()
- elseif Ordre == "start" or Ordre == "pause" then
- ecran.click(0.5555,0.5555)
- if idvideo == nil then
- return getordre
- end
- if etat == "En Cour" then
- etat = "En Pause"
- setcolor = 0xff5500
- log(pseudo.." > a mis en pause la lecture")
- else
- etat = "En Cour"
- setcolor = 0x00ff00
- log(pseudo.." > a demarrer la lecture")
- end
- elseif Ordre.find(Ordre,"youtube") ~= nil then
- setcolor = 0xffff4d
- if string.find(Ordre,"watch") ~= nil then
- if string.find(Ordre,"list") ~= nil then
- playlist = true
- playlists = {}
- v = 1
- idvideo = Ordre:match('https://www.youtube.com/watch%?v=([^>]+)%&')
- if string.find(Ordre,"index") then
- idvideo = Ordre:match('https://www.youtube.com/watch%?v=([^>]+)%&index')
- playlistactuel = tonumber(Ordre:match('https://www.youtube.com/watch%?v='..idvideo..'%&index=([^>]+)&'))
- print(playlistactuel)
- print(idvideo)
- idPlaylist = Ordre:match('https://www.youtube.com/watch%?v='..idvideo..'%&index='..playlistactuel..'%&list=([^>]+)')
- else
- playlistactuel = 1
- idvideo = Ordre:match('https://www.youtube.com/watch%?v=([^>]+)%&')
- idPlaylist = Ordre:match('https://www.youtube.com/watch%?v='..idvideo..'%&list=([^>]+)')
- end
- resp, webData = geturl("https://www.youtube.com/playlist?list="..playlistactuel, true)
- titreplaylist = webData:match([[<title>([^>]+) %- YouTube</title>]])
- for w in string.gmatch(webData, '<a class=%"pl%-video%-title%-link yt%-uix%-tile%-link yt%-uix%-sessionlink spf%-link %" dir=%"ltr%" href=%"%/watch%?v=([^>]+)%&list=') do
- playlists[v] = w
- v = v+1
- end
- for v,idvideo in pairs(playlists) do
- playlistmax = v
- end
- idvideo = playlists[playlistactuel]
- else
- idvideo = Ordre:match([[https://www.youtube.com/watch%?v=([^>]+)]])
- playlist = false
- end
- elseif string.find(Ordre,"embed") ~= nil then
- idvideo = Ordre:match([[https://www.youtube.com/embed/([^>]+)]])
- playlist = false
- elseif string.find(Ordre,"playlist") ~= nil then
- playlist = true
- playlists = {}
- playlistactuel = 1
- idPlaylist = Ordre:match([[https://www.youtube.com/playlist%?list=([^>]+)]])
- resp, webData = geturl("https://www.youtube.com/playlist?list="..idPlaylist, true)
- titreplaylist = webData:match([[<title>([^>]+) %- YouTube</title>]])
- for w in string.gmatch(webData, '<a class=%"pl%-video%-title%-link yt%-uix%-tile%-link yt%-uix%-sessionlink spf%-link %" dir=%"ltr%" href=%"%/watch%?v=([^>]+)%&list=') do
- playlists[playlistactuel] = w
- playlistactuel = playlistactuel+1
- end
- for v,idvideo in pairs(playlists) do
- playlistmax = v
- end
- playlistactuel = 1
- idvideo = playlists[1]
- else
- erreur("URL Invalide",pseudo,Ordre)
- return
- end
- ecran.setUrl("http://youtube.com/embed/"..idvideo.."?controls=0")
- resp, webData = geturl("https://www.youtube.com/watch?v="..idvideo, true)
- titre = webData:match([[<title>([^>]+) %- YouTube</title>]])
- if string.find(idvideo,"-") == 1 then
- idvideoo = string.sub(idvideo,2)
- resp, webData = geturl("https://www.youtube.com/results?search_query="..idvideoo, true);
- else
- resp, webData = geturl("https://www.youtube.com/results?search_query="..idvideo, true);
- end
- timetotal = webData:match([[<span class=%"video%-time%" aria%-hidden=%"true%">([^>]+)</span></a>]])
- timerRestart = true
- premierordre = true
- decalage = 0
- if playlist == true then
- log(pseudo.." > "..titre.." - "..timetotal)
- else
- log(pseudo.." > "..titre.." - "..timetotal)
- end
- setconfig = fs.open("config-s8UqqBJy","w")
- setconfig.writeLine(config["label"])
- setconfig.close()
- etat = "En Attente"
- elseif Ordre == "auto" then
- ecran.setUrl("http://youtube.com/tv#/settings")
- ecran.click(0.5555,0.5555)
- glass.clear()
- glass.sync()
- elseif Ordre == "repeat" then
- if etat == "Repeat On" then
- setconfig = fs.open("config-s8UqqBJy","w")
- setconfig.writeLine(config["label"])
- setconfig.close()
- etat = "En Cour"
- elseif etat == "En Cour" then
- if playlist == true then
- setconfig = fs.open("config-s8UqqBJy","a")
- setconfig.writeLine("Repeat activer")
- setconfig.writeLine(true)
- setconfig.writeLine(idPlaylist)
- setconfig.close()
- etat = "Repeat On"
- else
- setconfig = fs.open("config-s8UqqBJy","a")
- setconfig.writeLine("Repeat activer")
- setconfig.writeLine(false)
- setconfig.writeLine(idvideo)
- setconfig.close()
- etat = "Repeat On"
- end
- else
- erreur("Erreur repeat",pseudo,Ordre)
- end
- elseif Ordre == "next" then
- playlistactuel = playlistactuel+1
- idvideo = playlists[playlistactuel]
- ecran.setUrl("http://youtube.com/embed/"..idvideo.."?controls=0")
- resp, webData = geturl("https://www.youtube.com/watch?v="..idvideo, true)
- titre = webData:match([[<title>([^>]+) %- YouTube</title>]])
- if string.find(idvideo,"-") == 1 then
- idvideoo = string.sub(idvideo,2)
- resp, webData = geturl("https://www.youtube.com/results?search_query="..idvideoo, true);
- else
- resp, webData = geturl("https://www.youtube.com/results?search_query="..idvideo, true);
- end
- timetotal = webData:match([[<span class=%"video%-time%" aria%-hidden=%"true%">([^>]+)</span></a>]])
- timerRestart = true
- premierordre = true
- decalage = 0
- sleep(5)
- ecran.click(0.5555,0.5555)
- elseif string.find(Ordre,"goto") ~= nil then
- playlistactuel = Ordre:match([[goto ([^>]+)]])
- idvideo = playlists[playlistactuel]
- write(idvideo..">"..playlistactuel) sleep(2)
- ecran.setUrl("http://youtube.com/embed/"..idvideo.."?controls=0")
- resp, webData = geturl("https://www.youtube.com/watch?v="..idvideo, true)
- titre = webData:match([[<title>([^>]+) %- YouTube</title>]])
- if string.find(idvideo,"-") == 1 then
- idvideoo = string.sub(idvideo,2)
- resp, webData = geturl("https://www.youtube.com/results?search_query="..idvideoo, true);
- else
- resp, webData = geturl("https://www.youtube.com/results?search_query="..idvideo, true);
- end
- timetotal = webData:match([[<span class=%"video%-time%" aria%-hidden=%"true%">([^>]+)</span></a>]])
- timerRestart = true
- premierordre = true
- decalage = 0
- sleep(5)
- ecran.click(0.5555,0.5555)
- else
- erreur("Command Invalide",pseudo,Ordre)
- end
- end
- end
- -- update ------
- function updatetime()
- heures = 0
- minutes = 0
- secondes = 0
- timer = ""
- while true do
- if etat == "En Cour" or etat == "Repeat On" then
- if timerRestart == true then
- timerRestart = false
- secondes = 0
- minutes = 0
- heures = 0
- end
- if timer == timetotal then
- heures = 0
- minutes = 0
- secondes = 0
- timer = ""
- if playlist == true then
- playlistactuel = playlistactuel+1
- end
- if etat == "Repeat On" then
- if playlist == true then
- if tonumber(playlistactuel) <= tonumber(playlistmax) then
- idvideo = playlists[tonumber(playlistactuel)]
- ecran.setUrl("http://youtube.com/embed/"..idvideo.."?controls=0")
- resp, webData = geturl("https://www.youtube.com/watch?v="..idvideo, true)
- titre = webData:match([[<title>([^>]+) %- YouTube</title>]])
- if string.find(idvideo,"-") == 1 then
- idvideoo = string.sub(idvideo,2)
- resp, webData = geturl("https://www.youtube.com/results?search_query="..idvideoo, true);
- else
- resp, webData = geturl("https://www.youtube.com/results?search_query="..idvideo, true);
- end
- timetotal = webData:match([[<span class=%"video%-time%" aria%-hidden=%"true%">([^>]+)</span></a>]])
- sleep(5)
- ecran.click(0.5555,0.5555)
- timerRestart = true
- else
- playlistactuel = 1
- idvideo = playlists[tonumber(playlistactuel)]
- ecran.setUrl("http://youtube.com/embed/"..idvideo.."?controls=0")
- resp, webData = geturl("https://www.youtube.com/watch?v="..idvideo, true)
- titre = webData:match([[<title>([^>]+) %- YouTube</title>]])
- if string.find(idvideo,"-") == 1 then
- idvideoo = string.sub(idvideo,2)
- resp, webData = geturl("https://www.youtube.com/results?search_query="..idvideoo, true);
- else
- resp, webData = geturl("https://www.youtube.com/results?search_query="..idvideo, true);
- end
- timetotal = webData:match([[<span class=%"video%-time%" aria%-hidden=%"true%">([^>]+)</span></a>]])
- sleep(5)
- ecran.click(0.5555,0.5555)
- timerRestart = true
- end
- else
- ecran.setUrl("http://youtube.com/embed/"..idvideo.."?controls=0")
- sleep(5)
- ecran.click(0.5555,0.5555)
- timerRestart = true
- end
- elseif playlist == true then
- if playlistactuel <= tonumber(playlistmax) then
- idvideo = playlists[playlistactuel]
- ecran.setUrl("http://youtube.com/embed/"..idvideo.."?controls=0")
- resp, webData = geturl("https://www.youtube.com/watch?v="..idvideo, true)
- titre = ""
- timetotal = ""
- titre = webData:match([[<title>([^>]+) %- YouTube</title>]])
- if string.find(idvideo,"-") == 1 then
- idvideoo = string.sub(idvideo,2)
- resp, webData = geturl("https://www.youtube.com/results?search_query="..idvideoo, true);
- else
- resp, webData = geturl("https://www.youtube.com/results?search_query="..idvideo, true);
- end
- timetotal = webData:match([[<span class=%"video%-time%" aria%-hidden=%"true%">([^>]+)</span></a>]])
- sleep(5)
- ecran.click(0.5555,0.5555)
- timerRestart = true
- end
- else
- etat = "En Attente"
- setcolor = 0xffff4d
- timerRestart = true
- end
- else
- if secondes == 60 then
- minutes = minutes+1
- secondes = 0
- end
- if secondes <= 9 then
- fsecondes = "0"..secondes
- else
- fsecondes = secondes
- end
- if minutes == 60 then
- heures = heures+1
- minutes = 0
- end
- if heures >= 1 then
- timer = heures..":"..minutes..":"..fsecondes
- else
- timer = minutes..":"..fsecondes
- end
- secondes = secondes+1
- end
- end
- sleep(1)
- end
- end
- function titledefile(titree)
- if titree.len(titree) <= 20 then
- return titree
- else
- titlelen = string.len(titree)
- if decalage == titlelen-20 then
- titlesave = titree
- titletemp = titlesave.." | "..titlesave
- elseif decalage <= titlelen-21 then
- titletemp = titree
- end
- titlefinal = titletemp.sub(titletemp, decalage, decalage+20)
- decalage = decalage + 1
- if decalage == titlelen then
- decalage = 0
- titletemp = titree
- end
- return titlefinal
- end
- end
- -- Affichage ------
- function Affichage()
- header1 = nil
- header2 = nil
- header3 = nil
- while true do
- if etaterreur ~= true then
- if etat == "En Cour" then
- glass.clear()
- setbackground()
- if playlist == true then
- headerplaylist = glass.addText(50,40,"("..playlistactuel.."/"..playlistmax..")", setcolor)
- centerText("("..playlistactuel.."/"..playlistmax..")", headerplaylist, 1)
- end
- header1 = glass.addText(50,25,"En Cour", setcolor)
- centerText("En Cour", header1, 2)
- header2 = glass.addText(30,48,titledefile(titre), setcolor)
- header3 = glass.addText(30,58,timer.."/"..timetotal, setcolor)
- header4 = glass.addText(145,49,"β", 0xff0000)
- header4.setScale(3)
- centerText(titledefile(titre), header2, 1)
- centerText(timer.."/"..timetotal, header3, 1)
- glass.sync()
- elseif etat == "En Attente" then
- if premierordre == true then
- glass.clear()
- setbackground()
- if playlist == true then
- headerplaylist = glass.addText(50,40,"("..playlistactuel.."/"..playlistmax..")", setcolor)
- centerText("("..playlistactuel.."/"..playlistmax..")", headerplaylist, 1)
- end
- header1 = glass.addText(50,25,"En Attente", setcolor)
- centerText("En Attente", header1, 2)
- header2 = glass.addText(30,48,titledefile(titre), setcolor)
- header3 = glass.addText(30,58,"0:00/"..timetotal, setcolor)
- header4 = glass.addText(145,49,"β", 0xff0000)
- header4.setScale(3)
- centerText(titledefile(titre), header2, 1)
- centerText("0:00/"..timetotal, header3, 1)
- glass.sync()
- else
- glass.clear()
- setcolor = 0xffff4d
- setbackground()
- local header1 = glass.addText(75,25,"En Attente", setcolor)
- centerText("En Attente", header1, 2)
- local header2 = glass.addText(53,48,"$$link youtube", setcolor)
- centerText("$$link youtube", header2, 1)
- glass.sync()
- end
- elseif etat == "En Pause" then
- glass.clear()
- setbackground()
- if playlist == true then
- headerplaylist = glass.addText(50,40,"("..playlistactuel.."/"..playlistmax..")", setcolor)
- centerText("("..playlistactuel.."/"..playlistmax..")", headerplaylist, 1)
- end
- header1 = glass.addText(50,25,"En Pause", setcolor)
- centerText("En Pause", header1, 2)
- header2 = glass.addText(30,48,titledefile(titre), setcolor)
- header3 = glass.addText(30,58,timer.."/"..timetotal, setcolor)
- header4 = glass.addText(145,49,"β", 0xff0000)
- header4.setScale(3)
- centerText(titledefile(titre), header2, 1)
- centerText(timer.."/"..timetotal, header3, 1)
- glass.sync()
- elseif etat == "Repeat On" then
- glass.clear()
- setbackground()
- if playlist == true then
- headerplaylist = glass.addText(50,40,"("..playlistactuel.."/"..playlistmax..")", setcolor)
- centerText("("..playlistactuel.."/"..playlistmax..")", headerplaylist, 1)
- end
- header1 = glass.addText(50,25,"En Cour", setcolor)
- centerText("En Cour", header1, 2)
- header2 = glass.addText(30,48,titledefile(titre), setcolor)
- header3 = glass.addText(30,58,timer.."/"..timetotal, setcolor)
- header4 = glass.addText(147,52,"ΡΊ", 0x00aa00)
- header4.setScale(2)
- centerText(titledefile(titre), header2, 1)
- centerText(timer.."/"..timetotal, header3, 1)
- glass.sync()
- end
- else
- end
- sleep(0.1)
- end
- end
- function history()
- while true do
- term.clear()
- sleep(1)
- term.setCursorPos(1,1)
- getlog = fs.open("log-s8UqqBJy","r")
- print(getlog.readAll())
- getlog.close()
- sleep(30)
- end
- end
- function erreur(types,Pseudo,msg)
- etaterreur = true
- msetcolor = setcolor
- setcolor = 0xaa0000
- sleep(1)
- if types == "URL Invalide" then
- glass.clear()
- setbackground()
- local mainBoxE = glass.addBox(5, 35, 1, 12, 0xa0a0a0, 0.7)
- local outlineTE = glass.addBox(4,34,2,2,0xaa0000,0.7)
- local outlineBE = glass.addBox(4,52,2,2,0xaa0000,0.7)
- mainBoxE.setWidth(12)
- outlineTE.setWidth(14)
- outlineBE.setWidth(14)
- mainBoxE.setHeight(18)
- header4 = glass.addText(6, 37," ", 0xaa0000)
- header4.setScale(2)
- ii = 9
- for i = 0, 9 do
- header1 = glass.addText(50,23,"L'Url", 0xaa0000)
- header2 = glass.addText(30,40,"Youtube", 0xaa0000)
- header3 = glass.addText(30,50,"Est Invalide", 0xaa0000)
- header4.setText(tostring(ii))
- centerText("L'Url", header1, 2)
- centerText("Youtube", header2, 1)
- centerText("Est Invalide", header3, 2)
- glass.sync()
- -- print(tostring(ii))
- ii = ii-1
- sleep(1)
- end
- log(Pseudo..">"..msg.." | "..types)
- elseif types == "Command Invalide" then
- glass.clear()
- setbackground()
- local mainBoxE = glass.addBox(5, 35, 1, 12, 0xa0a0a0, 0.7)
- local outlineTE = glass.addBox(4,34,2,2,0xaa0000,0.7)
- local outlineBE = glass.addBox(4,52,2,2,0xaa0000,0.7)
- mainBoxE.setWidth(12)
- outlineTE.setWidth(14)
- outlineBE.setWidth(14)
- mainBoxE.setHeight(18)
- header4 = glass.addText(6, 37," ", 0xaa0000)
- header4.setScale(2)
- ii = 9
- for i = 0, 9 do
- header1 = glass.addText(50,23,"La Command", 0xaa0000)
- header2 = glass.addText(30,40,msg, 0xaa0000)
- header3 = glass.addText(30,50,"Est Invalid", 0xaa0000)
- header4.setText(tostring(ii))
- centerText("Command", header1, 2)
- centerText(titledefile(msg), header2, 1)
- centerText("Est Invalid", header3, 2)
- glass.sync()
- -- print(tostring(ii))
- ii = ii-1
- sleep(1)
- end
- log(pseudo..">"..msg.." | "..types)
- elseif types == "Erreur repeat" then
- glass.clear()
- setbackground()
- local mainBoxE = glass.addBox(5, 35, 1, 12, 0xa0a0a0, 0.7)
- local outlineTE = glass.addBox(4,34,2,2,0xaa0000,0.7)
- local outlineBE = glass.addBox(4,52,2,2,0xaa0000,0.7)
- mainBoxE.setWidth(12)
- outlineTE.setWidth(14)
- outlineBE.setWidth(14)
- mainBoxE.setHeight(18)
- header4 = glass.addText(6, 37," ", 0xaa0000)
- header4.setScale(2)
- ii = 9
- for i = 0, 9 do
- header1 = glass.addText(50,23,"Repeat doit", 0xaa0000)
- header2 = glass.addText(30,40,"etre executer lors de", 0xaa0000)
- header3 = glass.addText(30,50,"la lecture", 0xaa0000)
- header4.setText(tostring(ii))
- centerText("Repeat doit", header1, 2)
- centerText("etre executer lors de", header2, 1)
- centerText("la lecture", header3, 2)
- glass.sync()
- -- print(tostring(ii))
- ii = ii-1
- sleep(1)
- end
- log(pseudo..">"..msg.." | "..types)
- end
- setcolor = msetcolor
- etaterreur = false
- end
- -- System Log ------
- function log(addLog)
- if fs.exists("log-s8UqqBJy") == false then
- temporaire = fs.open("log-s8UqqBJy","w")
- temporaire.writeLine(addLog)
- temporaire.close()
- else
- temporaire = fs.open("log-s8UqqBJy","a")
- temporaire.writeLine(addLog)
- temporaire.close()
- end
- end
- -- Chargement ------
- parallel.waitForAll(updatetime,getordre,Affichage,history)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement