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

[Release]AdvanceTurtle Tunnel Miner

Started by cory1234567, 16 January 2013 - 05:41 PM
cory1234567 #1
Posted 16 January 2013 - 06:41 PM
to use: advTunnel [distance]

he will dig a 3X3 tunnel it will also place torches every 10 blocks u must have an ender chest for this to work place the ender chest in Slot 14 torches in 15 and fuel in 16 if u dont put torches in slot 15 u will not get errors he will just not put them down the checking inventory isnt quite working the way i want it to atm but i will still be working on this code and updateing this post as i add/fix things Torches will be placed on the right of the turtle and when it places the ender chest down to drop off items it will place it on the left

[attachment=923:2013-01-16_02.09.06.png]

V2: http://pastebin.com/TpA6LdJJ or use
pastebin get TpA6LdJJ

with Version 2 i have made it so that torch placing is now configable
look for local torch = 10 this will place a torch down every 10 blocks change the 10 to what ever you want it to be

also when a turtle is done or the program canaceled the count is reduced to 0 again so he will start all over when placing torches

Older Version are in the spoiler
SpoilerV1: http://pastebin.com/fznuxGg0 or use
pastebin get fznuxGg0
advTunnel in your turtle GUI

anyway i can improve on the code please post below im looking for better ways to do codeing as im still very new to lua
Edited on 20 January 2013 - 02:49 PM
Yusunoha #2
Posted 20 January 2013 - 09:40 AM
hmm, I have no coding knowledge, though I tried looking at the problem, but I can't solve it.
whenever I run the script I get a 55: 'for' limit must be a number error
cory1234567 #3
Posted 20 January 2013 - 09:42 AM
hmm, I have no coding knowledge, though I tried looking at the problem, but I can't solve it.
whenever I run the script I get a 55: 'for' limit must be a number error

after advTunnel u need a number the number will be how many blocks the turtle will go
ex.advTunnel 32
he will tunnel in 32 blocks
Yusunoha #4
Posted 20 January 2013 - 09:48 AM
yup, that worked. I set it as a startup program so I guess that was giving me the problem.
sjele #5
Posted 20 January 2013 - 10:28 AM
You could easyli fix that for limit must be a number error by checking the lenght of tArgs.

if #tArgs ~= 1 then
  print("Useage advTunnel <dist>")
  return
end
cory1234567 #6
Posted 20 January 2013 - 02:14 PM
thanks sjele i never could figure out how to do that i will add it to the program and update the OP later today