Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hb = true
- m=peripheral.wrap("right")
- m.setAutoCollect(true)
- local function getBook()
- hb = false
- turtle.turnLeft()
- turtle.select(1)
- turtle.suck()
- if turtle.getItemCount(1) > 1 then
- turtle.transferTo(2, 1)
- turtle.drop()
- hb = true
- end
- turtle.turnRight()
- end
- local function enchantBook()
- turtle.select(2)
- m.enchant(30)
- end
- local function dropBook()
- turtle.turnRight()
- turtle.select(2)
- if not turtle.drop() then
- print("No Space")
- turtle.turnLeft()
- os.shutdown()
- end
- turtle.turnLeft()
- end
- local function firstRun()
- while turtle.detect() do
- turtle.turnRight()
- end
- turtle.select(1)
- if turtle.getItemCount(2) > 1 then
- dropBook()
- end
- end
- firstRun()
- while hb do
- if m.getLevels() > 30 then
- getBook()
- enchantBook()
- dropBook()
- end
- os.sleep(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement