Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not fs.exists("startup") then
- fs.copy("disk/startup", "startup")
- end
- m = peripheral.wrap("right")
- m.setAutoCollect(true)
- while true do
- turtle.attack()
- local xp = m.getLevels()
- local rawXP = m.getXP()
- local kills = rawXP/5
- term.clear()
- term.setCursorPos(14,5)
- print("Level: "..xp.."/30")
- local x = 2
- if xp <= 15 then
- local nextLevel = 17 * (xp+1)
- term.setCursorPos(9,6)
- print("Current RawXP: "..rawXP.."/"..nextLevel)
- term.setCursorPos(9,7)
- print("Estimated Kills: "..kills)
- repeat
- turtle.select(x)
- turtle.dropDown()
- x = x + 1
- until x == 16
- elseif xp <= 29 then
- local level = xp + 1
- local nextLevel = 1.5 * level * level - 29.5 * level + 360
- term.setCursorPos(9,6)
- print("Current RawXP: "..rawXP.."/"..nextLevel)
- term.setCursorPos(9,7)
- print("Estimated Kills: "..kills)
- repeat
- turtle.select(x)
- turtle.dropDown()
- x = x + 1
- until x == 16
- elseif xp >= 30 then
- turtle.select(1)
- m.enchant(30)
- local x = 1
- repeat
- local nonBook = turtle.getItemSpace(x)
- turtle.select(x)
- turtle.dropDown()
- turtle.select(16)
- local compare = turtle.compareTo(1)
- if not compare then
- turtle.transferTo(1,1)
- end
- x = x + 1
- until x == 16
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment