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

[WIP] Simple mining Drill

Started by HNO3, 16 March 2016 - 07:06 AM
HNO3 #1
Posted 16 March 2016 - 08:06 AM
- This Program is not ready! -

A simple mining Drill, that drills down, collects the whitelisted Ores, goes up again and drops its Inventory in a Chest.

(This is my first Lua Project, so i apologize if my code is bad, and i'm not using Feature xyz)


Install:
Spoilerpastebin get jZp85wb7 drill

Setup:
Spoiler- Place the mining Turtle on the Ground
- Place the Chest in front of it
- Fuel up the Turtle
- Run the Program

ToDo:
Spoiler- closing the Holes (Done)
- selfrefueling System
- move Drill to next location
- optimize drillpattern
- optional Remote Status
- optional Remote Control

Compatible (Ore) mods:
Spoiler- Industrial Craft 2
- Tinkers Construct
- Harvestcraft
- Underground Biomes
- Applied Energistics 2
Edited on 18 March 2016 - 03:49 PM
Mirodin #2
Posted 18 May 2016 - 10:26 PM
This sounds like something I made as one of my first programs too. But this hugh if monster kills me, I would advise you to use a table for the whitelisting stuff and maybe also switching to a blacklist since in most cases there are only a few blocks you do not want like dirt and stone.

Maybe something along the lines of:

local blackist = {
  "minecraft:stone",
  "minecraft:dirt"
  -- and so on
}
local _blist = {}

-- Inverse blacklist for fast hashmap lookup
for i = 1, #blacklist do
  _blist[blacklist[i]] = true
end

-- Then you only need to check if the block is in the blacklist
temp, block = turtle.inspect()
if _blist[block["name"]] then
  -- do the mining
end

Cheers
Mirodin
Edited on 18 May 2016 - 08:34 PM
Sayinore #3
Posted 26 May 2016 - 12:22 PM
Thanks to your idea :)/>! That helps me a lot. I use your idea to improve my program and it gets better now.
See my program at https://github.com/Sayinore/Computer-Craft/blob/master/Miner.lua.
Thank you again! :P/>