Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local timeout = 1
- local xp = peripheral.wrap( "right" )
- xp.setAutoCollect(true)
- turtle.select(1)
- while true do
- turtle.attack()
- if turtle.getItemCount(1) > 0 then
- turtle.drop()
- end
- print("Current Level = "..xp.getLevels())
- if xp.getLevels() >= 30 then
- print("Enchanting a book")
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.suck()
- local amount = turtle.getItemCount(1)
- if amount > 1 then
- amount = amount - 1
- turtle.drop(amount)
- end
- xp.enchant( 30 )
- turtle.dropDown()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- sleep(timeout)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement