Advertisement
Guest User

startup.lua

a guest
Apr 9th, 2020
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. redstone.setAnalogOutput("right",15);
  2. shell.run("rm status")
  3. url = "http://157.230.185.40/tc/lua.php"
  4. m = peripheral.find("monitor")
  5. m.clear()
  6. shell.run("wget", url, "status")
  7. local open = io.open
  8.  
  9. local function read_file(path)
  10.     local file = open(path, "r")
  11.     if not file then return nil end
  12.     local content = file:read "*a"
  13.     file:close()
  14.     return content
  15. end
  16.  
  17. local fileContent = read_file("status");
  18. m.setCursorPos(1,1);
  19. m.write("TELEHACK SYSTEM STATUS");
  20. m.setCursorPos(1,2);
  21. m.write(os.date('%y-%b-%d %H:%M:%S'));
  22. m.setCursorPos(1,3);
  23. m.write( (fileContent) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement