Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Running... [hold ctrl+t to cancel]")
- redstone.setAnalogOutput("right",15);
- m = peripheral.find("monitor")
- s = peripheral.find("speaker")
- url2 = "http://157.230.185.40/tc/lastwood.php"
- url = "http://157.230.185.40/tc/lua.php"
- m.write("Press the button to update...")
- local open = io.open
- local function read_file(path)
- local file = open(path, "r")
- if not file then return nil end
- local content = file:read "*a"
- file:close()
- return content
- end
- while true do
- os.pullEvent("redstone")
- if rs.getInput("back") == true then
- s.playSound("minecraft:ui.toast.challenge_complete")
- shell.run("rm status")
- shell.run("rm wood")
- m.clear()
- shell.run("wget", url, "status")
- shell.run("wget", url2, "wood")
- local systat = read_file("status")
- m.setCursorPos(1,1)
- m.write("TELEHACK SYSTEM STATUS")
- m.setCursorPos(1,2)
- m.write(os.date('%y-%b-%d %H:%M:%S'))
- m.setCursorPos(1,3)
- m.write( (systat) )
- m.setCursorPos(1,5)
- local woody = read_file("wood")
- m.write( "underwood was last active")
- m.setCursorPos(1,6)
- m.write(woody .. " ago.")
- m.setCursorPos(1,9)
- m.write("Press the button to update...")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement