Advertisement
Guest User

startup

a guest
Jul 24th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.55 KB | None | 0 0
  1. --Very Ignorant Code--
  2. while true do
  3. local event = os.pullEvent("redstone")
  4. local m = peripheral.wrap("monitor_11")
  5. local one = peripheral.wrap("diamond_2")
  6. bal = 0
  7. local stack = one.getStackInSlot(1)
  8. if stack and stack["id"] == 30257 then print("Copper Token")
  9. bal = bal + one.getStackInSlot(1)["qty"]
  10. elseif stack and stack["id"] == 30258 then print("Silver Token")
  11. bal = bal + one.getStackInSlot(1)["qty"] * 64
  12. else print("Empty")
  13. end
  14. local stack = one.getStackInSlot(2)
  15. if stack and stack["id"] == 30257 then print("Copper Token")
  16. bal = bal + one.getStackInSlot(2)["qty"]
  17. elseif stack and stack["id"] == 30258 then print("Silver Token")
  18. bal = bal + one.getStackInSlot(2)["qty"] * 64
  19. else print("Empty")
  20. end
  21. local stack = one.getStackInSlot(3)
  22. if stack and stack["id"] == 30257 then print("Copper Token")
  23. bal = bal + one.getStackInSlot(3)["qty"]
  24. elseif stack and stack["id"] == 30258 then print("Silver Token")
  25. bal = bal + one.getStackInSlot(3)["qty"] * 64
  26. else print("Empty")
  27. end
  28. local stack = one.getStackInSlot(4)
  29. if stack and stack["id"] == 30257 then print("Copper Token")
  30. bal = bal + one.getStackInSlot(4)["qty"]
  31. elseif stack and stack["id"] == 30258 then print("Silver Token")
  32. bal = bal + one.getStackInSlot(4)["qty"] * 64
  33. else print("Empty")
  34. end
  35. local stack = one.getStackInSlot(5)
  36. if stack and stack["id"] == 30257 then print("Copper Token")
  37. bal = bal + one.getStackInSlot(5)["qty"]
  38. elseif stack and stack["id"] == 30258 then print("Silver Token")
  39. bal = bal + one.getStackInSlot(5)["qty"] * 64
  40. else print("Empty")
  41. end
  42. local stack = one.getStackInSlot(6)
  43. if stack and stack["id"] == 30257 then print("Copper Token")
  44. bal = bal + one.getStackInSlot(6)["qty"]
  45. elseif stack and stack["id"] == 30258 then print("Silver Token")
  46. bal = bal + one.getStackInSlot(6)["qty"] * 64
  47. else print("Empty")
  48. end
  49. local stack = one.getStackInSlot(7)
  50. if stack and stack["id"] == 30257 then print("Copper Token")
  51. bal = bal + one.getStackInSlot(7)["qty"]
  52. elseif stack and stack["id"] == 30258 then print("Silver Token")
  53. bal = bal + one.getStackInSlot(7)["qty"] * 64
  54. else print("Empty")
  55. end
  56. local stack = one.getStackInSlot(8)
  57. if stack and stack["id"] == 30257 then print("Copper Token")
  58. bal = bal + one.getStackInSlot(8)["qty"]
  59. elseif stack and stack["id"] == 30258 then print("Silver Token")
  60. bal = bal + one.getStackInSlot(8)["qty"] * 64
  61. else print("Empty")
  62. end
  63. local stack = one.getStackInSlot(9)
  64. if stack and stack["id"] == 30257 then print("Copper Token")
  65. bal = bal + one.getStackInSlot(9)["qty"]
  66. elseif stack and stack["id"] == 30258 then print("Silver Token")
  67. bal = bal + one.getStackInSlot(9)["qty"] * 64
  68. else print("Empty")
  69. end
  70. local stack = one.getStackInSlot(10)
  71. if stack and stack["id"] == 30257 then print("Copper Token")
  72. bal = bal + one.getStackInSlot(10)["qty"]
  73. elseif stack and stack["id"] == 30258 then print("Silver Token")
  74. bal = bal + one.getStackInSlot(10)["qty"] * 64
  75. else print("Empty")
  76. end
  77. local stack = one.getStackInSlot(11)
  78. if stack and stack["id"] == 30257 then print("Copper Token")
  79. bal = bal + one.getStackInSlot(11)["qty"]
  80. elseif stack and stack["id"] == 30258 then print("Silver Token")
  81. bal = bal + one.getStackInSlot(1)["qty"] * 64
  82. else print("Empty")
  83. end
  84. local stack = one.getStackInSlot(12)
  85. if stack and stack["id"] == 30257 then print("Copper Token")
  86. bal = bal + one.getStackInSlot(12)["qty"]
  87. elseif stack and stack["id"] == 30258 then print("Silver Token")
  88. bal = bal + one.getStackInSlot(12)["qty"] * 64
  89. else print("Empty")
  90. end
  91. m.setCursorPos(40,1)
  92. m.write("      ")
  93. m.setCursorPos(40,1)
  94. m.write(bal)
  95. print(bal)
  96. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement