Advertisement
Jasuse

Untitled

May 25th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. -- Robot script(?)
  2.  
  3. local comp = require("component")
  4. local robot = require("robot")
  5. local keyb = require("keyboard")
  6.  
  7. print(robot.level())
  8. print(robot.name())
  9.  
  10. local _isRepeat = true
  11. print("Controls enabled!")
  12. while(isRepeat == true) do
  13.  
  14. if(keyb.isKeyDown('w')) then
  15.     robot.forward()
  16. end
  17.  
  18. if(keyb.isKeyDown('s')) then
  19.     robot.back()
  20. end
  21.  
  22. if(keyb.isKeyDown('a')) then
  23.     robot.turnLeft()
  24. end
  25.  
  26. if(keyb.isKeyDown('d')) then
  27.     robot.turnRight()
  28. end
  29.  
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement