AlphaSheepPig

Simple XP Farm

Jun 18th, 2013
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. --[[
  2. Simple XP Farmer
  3. by AlphaSheepPig
  4.  
  5. Attacks anything that comes close, and drops
  6. loot in an overhead chest when full.
  7. ]]
  8.  
  9. function offLoad()
  10.     -- Offloads items into an overhead chest
  11.     for slot=1,16,1 do
  12.         turtle.select(slot)
  13.         turtle.dropUp()
  14.     end
  15.     turtle.select(1)
  16. end
  17.  
  18. function almostFull()
  19.     -- Returns true if one or no empty slots.
  20.     if turtle.getItemCount(14) > 0 then
  21.         return true
  22.     else
  23.         return false
  24.     end
  25. end
  26.  
  27. while true do
  28.     turtle.attack()
  29.     if almostFull() then
  30.         offLoad()
  31.     end
  32. end
Advertisement
Add Comment
Please, Sign In to add comment