Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function show(i)
- moni.setTextScale(3)
- moni.clear()
- moni.setCursorPos(1,1)
- if i == 0 then
- moni.write("Stream OFF")
- else
- moni.write("Stream ON")
- end
- end
- local tArgs = { ... }
- if #tArgs < 2 then
- print( "Usage: <id> <monitor place>" )
- return
- end
- term.clear()
- term.setCursorPos(1,1)
- print("Programm Running")
- moni = peripheral.wrap(tArgs[2])
- while true do
- local page = http.get("http://api.own3d.tv/liveCheck.php?live_id="..tArgs[1])
- if page ~= nil then
- local ownd = page:readAll()
- if string.sub(ownd, 64, 67) == "true" then
- show(1)
- else
- show(0)
- end
- sleep(60)
- else
- print("problems reading the status")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement