Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. ioPort = "appliedenergistics2:tile.BlockSpatialIOPort"
  2. stopBlock = "minecraft:stained_hard_clay"
  3. speaker = peripheral.wrap("right")
  4.  
  5. function start()
  6.  
  7. rednet.broadcast("--MOVING DOWN--","elvloc")
  8. success,data = turtle.inspect()
  9.  
  10. if(data.name ~= ioPort)
  11. then
  12. checkFor()
  13. else
  14. turtle.suck()
  15. turtle.drop()
  16. rs.setOutput("front",true)
  17. sleep(.2)
  18. rs.setOutput("front",false)
  19. turtle.suck()
  20. turtle.turnRight()
  21. turtle.turnRight()
  22. end
  23. end
  24.  
  25. function elevate()
  26.  
  27. failure = 0
  28.  
  29. repeat
  30. successfulDown = turtle.down()
  31. success,data = turtle.inspect()
  32.  
  33. if(successfulDown ~= true)
  34. then
  35. failure = failure + 1
  36. end
  37.  
  38. if (failure > 10)
  39. then
  40. rednet.broadcast("ERRORED","elvloc")
  41. repeat
  42. turtle.up()
  43. success,data = turtle.inspect()
  44. until( data.name == ioPort or data.name == stopBlock)
  45. return
  46. end
  47.  
  48. until( data.name == ioPort or data.name == stopBlock)
  49.  
  50. if (data.name == stopBlock)
  51. then
  52. checkfor()
  53. end
  54. sleep(.5)
  55. speaker.speak("You are now in the basement",5,"Hindi")
  56. rednet.broadcast("BASEMENT","elvloc")
  57. end
  58.  
  59. function endElv()
  60. turtle.drop()
  61. rs.setOuput("front",true)
  62. sleep(.2)
  63. rs.setOuput("front",false)
  64. end
  65.  
  66. function checkFor()
  67. repeat
  68. turtle.turnRight()
  69. success,data = turtle.inspect()
  70. until(data.name == ioPort)
  71. end
  72.  
  73. start()
  74. elevate()
  75. endElv()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement