View difference between Paste ID: zxq3D7N7 and yfS2qz0q
SHOW: | | - or go back to the newest paste.
1
function split(inputstr, sep)
2
        if sep == nil then
3
                sep = "%s"
4-
modem.setListening(81, true)
4+
        end
5
        local t={}
6
        for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
7
                table.insert(t, str)
8-
if msg == "lol.net" then
8+
        end
9
        return t
10
end
11
12
local modem = peripheral.wrap("top")
13
-- Aspetto la richiesta
14
while true do
15
modem.setListening(80, true)
16
local event, lato, sender, canale, msg = os.pullEvent("lan_message")
17
18
print("Richiesta da: 144.91.97."..sender.."\nContenuto: "..msg)
19
if msg == "craftabo.net" then
20
modem.sendChannel(80, "sus")
21
elseif string.find(msg, "sus.tets/sendForm") ~= nil then
22
r = split(msg, "$")
23
-- r[2] == contenuto del form
24
end
25
sleep(0.1)
26
end