sensor update

This commit is contained in:
kepler155c@gmail.com
2018-12-29 23:32:20 -05:00
parent d2deddcf99
commit d4b8ffb978
6 changed files with 140 additions and 7 deletions

70
builder/help/builder Normal file
View File

@@ -0,0 +1,70 @@
Builds structures using schematic files with a turtle or a command computer. Schematics can be downloaded from sites such as http://www.planetminecraft.com.
Requirements
============
* Advanced Mining Turtle
* Chest (any type)
* Wrench (any mod)
Alternatively
* Command Computer
* Chest (any type)
Installation
============
> pastebin run uzghlbnc
> package install core
> package install builder
> reboot
Setup
=====
Place the turtle or command computer on top of a chest at the corner of the build location.
Copy a schematic file to the turtle/command computer (see downloading instructions if on a server)
Building
========
Run:
> builder <schematic file>
The first time you run the program, you must select a wrench. Place a wrench into the chest. Go to the supplies list and double-click the SelectAWrench item. Select the wrench and apply.
If interrupted during building, you can resume by placing the turtle back in the original location and restarting the program.
Wrenches
========
EnderIO, Thermal Expansion, and Applied Energistics wrenches will work (only wrenches that can spin pistons will work).
To determine if a wrench can be used, right click the side of a piston with the wrench. If the piston rotates, then the wrench can be used. Some wrenches work better than others.
Downloading schematics
======================
Single Player
-------------
Simply copy a schematic file into the computer's folder.
Multiplayer
-----------
Option 1: Use wget if the schematic is available for download (unreliable).
Option 2: Transferring via pastebin (reliable)
To create a base64 file from a command line, do:
* linux / max:
base64 -w0 NAME.schematic > NAME.schematic.base64
* windows (I haven't tried this - but google said this will work):
certutil -encode NAME.schematic tmp.b64 && findstr /v /c:- tmp.b64 > NAME.schematic.base64
Upload the base64 file to pastebin.
To download and convert the base64 file back into a schematic file, do:
> base64dl.lua <filename> <url>
You can download a simple test schematic using:
> base64dl.lua chicken.schematic https://pastebin.com/raw/vxpHBUky

View File

@@ -150,6 +150,7 @@ function Craft.craftRecipe(recipe, count, inventoryAdapter)
count = count - maxCount
until count <= 0
clearGrid(inventoryAdapter)
turtle.select(1)
return crafted * recipe.count
end

View File

@@ -15,7 +15,7 @@ local FUEL_GOOD = FUEL_BASE + 2000
local MIN_CHARCOAL = 24
local MIN_SAPLINGS = 32
local MAX_SAPLINGS = 64
local MAX_SAPLINGS = 48
local GRID = {
TL = { x = 8, y = 0, z = -7 },
@@ -740,7 +740,7 @@ local tasks = {
{ desc = 'Snacking', fn = eatSaplings },
{ desc = 'Making charcoal', fn = makeSingleCharcoal },
{ desc = 'Making charcoal', fn = makeCharcoal },
-- { desc = 'Placing torches', fn = placeTorches },
--{ desc = 'Placing torches', fn = placeTorches },
{ desc = 'Refueling', fn = refuel },
{ desc = 'Dropping off items', fn = dropOffItems },
{ desc = 'Condensing', fn = turtle.condense },

51
miners/help/simpleMiner Normal file
View File

@@ -0,0 +1,51 @@
A miner requiring few resources to start automated mining on day 1. Additional miners can be added to increase the amount of resources collected. The miner will mine chunks in a spiral around the central starting point.
Requirements
============
* Turtle (standard or advanced)
* Diamond Pickaxe
* Bucket
* Cobblestone
* Chest (any kind)
Setup
=====
> pastebin run uzghlbnc
> package install miners
> reboot
Provide the turtle with roughly 1000 fuel. The turtle will refuel while mining with either lava or coal (mainly lava once found).
Place the turtle at the center of the area you would like to mine. Place a chest above the turtle.
Equip the turtle with a diamond pickaxe, and place into the inventory the cobblestone and bucket. Additionally, add any blocks that you want to exclude from mining (such as stone, gravel, etc).
To start mining, run:
> simpleMiner
Options:
-c : number of chunks to mine
-s : add additional blocks to ignore
-r : resume mining
This turtle will NOT resume mining automatically. It is recommended to stop mining before leaving the session (or the mining area). To stop the turtle from mining, break the drop off chest that was placed above the turtle initially. When the turtle attempts to drop off items, it will detect the missing chest and stop mining.
Alternatively, when you gather enough resources, you can equip the miner with a modem and send an abort command to the turtle to stop mining (abort command can be sent from the Turtles program).
Additional Miners
=================
To add additional miners, place any new miners in a spot that the first turtles has already mined (indicated by the cobble on the floor).
Locating a Lost Miner
=====================
During mining, the turtle will place a cobblestone block above the column being mined to indicate that the spot is being actively mined. To find the turtle, located the cobblestone block in this position and dig down to the miner.
Changing mining locations
=========================
If you move the miner to a new location, remove the usr/config/miner.progress file.
Config file
===========
The ignore blocks are added to usr/config/mining.trash. This file can be edited if needed.

View File

@@ -12,6 +12,7 @@ local function equip(side, rawName)
return turtle and turtle.equip(side, rawName) and peripheral.wrap(side)
end
local target = nil
local ni = device.neuralInterface
local sensor = ni or
device['plethora:sensor'] or
@@ -57,7 +58,8 @@ local page = UI.Page {
detail = UI.SlideOut {
menuBar = UI.MenuBar {
buttons = {
{ text = 'Back', event = 'hide' },
{ text = 'Projector', event = 'project-target' },
{ text = 'Back', event = 'hide', x = -6 },
},
},
grid = UI.ScrollingGrid {
@@ -131,6 +133,7 @@ function page:eventHandler(event)
elseif event.type == 'detail' or event.type == 'grid_select' then
local selected = self.grid:getSelected()
if selected then
target = selected.name
self.detail:show(selected)
end
@@ -144,7 +147,11 @@ function page:eventHandler(event)
end
Config.update('Entities', config)
elseif event.type == 'project' then
elseif event.type == 'project' or event.type == 'project-target' then
if event.type == 'project' then
target = nil
end
config.projecting = not config.projecting
if config.projecting then
Project:init(ni.canvas())
@@ -164,7 +171,11 @@ Event.onInterval(.5, function()
if config.projecting then
local meta = ni.getMetaOwner()
Project.canvas:clear()
Project:drawPoints(meta, entities, 'X', 0xFFDF50AA)
local t = entities
if target then
t = Util.filter(entities, function(e) return e.name == target end)
end
Project:drawPoints(meta, t, 'X', 0xFFDF50AA)
end
if config.totals then

View File

@@ -65,8 +65,8 @@ local function hover()
local pitch = 295
local yaw = yap(wp.x - pt.x, wp.y, wp.z - pt.z)
if pt.y < wp.y + 16 and meta.motionY < 0 then
ni.launch(yaw, pitch, math.min(4, math.min(4, -meta.motionY * math.abs(pt.y - (wp.y + 16)) / 2)))
if pt.y < wp.y + 100 and meta.motionY < 0 then
ni.launch(yaw, pitch, math.min(4, math.min(4, -meta.motionY * math.abs(pt.y - (wp.y + 100)) / 2)))
end
until distance(wp, pt) < 2