Advertisement
Muzze77

Turtle Berserker2k3

Apr 1st, 2014
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.18 KB | None | 0 0
  1. anz = 0
  2. schlaf = 0.05
  3. suckTime = schlaf
  4. count = 64
  5. side = "back"
  6. function cut()
  7.         sleep(schlaf)
  8.         shell.run("clear")
  9.         sleep(schlaf)
  10. end
  11. ----------------------------------------
  12. function suck()
  13.    
  14.         turtle.select(num)            
  15.     sleep(suckTime)
  16.         turtle.suckDown()
  17.     sleep(suckTime)
  18.     m = turtle.getItemCount(num)
  19.     sleep(suckTime)
  20.  
  21.     if m == 0 then
  22.     start()
  23.     else
  24.     m1 = m - 1
  25.     turtle.drop(m1)
  26.    
  27.     sleep(0.2)
  28.     anz = anz+1
  29.  
  30.     end
  31. end
  32.  
  33. function pull()
  34.     turtle.select(num)
  35.     sleep(suckTime)
  36.     turtle.drop()
  37. end
  38. ----------------------------------------
  39. function doIt()
  40.    
  41.     turtle.select(16)
  42.     sleep(suckTime)
  43.     turtle.craft(1)
  44.     sleep(suckTime)
  45.     turtle.dropUp(8)
  46.     print(" Gecraftete Items : " .. anz)
  47.     cut()
  48. end
  49.  
  50.  
  51. while true do
  52.     while rs.getInput(side) == true do
  53.    
  54.     function start()
  55.     num = 2
  56.     suck()
  57.     num = 3
  58.     pull()
  59.     num = 5
  60.     pull()
  61.     num = 6
  62.     pull()
  63.     num = 7
  64.     pull()
  65.     num = 8
  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.  
  87.     doIt() 
  88.     end
  89.     start()
  90.  
  91.     end
  92.     print("Kein Signal")
  93.     cut()
  94. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement