Advertisement
Pinkishu

encht

Apr 22nd, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. ench = peripheral.wrap("left")
  2. anv = peripheral.wrap("right")
  3.  
  4. --ench.setAutoCollect(true)
  5.  
  6. function findSlot()
  7.   for i=2,16,1 do
  8. --    turtle.select(i)
  9.     if turtle.getItemCount(i) > 0 then return i end
  10.   end
  11. end
  12.  
  13. while true do
  14.   sleep(10)
  15.   ench.collect()
  16.   local lv = ench.getLevels()
  17.   local sl = findSlot()
  18.   local rlv = anv.getRepairCost(1,sl)
  19.   print("My Level: " .. lv)
  20.   print("Req LV: " .. rlv)
  21.   if lv > rlv then
  22.     anv.repair(1,sl)
  23.   end
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement