MrDj200

BotaniaEssensBlume

Jan 6th, 2016
687
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. local time = 9
  2. local dropCount = 1
  3.  
  4.  
  5. -------------------
  6.  
  7.  
  8. function check(a)
  9.     cnt = turtle.getItemCount(a)
  10.     return cnt
  11. end
  12.  
  13. function empty()
  14.     for i=1, 16, 1 do
  15.         if check(i) == 0 then
  16.             return true
  17.         end
  18.        
  19.         return false
  20.     end
  21. end
  22.  
  23. function drop()
  24.     curSlot = turtle.getSelectedSlot()
  25.  
  26.     while check(curSlot) == 0 do
  27.         if curSlot == 16 then
  28.             curSlot = 0
  29.         end
  30.         turtle.select(curSlot + 1)
  31.         curSlot = turtle.getSelectedSlot()
  32.     end
  33.     turtle.dropDown(dropCount)
  34.  
  35. end
  36.  
  37. function msg()
  38.     while empty() == true do
  39.         shell.run("clear")
  40.         print("Bitte Nahrung auffuellen!")
  41.         sleep(1)
  42.     end
  43. end
  44.  
  45. while true do
  46.     msg()
  47.     for i=time, 0, -1 do
  48.         shell.run("clear")
  49.         print("Running")
  50.         print("Next drop in "..i.." seconds.")
  51.         msg()
  52.         sleep(1)
  53.         if i==0 then
  54.             sleep(1)
  55.             drop()
  56.         end
  57.     end
  58.    
  59. end
Advertisement
Add Comment
Please, Sign In to add comment