r/ComputerCraft • • Jun 21 '20

Simple cobblestone generator code

I'm new to ComputerCraft but I know how to code. I have a very simple program here that mines from a vanilla cobblestone generator (lava and water) and places it in an inventory above it.

The code works but I don't like the fact that it is busy waiting for the cobblestone to be generated. Is there any way for the code to sleep until a block is detected with the "detect()" command?

2 Upvotes

2 comments sorted by

1

u/nictheman123 Jun 21 '20

sleep(1)

The sleep command is helpful in CC

0

u/[deleted] Jun 21 '20

[deleted]

1

u/fatboychummy Jun 24 '20

adding a value to sleep in this case isnt even required, as sleep() defaults to 0.05