csmit195

Untitled

Sep 25th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local sensor = peripheral.wrap('right')
  2.  
  3. local isMoving
  4. local isStart = true
  5. local isEnd
  6.  
  7. --0.0, y=-3.0, z=1.0
  8.  
  9. function init()
  10.     -- Debug
  11.     shell.run('rm output')
  12.     local output = fs.open('output', 'w')
  13.     output.write(sensor.sonicScan())
  14.     output.close()
  15.     shell.run('pastebin put output')
  16. end
  17.  
  18. function moveToEgg()
  19.     isMoving = true
  20.     turtle.up()
  21.     turtle.forward()
  22.     turtle.forward()
  23.     turtle.forward()
  24.     isMoving = false
  25.     isStart = false
  26.     isEnd = true
  27. end
  28.  
  29. function returnToBase()
  30.     isMoving = true
  31.     turtle.back()
  32.     turtle.back()
  33.     turtle.back()
  34.     turtle.down()
  35.     isMoving = false
  36.     isEnd = false
  37.     isStart = true
  38. end
  39.  
  40. init()
Add Comment
Please, Sign In to add comment