Advertisement
Laffeh

TrainBoard

Feb 25th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. term.clear()
  2.  
  3. monitor = peripheral.find("monitor")
  4. if monitor then
  5. local scale, w, h, left, top
  6. for scale = 2, 0.5, -0.5 do
  7. monitor.setTextScale(scale)
  8. w, h = monitor.getSize()
  9. if w >= 51 and h >= 19 then break end
  10. end
  11. left = math.floor((w-51)/2)+1
  12. top = math.floor((h-19)/2)+1
  13. screen = window.create(monitor, left, top, 51, 19)
  14. end
  15.  
  16. while true do
  17. local sExample = http.get("http://benandhayley.com/trainat.php") --Get contents of page
  18. monitor.setCursorPos(16,3) monitor.write("Train Station")
  19. monitor.setCursorPos(16,7)
  20. local sFinalRead = sExample.readAll()
  21. local sFinalRead2 = sFinalRead :gsub("%^a", "\n")
  22. monitor.write(sFinalRead2)
  23.  
  24. sExample.close()
  25. sleep(4)
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement