funnybunnyofdoom

BunnyPath

Feb 5th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. List = {}
  2. Ref = 0
  3. MonSide = "top"
  4. --Append onto list
  5. function app(array,phrase)
  6. array[Ref] = phrase
  7. Ref = Ref + 1
  8. end
  9. function f(array)
  10. app(array,"turtle.forward()")
  11. end
  12. function b(array)
  13. app(array,"turtle.back()")
  14. end
  15. function d(array)
  16. app(array,"turtle.down()")
  17. end
  18. function tr(array)
  19. app(array,"turtle.turnRight()")
  20. end
  21. function tl(array)
  22. app(array,"turtle.turnLeft()")
  23. end
  24. function dig(array)
  25. app(array,"turtle.dig()")
  26. end
  27. function du(array)
  28. app(array,"turtle.digUp()")
  29. end
  30. function dd(array)
  31. app(array,"turtle.digDown()")
  32. end
  33. function up(array)
  34. app(array,"turtle.up()")
  35. end
  36. function dr(array)
  37. app(array,"turtle.drop()")
  38. end
  39. function su(array)
  40. app(array,"turtle.suck()")
  41. end
  42. function ec(array)
  43. app(array,"enderAPI.dumpchest()")
  44. end
  45.  
  46. function placeInFile(FILE,ARRAY)
  47. file = fs.open("/path/"..FILE,"w")
  48. for i=0,Ref do
  49. file.writeLine(ARRAY[i])
  50. end
  51. file.close()
  52. end
  53.  
  54. print("Please enter the file path and name")
  55. print("For your save file")
  56. PATH = read()
  57. term.clear()
  58. term.setCursorPos(1,1)
  59. print("UP = forward")
  60. print("DOWN = back")
  61. print("Left = turn left")
  62. print("Right = turn right")
  63. print("Q = dig")
  64. print("W = up")
  65. print("S = down")
  66. print("A = dig up")
  67. print("Z = dig down")
  68. print("E = suck")
  69. print("X = drop")
  70. print("Enter = quit")
  71. print("EnderAPI;")
  72. print("C = EnderChest")
  73. term.setCursorPos(16,2)
  74. local on = true
  75. while on == true do
  76. local event, key = os.pullEvent( "key" )
  77. if key == keys.w then
  78. up(List)
  79. term.write("Up")
  80. elseif key == keys.s then
  81. d(List)
  82. term.write("Down")
  83. elseif key == keys.q then
  84. dig(List)
  85. term.write("Dig")
  86. elseif key == keys.a then
  87. du(List)
  88. term.write("Dig Up")
  89. elseif key == keys.z then
  90. dd(List)
  91. term.write("Dig Down")
  92. elseif key == keys.left then
  93. tl(List)
  94. term.write("Turn Left")
  95. elseif key == keys.right then
  96. tr(List)
  97. term.write("Turn Right")
  98. elseif key == keys.down then
  99. b(List)
  100. term.write("Back")
  101. elseif key == keys.up then
  102. f(List)
  103. term.write("Forward")
  104. elseif key == keys.e then
  105. su(List)
  106. term.write("Suck")
  107. elseif key == keys.x then
  108. dr(List)
  109. term.write("Drop")
  110. elseif key == keys.c then
  111. ec(List)
  112. term.write("Ender Chest")
  113. elseif key == keys.enter then
  114. on = false
  115. end
  116.  
  117.  
  118. if Ref < 17 then
  119. term.setCursorPos(16,Ref+2)
  120. elseif Ref > 16 and Ref < 34 then
  121. term.setCursorPos(32,Ref-16)
  122. else
  123. term.setCursorPos(1,Ref-32)
  124. end
  125. placeInFile(PATH,List)
  126.  
  127. end
  128.  
  129. --monitor = peripheral.wrap("top")
  130. --X,Y = monitor.getSize()
  131. --monitor.setBackgroundColor(colors.lightGray)
  132. --monitor.clear()
  133. --monitor.setTextColor(colors.yellow)
  134. --monitor.setCursorPos(4,1)
  135. --monitor.setBackgroundColor(colors.blue)
  136. --monitor.write("^")
  137. --monitor.setCursorPos(4,2)
  138. --monitor.write("|")
  139. --monitor.setCursorPos(1,3)
  140. --monitor.write("<=")
Add Comment
Please, Sign In to add comment