View difference between Paste ID: Zw0YBN8n and jS94xNke
SHOW: | | - or go back to the newest paste.
1
function counter()
2
 local i = 0
3
 return function() i = i + 1 return i end
4
end
5
function modStr(num)
6
 if num < 10 then
7
   return "0" .. num
8
 else
9
   return num
10
 end
11
end
12
while true do
13
 if turtle.detect() then
14
  turtle.dig()
15
  term.clear()
16
  term.setCursorPos(1,1)
17
  local total = 0
18
  for i=1,16,1 do
19
   total = total + turtle.getItemCount(i)
20
  end
21
  print("Lacznie: " .. total)
22
  print("-----------------")
23
  local iterator = counter()
24
  print(" ___ ___ ___ ___ ")
25
  print("|" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |")
26
  print("|___|___|___|___|")
27
  print("|" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |")
28
  print("|---|---|---|---|")
29
  print("|" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |")
30
  print("|---|---|---|---|")
31
  print("|" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |")
32
  print("|___|___|___|___|")
33
  print(" ")
34
  print("-----------------")
35
  print("Generator Cobblestone")
36
  print("     by se7en")
37
 end
38
 totalcount = turtle.getItemCount(16)
39
 if totalcount == 64 then
40
  term.clear()
41
  term.setCursorPos(1,1)
42
  print("Wyrzucanie stackow")
43
  print("...Prosze czekac.")
44
  sleep(1)
45
  for i=1,16 do
46
   turtle.select(i)
47
   turtle.drop()
48
  end
49
  turtle.select(1)
50
 end
51
end