Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local xp = peripheral.wrap("right")
- local modem = peripheral.wrap("back")
- local Attaque = true
- local AutoCollect = false
- local livre = 0
- local slot = 1
- local level = 0
- local Count = 0
- function Attack()
- while Attaque == true then
- turtle.attack()
- end
- end
- xp.setAutoCollect(true)
- function Clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- while true do
- level = xp.getLevels()
- turtle.attack()
- Count = Count+1
- if turtle.getItemCount(14) > 0 then
- for i=1,14 do
- turtle.select(slot)
- turtle.dropDown()
- slot = slot+1
- end
- slot = 1
- turtle.select(1)
- elseif Count >= 10 then
- Clear()
- term.write("Niveau :" ..level)
- Count = 0
- elseif level >= 30 then
- Clear()
- term.write("Demande Comfirmation !")
- while true do
- local event, side, Xpos, Ypos = os.pullEvent("monitor_touch")
- if event == "monitor_touch" and side == "top" then
- Clear()
- term.write("Enchantement en cours")
- turtle.select(15)
- turtle.transferTo(16,1)
- livre = turtle.getItemCount(15)
- if livre == 0 then
- turtle.turnRight()
- turtle.suck()
- turtle.turnLeft()
- livre = turtle.getItemCount(15)
- end
- term.write("Livres :"..livre)
- turtle.select(16)
- xp.enchant(30)
- turtle.dropDown()
- turtle.select(1)
- os.reboot()
- else
- sleep(0,5)
- print("nothing")
- end
- end
- else
- print(" ")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment