Advertisement
Guest User

startup

a guest
Oct 7th, 2015
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. term.setCursorPos(1,1)
  2. term.clear()
  3. print("Raiding Class Warp Drive")
  4. term.setCursorPos(1,3)
  5. print("Direction: ")
  6. term.setCursorPos(12,3)
  7. direction = read()
  8. term.setCursorPos(1,4)
  9.  
  10. function mv()
  11. peripheral.call("back","move",2,true,false)
  12. drive = peripheral.wrap("back")
  13. drive.move(direction,false,false)
  14. -- function stops
  15. end
  16. -- Warp/ Distance = 0
  17. if direction == "warp" then
  18. term.clear()
  19. term.setCursorPos(1,1)
  20. print("Warping...")
  21. sleep(.5)
  22. redstone.setOutput("left",true)
  23. sleep(.1)
  24. redstone.setOutput("left",false)
  25. sleep(.5)
  26. term.setCursorPos(1,2)
  27. print("Warp Complete")
  28. sleep(.5)
  29. shell.run("startup")
  30. -- Directional Movement/Distance
  31. elseif direction == "north" then
  32. mv()
  33. elseif direction == "south" then
  34. mv()
  35. elseif direction == "east" then
  36. mv()
  37. elseif direction == "west" then
  38. mv()
  39. elseif direction == "up" then
  40. mv()
  41. elseif direction == "down" then
  42. mv()
  43. elseif direction == "420" then
  44. redstone.setOutput("right", true)
  45. sleep(2)
  46. redstone.setOutput("right", false)
  47. sleep(1)
  48. shell.run("startup")
  49. else term.setCursorPos(12,6)
  50. print("Direction-Invalid")
  51. sleep(.5)
  52. shell.run("startup")
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement