View difference between Paste ID: bP9jmvje and WpkDUYP7
SHOW: | | - or go back to the newest paste.
1-
shell.run("rm lista_barboni")
1+
term.clear()
2-
rs.setOutput("left", false)
2+
term.setCursorPos(1, 1)
3-
rs.setOutput("top", false)
3+
print("SkinBox - Cancella la tua skin!")
4-
local interrupt = os.setAlarm(0)
4+
print("")
5-
local creaListaBarboni = fs.open("lista_barboni", "w")
5+
print("Con questo computer potrai cancellare la tua skin in modo da poterne caricare una nuova.")
6-
creaListaBarboni.writeLine("BigBrother")
6+
print("")
7-
creaListaBarboni.close()
7+
print("Per proseguire, predi un qualsiasi tasto")
8-
while true do
8+
os.pullEvent()
9-
    local event, barbone = os.pullEvent()
9+
term.clear()
10-
    if event == "player" then
10+
term.setCursorPos(1, 1)
11-
        local ControllaBarbone = fs.open("lista_barboni", "r")
11+
sleep(1)
12-
        trovaBarbone = string.find(ControllaBarbone.readAll(), barbone)
12+
print("Per confermare la richiesta di eliminazione della skin, tocca il sensore di impronte digitali situato sotto al computer.")
13-
        if trovaBarbone == nil or trovaBarbone == "" then
13+
print("")
14-
            ControllaBarbone.close()
14+
print("Per annullare premere qualunque tasto")
15-
            print(textutils.formatTime(os.time(),true).." Pranzo erogato: "..barbone)
15+
print("")
16-
            local AggiungiBarbone = fs.open("lista_barboni", "a")
16+
print("")
17-
            AggiungiBarbone.writeLine(barbone)
17+
local event, skinDaCancellare = os.pullEvent()
18-
            AggiungiBarbone.close()
18+
if event == "player" then
19-
            rs.setOutput("left", true)
19+
	risposta = http.get("http://eu.skinserver.a-centauri.com/rm.php?auth=dasfaosfiaquhisuonriquw982akjbnfjaksbnf&skin="..skinDaCancellare)
20-
            sleep(1)
20+
	if risposta.readAll() == "OK" then
21-
            rs.setOutput("left", false)
21+
	    print("Skin rimossa con successo")
22-
        else
22+
	else
23-
            print(textutils.formatTime(os.time(),true).." Pranzo non erogato: "..barbone)
23+
		print("Skin NON rimossa. Errore rimozione.")
24-
            rs.setOutput("top", true)
24+
	end
25-
            sleep(1)
25+
else
26-
            rs.setOutput("top", false)
26+
	print("Skin NON rimossa. Operazione annullata")
27-
        end
27+
end
28-
    elseif event == "alarm" then
28+
print("Tra poco sarΓ  possibile eseguire una nuova operazione")
29-
        os.reboot()
29+
sleep(2)
30-
    end
30+
os.reboot()