Advertisement
ramdor

ServerStatus

Jul 4th, 2013
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. local statuspage = "http://lnn-ranked.com/152status.htm"
  2.  
  3. term.clear()
  4.  
  5. while(true) do
  6.         local body = http.get(statuspage);
  7.         local status = body.readAll();
  8.  
  9.     term.setCursorPos(1,1)
  10.  
  11.         print("Status: "..status.."          ");
  12.  
  13.         if(status == "UP") then
  14.                 redstone.setOutput("back",true);
  15.         elseif(status == "DOWN") then
  16.                 redstone.setOutput("back",false);
  17.         else
  18.                 redstone.setOutput("back",false);
  19.         end
  20.  
  21.         os.sleep(60);
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement