View difference between Paste ID: SubBPnKM and R1jes23i
SHOW: | | - or go back to the newest paste.
1
m = peripheral.wrap("right")
2
m.setAutoCollect(true)
3
local currLevel = 0
4
5
function enchantBook()
6
   turtle.select(1)
7
   turtle.suck()
8
   turtle.drop(turtle.getItemCount(1)-1)
9
   m.enchant(30)
10
   turtle.drop()   
11
end
12
13
--print(m.getLevels())
14
--enchantBook()
15
16
while true do
17
   currLevel = m.getLevels()
18
   print("Currently Level: "..currLevel)
19
   if currLevel >=30 then
20
      enchantBook()
21
   else
22
      sleep(10)
23
   end
24
end