Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- m=peripheral.wrap("right")
- m.setAutoCollect(true)
- turtle.select(1)
- local level = 0
- --
- function turnaround()
- turtle.turnRight()
- turtle.turnRight()
- end
- function check()
- if turtle.getItemCount(8) >0 then
- turnaround()
- for c = 1,8 do
- turtle.select(c)
- turtle.drop()
- end
- turnaround()
- turtle.select(1)
- end
- end
- function books()
- if turtle.getItemCount(16) == 0 then
- turtle.select(15)
- turtle.transferTo(16,1)
- end
- end
- function dropEnchant()
- turnaround()
- turtle.select(16)
- turtle.drop()
- turnaround()
- end
- function enchant()
- level = m.getLevels()
- if level >=30 then
- turtle.select(16)
- m.enchant(30)
- turtle.select(1)
- term.clear()
- dropEnchant()
- end
- end
- --Main
- while true do
- term.setCursorPos(1,1)
- print(m.getLevels())
- turtle.attack()
- turtle.suck()
- books()
- check()
- enchant()
- end
Advertisement
Add Comment
Please, Sign In to add comment