View difference between Paste ID: q5N56mxz and 8xL43u5B
SHOW: | | - or go back to the newest paste.
1
mon = peripheral.wrap("right")
2-
term.redirect(mon)
2+
mon.setTextScale(0.5)
3
uri = "http://luanet.rgbcraft.com/servlets/vendite/minerali"
4-
function clear()
4+
5-
term.clear()
5+
6-
term.setCursorPos(1, 1)
6+
    term.redirect(mon)
7-
term.setBackgroundColour(colours.black)
7+
    function clear()
8-
term.setTextColor( colors.white )
8+
    term.clear()
9-
end
9+
    term.setCursorPos(1, 1)
10-
function link()
10+
    term.setBackgroundColour(colours.black)
11-
term.setTextColour(colours.yellow)
11+
    term.setTextColor( colors.white )
12-
end
12+
    end
13-
function fineLink()
13+
    function link()
14-
term.setTextColour(colours.white)
14+
    term.setTextColour(colours.yellow)
15-
end
15+
    end
16-
function colore(sfumatura)
16+
    function fineLink()
17-
term.setTextColour(sfumatura)
17+
    term.setTextColour(colours.white)
18-
end
18+
    end
19-
function fineColore()
19+
    function colore(sfumatura)
20-
term.setTextColour(colours.white)
20+
    term.setTextColour(sfumatura)
21-
end
21+
    end
22-
function sfondo(sfumaturaSfondo)
22+
    function fineColore()
23-
term.setBackgroundColour(sfumaturaSfondo)
23+
    term.setTextColour(colours.orange)
24-
end
24+
    end
25-
function fineSfondo()
25+
    function sfondo(sfumaturaSfondo)
26-
term.setBackgroundColour(colours.black)
26+
    term.setBackgroundColour(sfumaturaSfondo)
27-
end
27+
    end
28-
clear()
28+
    function fineSfondo()
29-
colore(colours.black)
29+
    term.setBackgroundColour(colours.black)
30-
sfondo(colours.yellow)
30+
    end
31-
print("BORSA DI KILMAURS | QUOTAZIONI")
31+
    clear()
32-
fineColore()
32+
    colore(colours.black)
33-
fineSfondo()
33+
    sfondo(colours.yellow)
34-
quotazioni = textutils.unserialize(http.get("http://rest.rgbcraft.com/borsakilmaurs/?richiesta=lua_totale").readAll())
34+
    print("QUOTAZIONI MINERALI E GEMME PREZIOSE             ")
35-
colore(colors.purple)
35+
    fineColore()
36-
print("\nSimb Nome societåA0                  Quotaz.   Scost.")
36+
    fineSfondo()
37-
fineColore()
37+
    quotazioni = textutils.unserialize(http.get(uri.."/?richiesta=prezzario_lua").readAll())
38-
ypos = 4
38+
    print("\n")
39-
for k,v in pairs(quotazioni) do
39+
    colore(colors.black)
40-
	term.setCursorPos(1, ypos)
40+
    sfondo(colours.orange)
41-
	term.write(k)
41+
    print("Nome                              Quotaz.        ")
42-
	term.setCursorPos(6, ypos)
42+
    fineColore()
43-
	term.write(v["nome"])
43+
    fineSfondo()
44-
	term.setCursorPos(36, ypos)
44+
    ypos = 6
45-
	term.write(v["quotazione"])
45+
    local i = 0
46-
	term.setCursorPos(46, ypos)
46+
    for k,v in pairs(quotazioni) do
47-
	if v["segno"] == "+" then
47+
    if (i % 2 == 0) then
48-
		colore(colors.lime)
48+
        colore(colors.yellow)
49-
	else
49+
    else
50-
		colore(colors.red)
50+
        colore(colors.orange)
51-
	end
51+
    end
52-
	term.write(v["scarto"])
52+
        term.setCursorPos(1, ypos)
53-
	fineColore()
53+
        term.write(v["nome"])
54-
	ypos = ypos + 1
54+
        term.setCursorPos(36, ypos)
55-
end
55+
        term.write(v["prezzo"])
56-
colore(colours.yellow)
56+
        ypos = ypos + 1
57-
term.setCursorPos(1, 18)
57+
        i = i + 1
58-
fineColore()
58+
    end
59-
sleep(120)
59+
    colore(colours.yellow)
60
    term.setCursorPos(1, 18)
61
    fineColore()
62
    term.restore()
63
    sleep(120)
64
end