tomtrein

Untitled

Jul 22nd, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 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. os.sleep(120)
  15. elseif direction == "w" then
  16. rednet.send(696,"on")
  17. rednet.send(698,"on")
  18. os.sleep(120)
  19. rednet.send(696,"off")
  20. rednet.send(698,"off")
  21. elseif direction == "a"
  22. rednet.send(696,"on")
  23. os.sleep(120)
  24. rednet.send(696,"off")
  25. end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment