Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getLvl()
- curLev = getLevels()
- return curLev
- end
- function checkLevel(nLvl)
- getLvl()
- if curLev<nLvl then
- printStatus("gathering XP", curLev)
- else
- printStatus("moving to enchant area", getLvl())
- run()
- end
- end
- function gotoenchant()
- turtle.select(1)
- turtle.down()
- turtle.down()
- turtle.down()
- turtle.down()
- turtle.turnLeft()
- if not turtle.compareDown() then
- turtle.forward()
- else
- turtle.turnRight()
- end
- forward()
- end
- end
- function forward()
- for i = 1, 10 do
- turtle.forward()
- end
- end
- function getItems()
- for i=3,14 do
- if turtle.getItemCount(i)>0 then
- turtle.select(i)
- turtle.transferTo(1,3)
- turtle.select(3)
- return true
- end
- end
- -- print("no items found, trying to find books")
- if findBook() then
- -- print("Books found")
- return true
- else
- return false
- end
- end
- function findBook()
- if turtle.getItemCount(15)>=1 then
- turtle.select(15)
- turtle.transferTo(1,3)
- turtle.select(3)
- return true
- else
- return false
- end
- end
- function enchant()
- enchant(30)
- turtle.dropDown()
- turtle.up()
- end
- function backtomid()
- for i = 1, 10 do
- turtle.back()
- end
- turtle.down()
- end
- function checkfuel()
- if turtle.getFuelLevel()<500 then
- getfuel()
- end
- end
- function getfuel()
- turtle.up()
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(16)
- turtle.suck(30)
- turtle.refuel()
- turtle.down()
- turtle.turnRight()
- turtle.turnRight()
- end
- function checkbook()
- if turtle.getItemCount(15)<4 then
- getbook()
- end
- end
- function getbook()
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(15)
- turtle.suck(30)
- turtle.turnRight()
- turtle.turnRight()
- end
- function home()
- turtle.select(2)
- turtle.turnRight()
- if not turtle.compareDown()
- turtle.forward()
- else
- turtle.turnLeft()
- turtle.up()
- turtle.up()
- turtle.up()
- turtle.up()
- end
- end
- setAutoCollect(true)
- nLvl=30
- function run()
- gotoenchant()
- getItems()
- enchant()
- backtomid()
- checkfuel()
- checkbook()
- home()
- end
- while true do
- checkLevel(nLvl)
- end
Advertisement
Add Comment
Please, Sign In to add comment