simon1007

Turtle Basic Functions

Oct 28th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. --entrer une direction et le nombre de fois qu'il le fera
  2. --Enter a direction and how many times repeat it...
  3. function move(String, nbr1)
  4.   for d = 1, nbr1 do
  5.     if String == 'f' then
  6.       turtle.forward()
  7.     elseif String == 'b' then
  8.       turtle.back()
  9.     elseif String == 'u' then
  10.       turtle.up()
  11.     elseif String == 'd' then
  12.       turtle.down()
  13.     end
  14.   end
  15. end
  16.  
  17. function turn(Dir)
  18.   if Dir == 'l' then
  19.     turtle.turnLeft()
  20.   elseif Dir == 'r' then
  21.     turtle.turnRight()
  22.   end
  23. end
Add Comment
Please, Sign In to add comment