Advertisement
Muzze77

Coperal Crafty 1

Apr 1st, 2014
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.27 KB | None | 0 0
  1. -----------------------------------------------------
  2. -- Turtle Corperal Crafty1 -- (c) Muzze77 -----------
  3. -----------------------------------------------------
  4. anz = 0
  5. schlaf = 0.05
  6. count = 64
  7. side = "back"
  8. function cut()
  9.         sleep(schlaf)
  10.         shell.run("clear")
  11.         sleep(schlaf)
  12. end
  13. ----------------------------------------
  14. function suck()
  15.    
  16.         turtle.select(num)            
  17.     sleep(0.2)
  18.         turtle.suckDown()
  19.     sleep(0.2)
  20.     m = turtle.getItemCount(num)
  21.     sleep(0.2)
  22.  
  23.     if m == 0 then
  24.     shell.run("reboot")
  25.     else
  26.     m1 = m - 1
  27.     turtle.drop(m1)
  28.    
  29.     sleep(0.2)
  30.     anz = anz+1
  31.  
  32.     end
  33. end
  34.  
  35. function pull()
  36.     turtle.select(num)
  37.     sleep(0.3)
  38.     turtle.drop()
  39. end
  40. ----------------------------------------
  41. function doIt()
  42.    
  43.     turtle.select(16)
  44.     sleep(0.2)
  45.     turtle.craft()
  46.     sleep(0.2)
  47.     turtle.dropUp()
  48.     print(" Gecraftete Items : " .. anz)
  49.     cut()
  50. end
  51.  
  52.  
  53. while true do
  54.     while rs.getInput(side) == true do
  55.     num = 5
  56.     suck()
  57.     num = 2
  58.     pull()
  59.     num = 3
  60.     pull()
  61.     num = 4
  62.     pull()
  63.     num = 6
  64.     pull()
  65.     num = 7
  66.     pull()
  67.     num = 9
  68.     pull()
  69.     num = 10
  70.     pull()
  71.     num = 11
  72.     pull()
  73.     num = 12
  74.     pull()
  75.     num = 13
  76.     pull()
  77.     num = 14
  78.     pull()
  79.     num = 15
  80.     pull()
  81.     num = 16
  82.     pull()
  83.  
  84.  
  85.  
  86.     doIt() 
  87.    
  88.  
  89.  
  90.     end
  91.     print("Kein Signal")
  92.     cut()
  93. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement