string.split = function(text, split)
result = {}
result2 = {}
a = text:gsub("(.-)" .. split, function(c) table.insert(result, c) end)
b = text:gsub(split .. "(.-)$", function(c) table.insert(result2, c) end)
table.insert(result, result2[#result2+1])
return result
end
monitor = peripheral.wrap("top")
url = "http://hentie.co:8080"
getChat = function(channel, width, height)
chatlog = http.get(url .. "/getmessages?channel="..channel .. "&width=" .. width .. "&height=" .. height).readAll()
cursor = 0
monitor.clear()
for i,v in pairs(string.split(chatlog, "</br>")) do
cursor = cursor + 1
monitor.setCursorPos(1, cursor)
monitor.write(v)
print(v)
end
print(chatlog)
end
local w, h = monitor.getSize()
while true do
getChat("TestPackPleaseIgnore", w, 20)
sleep(5)
end
result = {}
result2 = {}
a = text:gsub("(.-)" .. split, function(c) table.insert(result, c) end)
b = text:gsub(split .. "(.-)$", function(c) table.insert(result2, c) end)
table.insert(result, result2[#result2+1])
return result
end
monitor = peripheral.wrap("top")
url = "http://hentie.co:8080"
getChat = function(channel, width, height)
chatlog = http.get(url .. "/getmessages?channel="..channel .. "&width=" .. width .. "&height=" .. height).readAll()
cursor = 0
monitor.clear()
for i,v in pairs(string.split(chatlog, "</br>")) do
cursor = cursor + 1
monitor.setCursorPos(1, cursor)
monitor.write(v)
print(v)
end
print(chatlog)
end
local w, h = monitor.getSize()
while true do
getChat("TestPackPleaseIgnore", w, 20)
sleep(5)
end