kristoffer11

Untitled

Oct 25th, 2016
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.90 KB | None | 0 0
  1. os.loadAPI("button")
  2. local p = peripheral.wrap
  3. local diamond = p("tile_extrautils_chestmini_name_0") --diamond blocks proxy chest
  4. local quartz = p("tile_extrautils_chestmini_name_1") --quartz blocks proxy chest
  5. local glowstone = p("tile_extrautils_chestmini_name_2") --glowstone blocks proxy chest
  6. local draconium = p("tile_extrautils_chestmini_name_3") --draconium blocks proxy chest
  7. local resStone = p("tile_extrautils_chestmini_name_4") --resurrection stone proxy chest
  8. local m = peripheral.wrap("right") -- monitor position
  9.  
  10.  
  11. m.clear()
  12. rednet.open("back")
  13.  
  14. function countDiamond()
  15. for i=1,1 do
  16. local slot = diamond.getStackInSlot(i)
  17. if slot == nil then
  18. m.setCursorPos(1,5)
  19. m.write("There is currently 0/4 diamond blocks")
  20. else
  21. m.setCursorPos(1,5)
  22. m.write("There is currently " ..slot.qty.. "/4 diamond blocks")
  23. end
  24. end
  25. end
  26.  
  27. function countQuartz()
  28. for i=1,1 do
  29. local slot = quartz.getStackInSlot(i)
  30. if slot == nil then
  31. m.setCursorPos(1,7)
  32. m.write("There is currently 0/12 quartz pillars")
  33. else
  34. m.setCursorPos(1,7)
  35. m.write("There is currently " ..slot.qty.. "/12 quartz pillars")
  36. end
  37. end
  38. end
  39.  
  40. function countGlowstone()
  41. for i=1,1 do
  42. local slot = glowstone.getStackInSlot(i)
  43. if slot == nil then
  44. m.setCursorPos(1,9)
  45. m.write("There is currently 0/4 glowstone blocks")
  46. else
  47. m.setCursorPos(1,9)
  48. m.write("There is currently " ..slot.qty.. "/4 glowstone blocks")
  49. end
  50. end
  51. end
  52.  
  53. function countDraconium()
  54. for i=1,1 do
  55. local slot = draconium.getStackInSlot(i)
  56. if slot == nil then
  57. m.setCursorPos(1,11)
  58. m.write("There is currently 0/4 charged draconium blocks")
  59. else
  60. m.setCursorPos(1,11)
  61. m.write("There is currently " ..slot.qty.. "/4 charged draconium blocks")
  62. end
  63. end
  64. end
  65.  
  66. function countRes()
  67. for i=1,1 do
  68. local slot = resStone.getStackInSlot(i)
  69. if slot == nil then
  70. m.setCursorPos(1,13)
  71. m.write("There is currently 0/4 resurrection stones")
  72. else
  73. m.setCursorPos(1,13)
  74. m.write("There is currently " ..slot.qty.. "/1 resurrection stones")
  75. end
  76. end
  77. end
  78.  
  79. function checkDiamond()
  80. for i=1,1 do
  81. local slot = diamond.getStackInSlot(i)
  82. if slot == nil then
  83. levelDiamond = 0
  84. else
  85. levelDiamond = slot.qty
  86. end
  87. end
  88. end
  89.  
  90. function checkQuartz()
  91. for i=1,1 do
  92. local slot = quartz.getStackInSlot(i)
  93. if slot == nil then
  94. levelQuartz = 0
  95. else
  96. levelQuartz = slot.qty
  97. end
  98. end
  99. end
  100.  
  101. function checkGlowstone()
  102. for i=1,1 do
  103. local slot = glowstone.getStackInSlot(i)
  104. if slot == nil then
  105. levelGlowstone = 0
  106. else
  107. levelGlowstone = slot.qty
  108. end
  109. end
  110. end
  111.  
  112. function checkDraconium()
  113. for i=1,1 do
  114. local slot = draconium.getStackInSlot(i)
  115. if slot == nil then
  116. levelDraconium = 0
  117. else
  118. levelDraconium = slot.qty
  119. end
  120. end
  121. end
  122.  
  123. function checkRes()
  124. for i=1,1 do
  125. local slot = resStone.getStackInSlot(i)
  126. if slot == nil then
  127. levelRes = 0
  128. else
  129. levelRes = slot.qty
  130. end
  131. end
  132. end
  133.  
  134. function fillTable()
  135. button.setTable("Activate The Ritual!", start,10,41,16,18)
  136. button.screen()
  137. end
  138.  
  139. function getClick()
  140. event,side,x,y = os.pullEvent("monitor_touch")
  141. button.checkxy(x,y)
  142. end
  143.  
  144. function start()
  145. button.flash("Activate The Ritual!")
  146. print("Dragon Spawning!")
  147. end
  148.  
  149.  
  150. button.heading("Auto Dragon Spawner")
  151. --getClick()
  152. while true do
  153. countDiamond()
  154. sleep(0)
  155. countQuartz()
  156. sleep(0)
  157. countGlowstone()
  158. sleep(0)
  159. countDraconium()
  160. sleep(0)
  161. countRes()
  162. sleep(0)
  163. checkDiamond()
  164. sleep(0)
  165. checkQuartz()
  166. sleep(0)
  167. checkGlowstone()
  168. sleep(0)
  169. checkDraconium()
  170. sleep(0)
  171. checkRes(0)
  172. if levelDiamond >= 4 and
  173. levelQuartz >= 12 and
  174. levelGlowstone >= 4 and
  175. levelDraconium >= 4 and
  176. levelRes >= 1
  177. then
  178. countDiamond()
  179. countQuartz()
  180. countGlowstone()
  181. countDraconium()
  182. countRes()
  183. fillTable()
  184. getClick()
  185. sleep(0.5)
  186. m.clear()
  187. button.heading("Auto Dragon Spawner")
  188. else
  189. end
  190. end
  191.  
  192.  
  193.  
  194.  
  195. -- checkDiamond()
  196. -- checkQuartz()
  197. -- checkGlowstone()
  198. -- checkDraconium()
  199. -- checkRes()
  200. -- if levelDiamond >=4 and
  201. -- levelQuartz >=12 and
  202. -- levelGlowstone >=4 and
  203. -- levelDraconium >=4 and
  204. -- levelRes >=1
  205. -- then
  206. -- fillTable()
  207. -- break
  208. -- else
  209. -- end
  210. --end
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218. --button.heading("Auto Dragon Summoner!")
  219.  
  220. --while true do
  221. -- getClick()
  222. -- countDiamond()
  223. -- countQuartz()
  224. -- countGlowstone()
  225. -- countDraconium()
  226. -- countRes()
  227. --end
  228.  
  229.  
  230.  
  231.  
  232.  
  233. --for i=1,5 do
  234. --local slot = chest.getStackInSlot(i)
  235. -- if i ~= nil then
  236. -- if slot == nil then
  237. -- print("No items in slot " ..i)
  238. -- else
  239. -- print("There is " ..slot.qty.." " ..slot.name.. " in slot " ..i)
  240. -- end
  241. -- end
  242. --end
Add Comment
Please, Sign In to add comment