Advertisement
sinkir

lua turtle gold sword craft

Apr 2nd, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. --   _____
  2. --  |  ___|   _ _ __   ___
  3. --  | |_ | | | | '_ \ / __|
  4. --  |  _|| |_| | | | | (__
  5. --  |_|   \__,_|_| |_|\___|
  6. --
  7.  
  8.  
  9.  
  10. select = function(id)
  11.     return turtle.select(id)
  12. end
  13.  
  14. count = function(id)
  15.     return turtle.getItemCount(id)
  16. end
  17.  
  18. move = function(id, nb)
  19.     return turtle.transferTo(id, nb)
  20. end
  21.  
  22. function stuff()
  23.     turtle.craft()
  24.     turtle.drop()
  25.     i = i+1
  26.     print('Et de '..i..' !')
  27. end
  28.  
  29. --  __  __       _        ____
  30. -- |  \/  | __ _(_)_ __  / /\ \
  31. -- | |\/| |/ _` | | '_ \| |  | |
  32. -- | |  | | (_| | | | | | |  | |
  33. -- |_|  |_|\__,_|_|_| |_| |  | |
  34. --                       \_\/_/
  35.  
  36.  
  37.  
  38. stop=false
  39. i = 0
  40. select(1)
  41. while(stop==false)do
  42.     if(count(1)>0)then
  43.         if(count(2)>0)then
  44.             stuff()
  45.         else
  46.             if(turtle.suckDown()==true)then
  47.                 stuff()
  48.             end
  49.         end
  50.     else
  51.         if(turtle.suckDown()==true)then
  52.             if(turtle.suckDown()==true)then
  53.                 stuff()
  54.             end
  55.         end
  56.     end
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement