Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap("right")
- m.setAutoCollect(true)
- local currLevel = 0
- local books = true
- function enchant()
- if turtle.getItemCount(16) > 0 then
- turtle.select(16)
- turtle.transferTo(1,1)
- turtle.select(1)
- m.enchant(30)
- local i = 1
- while i <= 15 do
- if turtle.getItemCount(i) == 0 then
- turtle.select(1)
- turtle.transferTo(i)
- i = 17
- else
- i = i + 1
- end
- if i == 16 then
- i = 1
- while i <= 15 do
- turtle.dropDown()
- i = i + 1
- end
- end
- else
- print("No more books")
- books = false
- end
- end
- while true do
- currLevel = m.getLevels()
- print ("Currently Level: "..currLevel)
- if currLevel >= 30 and books == true then
- enchant()
- else
- sleep(5)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement