This commit is contained in:
kepler155c@gmail.com
2018-12-22 22:09:59 -05:00
parent 9104b915af
commit e69d68c7b4
5 changed files with 70 additions and 51 deletions

View File

@@ -1,42 +0,0 @@
local Config = require('config')
local GPS = require('gps')
local turtle = _G.turtle
local Home = { }
function Home.go()
local config = { }
Config.load('gps', config)
if config.home then
if turtle.enableGPS() then
return turtle.pathfind(config.home)
end
end
end
function Home.set()
local config = { }
Config.load('gps', config)
local pt = GPS.getPoint()
if pt then
local originalHeading = turtle.point.heading
local heading = GPS.getHeading()
if heading then
local turns = (turtle.point.heading - originalHeading) % 4
pt.heading = (heading - turns) % 4
config.home = pt
Config.update('gps', config)
pt = GPS.getPoint()
pt.heading = heading
turtle.setPoint(pt, true)
turtle._goto(config.home)
return config.home
end
end
end
return Home

View File

@@ -63,8 +63,6 @@ local PICKAXE = 'minecraft:diamond_pickaxe'
local DIRT = 'minecraft:dirt:0'
local FURNACE = 'minecraft:furnace:0'
local MODEM = 'computercraft:peripheral:1'
local LEAVES = 'minecraft:leaves'
local LEAVES2 = 'minecraft:leaves2'
local LOG = 'minecraft:log'
local LOG2 = 'minecraft:log2'
local OAK_LOG = 'minecraft:log:0'

View File

@@ -161,7 +161,7 @@ end
function page:filterMachines(machine)
local t = Util.filter(context.storage.nodes, function(node)
if node.category == 'machine' then
if node.category == 'machine' or node.category == 'custom' then -- TODO: - need a setting instead (ie. canCraft)
return node.adapter and node.adapter.online and node.adapter.pushItems
end
end)

40
miners/help/scanningMiner Normal file
View File

@@ -0,0 +1,40 @@
A very efficient mining program utilizing Plethora's block scanner.
Requirements
============
* Advanced Turtle
* Diamond Pickaxe
* Ender Modem
* Block Scanner
* Bucket
* Ability to connect remotely (neural interface or pocket computer)
* GPS
Setup
=====
The turtle is meant to be accessed via VNC (see the Wireless Networking help topic).
Provide the turtle with roughly 1000 fuel. The turtle will refuel while mining with either lava or fuel (mainly lava once found).
Place the turtle at the center of the area you would like to mine. For best performance, set the turtle at a Y location that is a multiple of 16 (16, 32, 48, 64, etc). Place into the turtle the diamond pickaxe, block scanner, ender modem, cobblestone, and bucket. Additionally, add any blocks that you want to exclude from mining (such as stone, gravel, etc). Run:
> scanningMiner
Options
=======
-c : number of chunks to mine
-s : add additional blocks to ignore
Any time the turtle restarts, the program will restart and continue mining where it left off. The startup program is usr/autorun/scanningMiner.lua.
Remote Access
=============
While the miner is running, you can update the blocks to exclude. Select a block and hit 'Ignore' in the menubar. The abort button will cause the miner to stop mining and return to the starting point. Note that the abort may not be immediate.
Changing mining locations
=========================
If you move the miner to a new location, remove the usr/config/scanning_miner.progress file.
Config file
===========
The ignore blocks are added to usr/config/mining.dictionary. This file can be edited if needed.

View File

@@ -1,14 +1,37 @@
local Config = require('config')
local Event = require('event')
local Project = require('neural.project')
local UI = require('ui')
local Util = require('util')
local Config = require('config')
local Event = require('event')
local Peripheral = require('peripheral')
local Project = require('neural.project')
local UI = require('ui')
local Util = require('util')
local device = _G.device
local peripheral = _G.peripheral
local turtle = _G.turtle
local function equip(side, item, rawName)
if turtle then
local equipped = Peripheral.lookup('side/' .. side)
if equipped and equipped.type == item then
return equipped
end
if turtle.equip(side, rawName or item) then
equipped = Peripheral.lookup('side/' .. side)
end
turtle.select(1)
return equipped
end
end
local ni = device.neuralInterface
local sensor = ni or device['plethora:sensor'] or peripheral.find('manipulator')
local sensor = ni or
device['plethora:sensor'] or
peripheral.find('manipulator') or
equip('left', 'pletora:sensor', 'plethora:module:3')
if not sensor or not sensor.sense then
error('Plethora sensor must be equipped')
end