Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Opzioni di configurazione
- colWelcome = colors.lime
- colPlayer = colors.white
- colIscritti = colors.red
- tempoApertura = 4
- durataAllarme = 7
- elencoAmmessi = {"Darkhim", "SurrealPower", "HEXEVIL", "Keledan", "Wr3nt" , "KIRIAIR", "Ulisse1996" }
- function scanTable(table, search)
- for i=1, #table do
- if table[i]==search then
- return true
- end
- end
- return false
- end
- --Collega il Monitor
- local monitor = peripheral.wrap("back")
- term. clear()
- print("Premi C per cancellare la scritta a schermo")
- print("Premi X per interrompere")
- function interfaccia(comando)
- if comando == "c" then
- monitor.clear()
- print ("\n\n Monitor cancellato")
- sleep (2)
- end
- if comando == "x" or comando =="X" then
- print ("Uscita in corso")
- sleep(1)
- os.shutdown()
- end
- end
- function faiEntrare(player)
- local playerChannel = "null"
- playerChannel = player
- if player == "Keledan" then playerChannel = "Keledan75" end
- if player == "Darkhim" then playerChannel = "Darkhim85" end
- if player == "SurrealPower" then playerChannel = "SurreaIPower" end
- if player == "Ulisse1996" then playerChannel = "XUlisse1996" end
- if player == "HEXEVIL" then playerChannel = "EternaLoveLC" end
- monitor.clear()
- monitor.setCursorPos(2,2)
- monitor.setTextScale(2.5)
- monitor.setTextColor(colWelcome)
- monitor.write ("Benvenuto")
- monitor.setCursorPos(2,4)
- monitor.setTextScale(2.5)
- monitor.setTextColor(colPlayer)
- monitor.write (player)
- local iscritti= http.get("http://www.truemetal.it/youtube/youtube.php?channel=" .. playerChannel .. "&funzione=iscritti")
- monitor.setTextColor(colIscritti)
- monitor.setCursorPos(2,6)
- monitor.write("Iscritti ")
- monitor.write (iscritti.readAll())
- iscritti.close()
- redstone.setOutput ("front", true)
- sleep(tempoApertura)
- redstone.setOutput ("front", false)
- end
- function buttaFuori()
- monitor.setTextColor(colors.lime)
- monitor.clear()
- monitor.setCursorPos(2,2)
- monitor.setTextScale(2.5)
- monitor.write(player)
- monitor.setTextColor(colors.red)
- monitor.setCursorPos(2,4)
- monitor.write("TU NON PUOI")
- monitor.setCursorPos(2,6)
- monitor.write("PASSARE!")
- redstone.setOutput("left", true)
- sleep(durataAllarme)
- redstone.setOutput("left", false)
- end
- while true do
- event, player = os.pullEvent()
- if event == "player" then
- ammesso = scanTable(elencoAmmessi, player)
- if ammesso == true then
- faiEntrare(player)
- end
- if ammesso == false then
- buttaFuori(player)
- end
- elseif event == "char" then
- interfaccia(player)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment