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

Total Ticks for Falling Gravel

Started by LicenseTooThrill, 06 August 2015 - 03:20 AM
LicenseTooThrill #1
Posted 06 August 2015 - 05:20 AM
Hello, Experts and Professionals alike!

I made a simple program that mines an array of blocks based on width, depth, and height.

To combat early turning due to gravel and sand, I created a loop as follows:

function safetycheck
while there is a block in front of you,
break it
wait 1 second
(this allows time for gravel and sand to fall, so the loop can repeat until the falling blocks are depleted)
end the while
function closed

However, waiting 1 second makes my mining sluggish :(/>

I was wondering if anybody knew the exact amount of ticks it took for gravel and sand to fall, so I could shorten my wait time in the loop to just 1 tick longer.

This would speed up the program execution immensely, I believe.

Please note: I went to "ask a pro" and searched "gravel" and "gravel ticks", and stopped browsing after 5 results pages and dozens of threads that I skimmed, with no results.
The official MC Wiki page for Gravel does not say either, and just short of deobfuscating the actual source code, I'm not sure what to do.

Thanks for the help,
~John
HPWebcamAble #2
Posted 06 August 2015 - 05:36 AM
You don't need to wait for the gravel / sand to fall, just continue to mine until the turtle is able to move

while not turtle.forward() do
  turtle.dig()
end

Don't worry about the turtle moving under a falling block, I don't think it can happen


EDIT: missed the () for turtle.forward
Edited on 07 August 2015 - 02:32 AM
LicenseTooThrill #3
Posted 07 August 2015 - 01:45 AM
Aah that makes much more sense. Very concise, I like it… or should I say I dig it? ha.

Thank you sir!