This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
IceCream's profile picture

Is this possibe? [Quarry & CC]

Started by IceCream, 21 September 2012 - 03:52 PM
IceCream #1
Posted 21 September 2012 - 05:52 PM
Is there anyway for a computer to know how many blocks the quarry had mined since it's first dirt block?
sjele #2
Posted 21 September 2012 - 06:10 PM
Yes, use an item detector and make a counter that counts redstone updates.
IceCream #3
Posted 21 September 2012 - 07:28 PM
Any tutorial on it?
sjele #4
Posted 21 September 2012 - 07:36 PM
The counter, count 1 up each time redstone signal gets activated:


count = 0 --What to start counting at
while true do --inf. loop
event = os.pullEvent --Checks/pauses until an event
if event == "redstone" then
if rs.getinput("side") then --Change side to what input side is
count = count + 1 --Add 1 too count
print(count) --prints what it is at
end --End if
end --End if
end --End while