View difference between Paste ID: WH7TACYB and i1J2Vccr
SHOW: | | - or go back to the newest paste.
1-
local autoAnvil=peripheral.wrap("powered_tile_3")
1+
local autoAnvil=peripheral.wrap("powered_tile_0")
2
local filingCabinet=peripheral.wrap("bottom")
3
4
while true do
5
	local breakloop=0
6
	
7
	for cnt = 1, filingCabinet.getInventorySize()-1, 1 do
8
   		local item=filingCabinet.getStackInSlot(cnt)
9
		print(item["enchanted_book"][1]["fullName"])
10
		if (item["enchanted_book"][1]["fullName"] == "Punch II") then 
11
			print("Max Enchantment level. Storing book\n")
12-
			filingCabinet.pushItem("down",cnt,item["qty"])
12+
			filingCabinet.pushItem("south",cnt,item["qty"])
13
			breakloop=1
14
			break
15
		end
16
		if (item["enchanted_book"][1]["fullName"] == "Luck of the Sea III") then 
17
			print("Max Enchantment level. Storing book\n")
18-
			filingCabinet.pushItem("down",cnt,item["qty"])
18+
			filingCabinet.pushItem("south",cnt,item["qty"])
19
			breakloop=1
20
			break
21
		end
22
		if (item["enchanted_book"][1]["fullName"] == "Haste III") then 
23
			print("Max Enchantment level. Storing book\n")
24-
			filingCabinet.pushItem("down",cnt,item["qty"])
24+
			filingCabinet.pushItem("south",cnt,item["qty"])
25
			breakloop=1
26
			break
27
		end
28
		if (item["enchanted_book"][1]["fullName"] == "Unstable III") then 
29
			print("Max Enchantment level. Storing book\n")
30-
			filingCabinet.pushItem("down",cnt,item["qty"])
30+
			filingCabinet.pushItem("south",cnt,item["qty"])
31
			breakloop=1
32
			break
33
		end
34
		if (item["enchanted_book"][1]["fullName"] == "Flaming Spikes III") then 
35
			print("Max Enchantment level. Storing book\n")
36-
			filingCabinet.pushItem("down",cnt,item["qty"])
36+
			filingCabinet.pushItem("south",cnt,item["qty"])
37
			breakloop=1
38
			break
39
		end
40
		if (item["enchanted_book"][1]["fullName"] == "Knockback II") then 
41
			print("Max Enchantment level. Storing book\n")
42-
			filingCabinet.pushItem("down",cnt,item["qty"])
42+
			filingCabinet.pushItem("south",cnt,item["qty"])
43
			breakloop=1
44
			break
45
		end
46
		if (item["enchanted_book"][1]["fullName"] == "Retaliatory Kick IV") then 
47
			print("Max Enchantment level. Storing book\n")
48-
			filingCabinet.pushItem("down",cnt,item["qty"])
48+
			filingCabinet.pushItem("south",cnt,item["qty"])
49
			breakloop=1
50
			break
51
		end
52
		if (item["enchanted_book"][1]["fullName"] == "enchantment.magicresist V") then 
53
			print("Max Enchantment level. Storing book\n")
54-
			filingCabinet.pushItem("down",cnt,item["qty"])
54+
			filingCabinet.pushItem("south",cnt,item["qty"])
55
			breakloop=1
56
			break
57
		end
58
		if (item["enchanted_book"][1]["fullName"] == "Respiration III") then 
59
			print("Max Enchantment level. Storing book\n")
60-
			filingCabinet.pushItem("down",cnt,item["qty"])
60+
			filingCabinet.pushItem("south",cnt,item["qty"])
61
			breakloop=1
62
			break
63
		end
64
		if (item["enchanted_book"][1]["fullName"] == "Thorns III") then 
65
			print("Max Enchantment level. Storing book\n")
66-
			filingCabinet.pushItem("down",cnt,item["qty"])
66+
			filingCabinet.pushItem("south",cnt,item["qty"])
67
			breakloop=1
68
			break
69
		end
70
		if (item["enchanted_book"][1]["fullName"] == "Power V") then 
71
			print("Max Enchantment level. Storing book\n")
72-
			filingCabinet.pushItem("down",cnt,item["qty"])
72+
			filingCabinet.pushItem("south",cnt,item["qty"])
73
			breakloop=1
74
			break
75
		end
76
		if (item["enchanted_book"][1]["fullName"] == "Blast Protection IV") then 
77
			print("Max Enchantment level. Storing book\n")
78-
			filingCabinet.pushItem("down",cnt,item["qty"])
78+
			filingCabinet.pushItem("south",cnt,item["qty"])
79
			breakloop=1
80
			break
81
		end
82
		if (item["enchanted_book"][1]["fullName"] == "Protection IV") then 
83
			print("Max Enchantment level. Storing book\n")
84-
			filingCabinet.pushItem("down",cnt,item["qty"])
84+
			filingCabinet.pushItem("south",cnt,item["qty"])
85
			breakloop=1
86
			break
87
		end
88
		if (item["enchanted_book"][1]["fullName"] == "Magic Protection IV") then 
89
			print("Max Enchantment level. Storing book\n")
90-
			filingCabinet.pushItem("down",cnt,item["qty"])
90+
			filingCabinet.pushItem("south",cnt,item["qty"])
91
			breakloop=1
92
			break
93
		end
94
		if (item["enchanted_book"][1]["fullName"] == "Soulbound I" or item["enchanted_book"][1]["fullName"] == "enchantment.soulbound I") then 
95
			print("Max Enchantment level. Storing book\n")
96-
			filingCabinet.pushItem("down",cnt,item["qty"])
96+
			filingCabinet.pushItem("south",cnt,item["qty"])
97
			breakloop=1
98
			break
99
		end
100
		if (item["enchanted_book"][1]["fullName"] == "Unbreaking III") then 
101
			print("Max Enchantment level. Storing book\n")
102-
			filingCabinet.pushItem("down",cnt,item["qty"])
102+
			filingCabinet.pushItem("south",cnt,item["qty"])
103
			breakloop=1
104
			break
105
		end
106
		if (item["enchanted_book"][1]["fullName"] == "Flame I") then 
107
			print("Max Enchantment level. Storing book\n")
108-
			filingCabinet.pushItem("down",cnt,item["qty"])
108+
			filingCabinet.pushItem("south",cnt,item["qty"])
109
			breakloop=1
110
			break
111
		end
112
		if (item["enchanted_book"][1]["fullName"] == "Auto-Smelt I") then 
113
			print("Max Enchantment level. Storing book\n")
114-
			filingCabinet.pushItem("down",cnt,item["qty"])
114+
			filingCabinet.pushItem("south",cnt,item["qty"])
115
			breakloop=1
116
			break
117
		end
118
		if (item["enchanted_book"][1]["fullName"] == "Feather Falling IV") then 
119
			print("Max Enchantment level. Storing book\n")
120-
			filingCabinet.pushItem("down",cnt,item["qty"])
120+
			filingCabinet.pushItem("south",cnt,item["qty"])
121
			breakloop=1
122
			break
123
		end
124
		if (item["enchanted_book"][1]["fullName"] == "Lure III") then 
125
			print("Max Enchantment level. Storing book\n")
126-
			filingCabinet.pushItem("down",cnt,item["qty"])
126+
			filingCabinet.pushItem("south",cnt,item["qty"])
127
			breakloop=1
128
			break
129
		end
130-
		if (item["enchanted_book"][1]["fullName"] == "Sharpness V") then 
130+
131
			print("Max Enchantment level. Storing book\n")
132-
			filingCabinet.pushItem("down",cnt,item["qty"])
132+
			filingCabinet.pushItem("south",cnt,item["qty"])
133
			breakloop=1
134
			break
135
		end
136
		if (item["enchanted_book"][1]["fullName"] == "Fire Protection IV") then 
137
			print("Max Enchantment level. Storing book\n")
138-
			filingCabinet.pushItem("down",cnt,item["qty"])
138+
			filingCabinet.pushItem("south",cnt,item["qty"])
139
			breakloop=1
140
			break
141
		end
142
		if (item["enchanted_book"][1]["fullName"] == "Aqua Affinity I") then 
143
			print("Max Enchantment level. Storing book\n")
144-
			filingCabinet.pushItem("down",cnt,item["qty"])
144+
			filingCabinet.pushItem("south",cnt,item["qty"])
145
			breakloop=1
146
			break
147
		end
148
		if (item["enchanted_book"][1]["fullName"] == "Withering I" or item["enchanted_book"][1]["fullName"] == "Withering  I") then 
149
			print("Max Enchantment level. Storing book\n")
150-
			filingCabinet.pushItem("down",cnt,item["qty"])
150+
			filingCabinet.pushItem("south",cnt,item["qty"])
151
			breakloop=1
152
			break
153
		end
154
		if (item["enchanted_book"][1]["fullName"] == "Poisonous Barbs I") then 
155
			print("Max Enchantment level. Storing book\n")
156-
			filingCabinet.pushItem("down",cnt,item["qty"])
156+
			filingCabinet.pushItem("south",cnt,item["qty"])
157
			breakloop=1
158
			break
159
		end
160
		if (item["enchanted_book"][1]["fullName"] == "Infinity I") then 
161
			print("Max Enchantment level. Storing book\n")
162-
			filingCabinet.pushItem("down",cnt,item["qty"])
162+
			filingCabinet.pushItem("south",cnt,item["qty"])
163
			breakloop=1
164
			break
165
		end
166
		if (item["enchanted_book"][1]["fullName"] == "XP Boost III") then 
167
			print("Max Enchantment level. Storing book\n")
168-
			filingCabinet.pushItem("down",cnt,item["qty"])
168+
			filingCabinet.pushItem("south",cnt,item["qty"])
169
			breakloop=1
170
			break
171
		end
172
		if (item["enchanted_book"][1]["fullName"] == "Last Stand II") then 
173
			print("Max Enchantment level. Storing book\n")
174-
			filingCabinet.pushItem("down",cnt,item["qty"])
174+
			filingCabinet.pushItem("south",cnt,item["qty"])
175
			breakloop=1
176
			break
177
		end
178
   		if (item["qty"] >1 ) then
179
			print("Sending item to auto-anvil to combine.")
180-
			filingCabinet.pushItem("down",cnt,item["qty"])
180+
   			filingCabinet.pushItemIntoSlot("east",cnt,1,1)
181
        	filingCabinet.pushItemIntoSlot("east",cnt,1,2)
182
			while( autoAnvil.getStackInSlot(1) ~= nil and autoAnvil.getStackInSlot(2) ~=nil ) do
183
				sleep(0)
184
			end
185
			autoAnvil.pushItem("west",3)
186-
   			filingCabinet.pushItemIntoSlot("west",cnt,1,1)
186+
187-
        	filingCabinet.pushItemIntoSlot("west",cnt,1,2)
187+
188
   		end
189
		if (item['qty']<2 and breakloop==1) then sleep(3) end
190
   		if (breakloop==1) then break end
191-
			autoAnvil.pushItem("east",3)
191+
192
end