Advertisement
craftyoyo

httpdoor

Jan 1st, 2014
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. local state
  2. local mon = peripheral.wrap("right")
  3. while 1 do
  4. local door_handle = http.get("http://fellouttheworld.bl.ee/door/door.php")
  5. mon.clear()
  6. mon.setCursorPos(1,1)
  7. if not door_handle then
  8. mon.write("Impossible de se connecter")
  9. else
  10. state = door_handle.readAll()
  11. if state == "0" then
  12. rs.setOutput("back",false)
  13. mon.write("Porte fermer")
  14. mon.setCursorPos(1,2)
  15. mon.write(state)
  16. else
  17. rs.setOutput("back",true)
  18. mon.write("Porte ouverte")
  19. mon.setCursorPos(1,2)
  20. mon.write(state)
  21. end
  22. end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement