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

Flint Machine

Started by mjhasdied1, 07 April 2014 - 04:30 PM
mjhasdied1 #1
Posted 07 April 2014 - 06:30 PM
Hello everyone, this program is for the people who dont want to manually place and break gravel for the flint you need in your recipes. basically you put the gravel in the first slot and you run the program and it will place and break the gravel, this is my first working program and im really happy that it finally works :)/> here is the link http://pastebin.com/GuCsZZUy

p.s if you want to stop it hold down ctrl + T because for some reason the part of it that stops it when the slot 1's item count is zero doesnt work…

Thank you for checking this out :)/>
CometWolf #2
Posted 07 April 2014 - 07:32 PM

local gravel = turtle.getItemCount(1) == 0
repeat
do flint() end
until gravel
Yeah that won't work because you're not checking the item count everytime the loop runs, just once when the program starts, also the do statement isn't needed.
oskar3123 #3
Posted 22 April 2014 - 08:29 PM
I wrote a script for you that even stops when the "flintin" is done :)/>

http://pastebin.com/08Vnc11S
Spoiler
local slot = 1

turtle.select(slot)

print("Starting to flint the gravel!")

while turtle.compareTo(2) ~= true do
  turtle.place()
  turtle.dig()
end

print("Finished flintin the gravel!")

You may use this as your own code, as it is far too simple to take any credit for :D/>

EDIT:

This should work just fine too and is WAY simpler :)/>

http://pastebin.com/eNmmcuWb
Spoiler
while turtle.place() do
  turtle.dig()
end
Edited on 22 April 2014 - 08:16 PM