tomtrein

Untitled

Jul 22nd, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. local function centerText(text)
  2. local x,y = term.getSize()
  3. local x2,y2 = term.getCursorPos()
  4. term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
  5. print(text)
  6. end
  7.  
  8. while true do
  9. term.clear()
  10. centerText("Direction (wasd):")
  11. direction = read()
  12. if direction == "d" then
  13. centerText("Ready")
  14. rednet.send(698,"on")
  15. os.sleep(120)
  16. rednet.send(696,"off")
  17. elseif direction == "w" then
  18. centerText("Ready")
  19. os.sleep(120)
  20. elseif direction == "a"
  21. rednet.send(699,"on")
  22. rednet.send(700,"on")
  23. centerText("Ready")
  24. os.sleep(120)
  25. rednet.send(699,"off")
  26. rednet.send(700,"off")
  27. end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment