package management

This commit is contained in:
kepler155c
2018-11-03 18:14:11 -04:00
parent aa66b1c663
commit 1f7ef4a483
124 changed files with 1274 additions and 9 deletions

194
core/etc/apps/opus-apps.db Normal file
View File

@@ -0,0 +1,194 @@
{
[ "90ef98d4b6fd15466f0a1f212ec1db8d9ebe018c" ] = {
title = "Turtles",
category = "Apps",
icon = " \0305 \030c \0305 \030 \
\030d \030c \0305 \030c \0308 \030d\031f\"\
\0308\031f.\030 \031 \0308\031f.\030 \031 ",
iconExt = "\030 \031f\030f\031f\128\0305\135\030c\031c\128\128\0305\031f\139\0307\149\0308\0317\143\0307\128\
\030 \031f\030c\031f\145\031c\128\030d\132\136\030c\128\0307\149\0318\143\133\
\030 \031f\030f\031f\128\0317\143\031f\128\128\0317\143\031f\128\128\128",
run = "Turtles.lua",
},
[ "381e3298b2b8f6caeb2208b57d805ada38402f0b" ] = {
title = "Scripts",
category = "Apps",
icon = "\0300\0317if\031 \0307 \
\0300\0317turt\
\0300\0317retu",
iconExt = "\0300\0317if\140\140\140\
\0300\0317\140\031fthen\
\0300\0317else\140",
run = "Script.lua",
},
[ "7ef35cac539f84722b0a988caee03b2df734c56a" ] = {
title = "AppStore",
category = "System",
icon = "\030 \0310=\0300 \030 XX\0300\031f \030 \
\030 \031f \0300 \030 \
\030 \031f \0310o \031f \0310o\031f ",
iconExt = "\031e\139\0318\151\151\151\151\151\149\
\030 \031 \0308\031f\136\136\136\136\030f\0318\135\
\030 \031 \030f\0317\130\030 \031 \030f\0317\130",
run = "Appstore.lua",
},
[ "4486006f811b88cacd5f211fd579717e29b600cd" ] = {
title = "Miner",
category = "Apps",
icon = " \0315\\\030 \031 \
\0304\031f _ \030 \031c/\0315\\\
\0304 ",
run = "simpleMiner.lua",
requires = 'turtle',
},
[ "131260cbfbb0c821f8eae5e7c3c296c7aa4d50b9" ] = {
title = "Music",
category = "Apps",
icon = "\030 \031f === \
\030 \031f | |\
\030 \031fo| o|\
",
run = "usr/apps/Music.lua",
requires = 'turtle',
},
--[[
[ "81c0d915fa6d82fd30661c5e66e204cea52bb2b5" ] = {
title = "Activity",
category = "Apps",
icon = "\0318/\030f\031 \030 \0318\\\
\030f \0308\0319o\030f\031 \
\0318\\\030f\031 \030 \0318/",
run = "storageActivity.lua",
},
[ "89307d419a2fe4fbb69af92b3d3af27b6ec14d3e" ] = {
title = "Telnet",
category = "Apps",
icon = " \0314>\0310_\
\031f)))\031 \
\0314>\0310_\031 ",
run = "telnet.lua",
},
[ "8a77613b475e46064321fd7da18d126ee35e5066" ] = {
title = "VNC",
category = "Apps",
icon = "\
\031e\\\031 \031e/\031dn\
\031e\\/\031 \0319c",
run = "vnc.lua",
},
--]]
[ "a0365977708b7387ee9ce2c13e5820e6e11732cb" ] = {
title = "Pain",
category = "Apps",
icon = "\030 \031f\0307\031f\159\030 \159\030 \
\030 \031f\0308\031f\135\0307\0318\144\140\030f\0317\159\143\031c\139\0302\135\030f\0312\157\
\030 \031f\030f\0318\143\133\0312\136\0302\031f\159\159\143\131\030f\0312\132",
run = "http://pastebin.com/raw/wJQ7jav0",
},
[ "9e092dda4f0e27d0c7686ddd00272079e678b6e6" ] = {
title = "Storage",
category = "Apps",
icon = "\0307 \
\0307 \0308\0311 \0305 \0308\031 \0307 \0308 \0301 \
\0307 ",
run = "chestManager.lua",
requires = 'turtle',
},
[ "114edfc04a1ab03541bdc80ce064f66a7cfcedbb" ] = {
title = "Recorder",
category = "Apps",
icon = "\030 \031f \031b \031foo \
\030 \031f \030e\031b \030 \031f/\
\030 \031b \030e \030 \031f\\",
iconExt = "\030 \031f\030f\031f\128\030e\143\030f\031e\144\031f\128\0304\149\0307\0314\131\131\030f\149\
\030 \031f\030e\031f\129\031e\128\128\030f\148\0304\031f\149\0307\0318\140\140\030f\0314\149\
\030 \031f\030f\031e\139\030e\128\030f\159\129\0314\130\131\131\129",
run = "recorder.lua",
},
[ "131f0b008f44298812221d120d982940609be781" ] = {
title = "Builder",
category = "Apps",
icon = "\0317_____\
\030e\031c###\0308\0317=\030e\031c#\
\030e\031c#\0307\031f.\030e\031c###",
run = "usr/apps/builder.lua",
requires = "turtle",
},
[ "d8c298dd41e4a4ec20e8307901797b64688b3b77" ] = {
title = "GPS Deploy",
category = "Apps",
run = "http://pastebin.com/raw/VXAyXqBv",
requires = "turtle",
},
[ "53a5d150062b1e03206b9e15854b81060e3c7552" ] = {
title = "Minesweeper",
category = "Games",
icon = "\030f\031f \03131\0308\031f \030f\031d2\
\030f\031f \031d2\03131\0308\031f \030f\03131\
\030f\03131\0308\031f \030f\03131\031e3",
run = "https://pastebin.com/raw/nsKrHTbN",
},
[ "a2accffe95b2c8be30e8a05e0c6ab7e8f5966f43" ] = {
title = "Strafe",
category = "Games",
icon = "\0308\031f \0300 \0308 \
\0308\031f \0300 \030f \
\0300\031f \030f ",
iconExt = "\0308\0318\128\0300\159\129\0310\128\0308\159\129\0318\128\
\0300\0318\135\0310\128\128\030f\135\0300\031f\143\159\030f\0310\144\
\0300\128\030f\159\129\138\0300\031f\143\149\030f\0310\134",
run = "https://pastebin.com/raw/jyDH7mLH",
},
[ "48d6857f6b2869d031f463b13aa34df47e18c548" ] = {
title = "Breakout",
category = "Games",
icon = "\0301\031f \0309 \030c \030b \030e \030c \0306 \
\030 \031f \
\030 \031f \0300 \0310 ",
iconExt = "\030 \031f\030f\0319\144\030d\031f\159\030b\159\030f\0311\144\031b\144\030c\031f\159\030f\0311\144\
\030 \031f\030f\0311\130\031b\129\0319\130\031e\130\0310\144\031d\129\0316\129\
\030 \031f\030f\0310\136\140\140\030 ",
run = "https://gist.github.com/LDDestroier/c7528d95bc0103545c2a/raw",
},
--[[
[ "d78f28759f255a0db76604ee560b87c4715a0da5" ] = {
title = "Sketch",
category = "Apps",
icon = " \031bskch\
\0303\031f \030d \
\030d\031f ",
iconExt = "\030 \031f\0308\031f\151\0313\140\140\140\030f\0318\148\
\030 \031f\030b\031f\149\0318\130\131\129\030f\031b\149\
\030 \031f\030f\0318\138\0308\031b\130\131\129\030f\0318\133",
run = "http://pastebin.com/raw/Mm5hd97E",
},
]]
[ "58ec8d6e36e346d9f42eb43935652e3e58e2c829" ] = {
title = "Mwm",
category = "Apps",
icon = "\030f\031f \0304 \
\030f\031dshell]\0304\0314 \
\0304\031f ",
iconExt = "\030 \031f\0305\031f\155\030f\128\031d\152\140\030d\031f\151\030f\128\128\0304\0314\128\
\030 \031f\030f\0315\152\129\030d\031f\141\030f\031d\153\030d\031f\149\030f\031d\131\148\0304\0314\128\
\030 \031f\0304\031f\131\131\131\131\131\131\131\030e\0314\131",
run = "mwm.lua usr/config/mwm",
},
[ "8d1b0a73bedc0dc492377c2f6ab880940b97ec6e" ] = {
title = "Treefarm",
icon = "\030 \031f \0305 \030 \030d \030 \
\0305\031f \030d \030 \030d \0305 \030d \
\030 \031f \030c \030 \0304 \030 \030c \030 ",
category = "Apps",
run = "treefarm.lua",
requires = "turtle",
},
[ "01c933b2a36ad8ed2d54089cb2903039046c1216" ] = {
title = "Enchat",
icon = "\030e\031f\151\030f\031e\156\0311\140\0314\140\0315\140\031d\140\031b\140\031a\132\
\030f\0314\128\030e\031f\132\030f\031e\132\0318nchat\
\030f\031e\138\141\0311\140\0314\140\0315\132\0317v\03183\031a\132",
category = "Apps",
run = "https://raw.githubusercontent.com/LDDestroier/enchat/master/enchat3.lua",
},
}

View File

@@ -0,0 +1,592 @@
{
"smooth_sky_stone_block": {
"name": "Sky Stone Block"
},
"fluix_block": {
"name": "Fluix Block"
},
"charger": {
"name": "Charger"
},
"network_tool": {
"name": "Network Tool"
},
"wireless_terminal": {
"name": [
"Wireless Terminal"
]
},
"certus_quartz_cutting_knife": {
"name": "Certus Quartz Cutting Knife"
},
"storage_cell_16k": {
"name": "16k ME Storage Cell"
},
"grindstone": {
"name": "Quartz Grindstone"
},
"material": {
"name": [
"Certus Quartz Crystal",
"Charged Certus Quartz Crystal",
"Certus Quartz Dust",
"Nether Quartz Dust",
"",
"",
"",
"Fluix Crystal",
"Fluix Dust",
"Fluix Pearl",
"Pure Certus Quartz Crystal",
"Pure Nether Quartz Crystal",
"Pure Fluix Crystal",
"Inscriber Calculation Press",
"",
"",
"Printed Calculation Circuit",
"Printed Engineering Circuit",
"Printed Logic Circuit",
"",
"Printed Silicon",
"",
"Logic Processor",
"Calculation Processor",
"Engineering Processor",
"",
"",
"",
"Advanced Card",
"",
"Acceleration Card",
"",
"2³ Spatial Component",
"16³ Spatial Component",
"128³ Spatial Component",
"1k ME Storage Component",
"4k ME Storage Component",
"16k ME Storage Component",
"64k ME Storage Component",
"ME Storage Housing",
"",
"Wireless Receiver",
"Wireless Booster",
"Formation Core",
"Annihilation Core",
"",
"",
"",
"",
"",
"",
"",
"Blank Pattern"
]
},
"controller": {
"name": "ME Controller"
},
"quartz_glass": {
"name": "Quartz Glass"
},
"quartz_growth_accelerator": {
"name": "Crystal Growth Accelerator"
},
"energy_acceptor": {
"name": "Energy Acceptor"
},
"part": {
"name": [
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ME Glass Cable - Fluix",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"Cable Anchor",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"Quartz Fiber",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"Illuminated Panel",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ME Storage Bus",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ME Annihilation Plane",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ME Pattern Terminal",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ME Crafting Terminal",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ME Terminal",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"ME Interface"
]
},
"dense_energy_cell": {
"name": "Dense Energy Cell"
},
"drive": {
"name": "ME Drive"
},
"crafting_unit": {
"name": "Crafting Unit"
},
"interface": {
"name": "ME Interface"
},
"energy_cell": {
"name": "Energy Cell"
},
"wireless_access_point": {
"name": "ME Wireless Access Point"
},
"condenser": {
"name": "Matter Condenser"
},
"nether_quartz_wrench": {
"name": "Nether Quartz Wrench"
},
"crank": {
"name": "Wooden Crank"
},
"molecular_assembler": {
"name": "Molecular Assembler"
},
"chest": {
"name": "ME Chest"
},
"security_station": {
"name": "ME Security Terminal"
},
"sky_stone_block": {
"name": "Sky Stone"
},
"crafting_storage_64k": {
"name": "64k Crafting Storage"
},
"inscriber": {
"name": "Inscriber"
},
"crystal_seed": {
"name": [
"Nether Quartz Seed"
]
}
}

View File

@@ -0,0 +1,20 @@
{
"peripheral": {
"name": [
"Disk Drive",
"",
"",
"",
"Advanced Monitor"
]
},
"advanced_modem": {
"name": "Ender Modem"
},
"pocket_computer": {
"name": [
"",
"Advanced Pocket Computer"
]
}
}

226
core/etc/names/enderio.json Normal file
View File

@@ -0,0 +1,226 @@
{
"blockSolarPanel": {
"name": [
"Photovoltaic Cell",
"Advanced Photovoltaic Cell",
"Vibrant Photovoltaic Cell"
]
},
"blockFusedQuartz": {
"name": [
"Fused Quartz",
"Quite Clear Glass",
"Enlightened Fused Quartz",
"",
"Dark Fused Quartz",
"Dark Clear Glass"
]
},
"blockVacuumChest": {
"name": [
"Vacuum Chest"
]
},
"itemExtractSpeedUpgrade": {
"name": "Item Conduit Speed Upgrade"
},
"blockPainter": {
"name": "Painting Machine"
},
"blockTransceiver": {
"name": "Dimensional Transceiver"
},
"darkSteel_chestplate": {
"name": "Dark Plate"
},
"blockSliceAndSplice": {
"name": "Slice'N'Splice"
},
"itemConduitFacade": {
"name": "Conduit Facade"
},
"itemBasicFilterUpgrade": {
"name": [
"Basic Item Filter",
"Advanced Item Filter",
"Counting Item Filter"
]
},
"blockExperienceObelisk": {
"name": "Experience Obelisk"
},
"itemLiquidConduit": {
"name": [
"Fluid Conduit",
"Pressurized Fluid Conduit",
"Ender Fluid Conduit"
]
},
"blockFarmStation": {
"name": "Farming Station"
},
"blockEndermanSkull": {
"name": [
"Enderman Head",
"",
"Tormented Enderman Head"
]
},
"blockAlloySmelter": {
"name": "Alloy Smelter"
},
"itemRedstoneConduit": {
"name": "Redstone Conduit"
},
"itemPowerConduit": {
"name": [
"Energy Conduit",
"Enhanced Energy Conduit",
"Ender Energy Conduit"
]
},
"itemTravelStaff": {
"name": "Staff of Traveling"
},
"blockSagMill": {
"name": [
"SAG Mill (Configured)"
]
},
"itemItemConduit": {
"name": "Item Conduit"
},
"itemConduitProbe": {
"name": "Conduit Probe"
},
"itemPowderIngot": {
"name": [
"",
"",
"",
"",
"",
"",
"Enderium Base"
]
},
"blockBuffer": {
"name": [
"Item Buffer"
]
},
"blockPoweredSpawner": {
"name": "Powered Spawner"
},
"itemBasicCapacitor": {
"name": [
"Basic Capacitor",
"Double-Layer Capacitor",
"Octadic Capacitor",
"Modified Power Holding Device"
]
},
"blockCapBank": {
"name": [
"",
"Basic Capacitor Bank",
"Capacitor Bank",
"Vibrant Capacitor Bank"
]
},
"blockTank": {
"name": [
"Fluid Tank (Configured)"
]
},
"blockKillerJoe": {
"name": [
"Killer Joe"
]
},
"blockWirelessCharger": {
"name": "Wireless Charger"
},
"darkSteel_sword": {
"name": [
"The Ender"
]
},
"blockVat": {
"name": [
"The Vat"
]
},
"itemBrokenSpawner": {
"name": "Broken Spawner"
},
"blockSoulBinder": {
"name": "Soul Binder"
},
"itemMachinePart": {
"name": [
"Machine Chassis",
"Basic Gear"
]
},
"itemYetaWrench": {
"name": "Yeta Wrench"
},
"itemAlloy": {
"name": [
"Electrical Steel",
"Energetic Alloy",
"Vibrant Alloy",
"Redstone Alloy",
"Conductive Iron",
"Pulsating Iron",
"Dark Steel",
"Soularium"
]
},
"itemXpTransfer": {
"name": "Experience Rod"
},
"itemFrankenSkull": {
"name": [
"Zombie Electrode",
"Z-Logic Controller",
"Frank'N'Zombie",
"Ender Resonator",
"Sentient Ender",
"Skeletal Contractor"
]
},
"blockReservoir": {
"name": "Reservoir"
},
"itemSoulVessel": {
"name": [
"Soul Vial",
"Soul Vial"
]
},
"itemMaterial": {
"name": [
"Silicon",
"Conduit Binder",
"Binder Composite",
"Pulsating Iron Nugget",
"Vibrant Alloy Nugget",
"Pulsating Crystal",
"Vibrant Crystal",
"",
"Ender Crystal",
"Enticing Crystal",
"",
"",
"",
"Grains of the End",
"",
"Precient Crystal",
"",
"",
"Plant clippings and trimmings"
]
}
}

View File

@@ -0,0 +1,35 @@
{
"blockDust": {
"name": "Dust"
},
"blockBarrel1": {
"name": "Stone Barrel"
},
"hammerStone": {
"name": "Stone Hammer"
},
"itemMaterial": {
"name": [
"",
"Porcelain Clay",
"Silkworm",
"Ancient Spores",
"Grass Seeds"
]
},
"blockCrucible": {
"name": [
"Unfired Crucible",
"Crucible"
]
},
"itemMesh": {
"name": [
"",
"String Mesh",
"Flint Stiffened Mesh",
"Iron Stiffened Mesh",
"Diamond Stiffened Mesh"
]
},
}

View File

@@ -0,0 +1,70 @@
{
"resonator": {
"name": "Resonator"
},
"endershard": {
"name": "Ender Shard"
},
"glasscutter": {
"name": "Glass Cutter"
},
"decorativesolid": {
"name": [
"",
"",
"Polished Stone",
"Stoneburnt"
]
},
"passivegenerator": {
"name": [
"",
"",
"",
"Water Mill",
"",
"",
"",
"Manual Mill"
]
},
"pipe": {
"name": "Transfer Pipe"
},
"user": {
"name": "Mechanical User"
},
"trashcan": {
"name": "Trash Can"
},
"ingredients": {
"name": [
"Resonating Redstone Crystal",
"Redstone Gear",
"Eye of Redstone",
"",
"",
"",
"Upgrade Speed",
"",
"",
"Upgrade Base",
"Drop of Evil"
]
},
"drum": {
"name": [
"",
"Iron Drum"
]
},
"grocket": {
"name": [
"",
"",
"Transfer Node (Fluids)",
"",
"Retrieval Node (Fluids)"
]
}
}

View File

@@ -0,0 +1,22 @@
{
"goldDiamondUpgrade": {
"name": "Gold to Diamond Chest Upgrade"
},
"BlockIronChest": {
"name": [
"Iron Chest",
"Gold Chest",
"Diamond Chest",
"",
"",
"Crystal Chest",
"Obsidian Chest"
]
},
"woodIronUpgrade": {
"name": "Wood to Iron Chest Upgrade"
},
"ironGoldUpgrade": {
"name": "Iron to Gold Chest Upgrade"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,37 @@
{
"crafter1": {
"name": "Crafter Tier 1"
},
"modular_storage": {
"name": "Modular Storage"
},
"crafter3": {
"name": "Crafter Tier 3"
},
"machine_frame": {
"name": "Machine Frame"
},
"storage_module": {
"name": [
"Storage Module Tier 1",
"Storage Module Tier 2",
"Storage Module Tier 3",
"",
"",
"",
"Remote Storage Module"
]
},
"crafter2": {
"name": "Crafter Tier 2"
},
"machine_base": {
"name": "Machine Base"
},
"remote_storage": {
"name": "Remote Storage"
},
"timer_block": {
"name": "Timer"
}
}

View File

@@ -0,0 +1,33 @@
{
"compDrawers": {
"name": "Compacting Drawer"
},
"upgradeTemplate": {
"name": "Upgrade Template"
},
"controller": {
"name": "Drawer Controller"
},
"basicDrawers": {
"name": [
"Basic Drawer",
"",
"Basic Drawers 2x2"
]
},
"upgradeVoid": {
"name": "Void Upgrade"
},
"upgradeStorage": {
"name": [
"",
"",
"",
"",
"Storage Upgrade (V)"
]
},
"controllerSlave": {
"name": "Controller Slave"
}
}

View File

@@ -0,0 +1,36 @@
{
"materials": {
"name": [
"Seared Brick",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"Necrotic Bone"
]
},
"pattern": {
"name": "Blank Pattern"
},
"cast": {
"name": "Blank Cast"
},
"casting": {
"name": "Casting Table"
},
"soil": {
"name": "Grout"
}
}

File diff suppressed because it is too large Load Diff

1
core/etc/scripts/abort Normal file
View File

@@ -0,0 +1 @@
turtle.abort(true)

116
core/etc/scripts/follow Normal file
View File

@@ -0,0 +1,116 @@
local os = _G.os
local turtle = _G.turtle
local function follow(id)
_G.requireInjector(_ENV)
local Event = require('event')
local Point = require('point')
local Socket = require('socket')
turtle.setStatus('follow ' .. id)
if not turtle.enableGPS() then
error('turtle: No GPS found')
end
local socket = Socket.connect(id, 161)
if not socket then
error('turtle: Unable to connect to ' .. id)
return
end
local lastPoint
local following = false
Event.on('turtle_follow', function(_, pt)
local pts = {
{ x = pt.x + 2, z = pt.z, y = pt.y },
{ x = pt.x - 2, z = pt.z, y = pt.y },
{ x = pt.x, z = pt.z + 2, y = pt.y },
{ x = pt.x, z = pt.z - 2, y = pt.y },
}
local cpt = Point.closest(turtle.point, pts)
local blocks = { }
local function addBlocks(tpt)
table.insert(blocks, tpt)
local apts = Point.adjacentPoints(tpt)
for _,apt in pairs(apts) do
table.insert(blocks, apt)
end
end
-- don't run into player
addBlocks(pt)
addBlocks({ x = pt.x, z = pt.z, y = pt.y + 1 })
if turtle.pathfind(cpt, { blocks = blocks }) then
turtle.headTowards(pt)
end
following = false
end)
Event.onInterval(.5, function()
local function getRemotePoint()
if not turtle.isAborted() then
if socket:write({ type = 'gps' }) then
return socket:read(3)
end
end
end
-- sometimes gps will fail if moving
local pt, d
for _ = 1, 3 do
pt, d = getRemotePoint()
if pt then
break
end
os.sleep(.5)
end
if not pt or turtle.isAborted() then
error('Did not receive GPS location')
end
if not lastPoint or (lastPoint.x ~= pt.x or lastPoint.y ~= pt.y or lastPoint.z ~= pt.z) then
if following then
turtle.getState().abort = true
while following do
os.sleep(.1)
end
turtle.getState().abort = false
end
-- check if gps is inaccurate (player moving too fast)
if d < Point.distance(turtle.point, pt) + 10 then
lastPoint = Point.copy(pt)
following = true
os.queueEvent('turtle_follow', pt)
end
end
end)
Event.on('turtle_abort', function()
Event.exitPullEvents()
end)
Event.pullEvents()
socket:close()
return true
end
local s, m = turtle.run(function() follow({COMPUTER_ID}) end)
if not s and m then
error(m)
end

3
core/etc/scripts/goHome Normal file
View File

@@ -0,0 +1,3 @@
_G.requireInjector(_ENV)
local Home = require('turtle.home')
turtle.run(Home.go)

29
core/etc/scripts/moveTo Normal file
View File

@@ -0,0 +1,29 @@
turtle.run(function()
_G.requireInjector(_ENV)
local GPS = require('gps')
local Socket = require('socket')
local id = {COMPUTER_ID}
if not turtle.enableGPS() then
error('turtle: No GPS found')
end
local socket = Socket.connect(id, 161)
if not socket then
error('turtle: Unable to connect to ' .. id)
end
socket:write({ type = 'gps' })
local pt = socket:read(3)
if not pt then
error('turtle: No GPS response')
end
if not turtle.pathfind(pt) then
error('Unable to go to location')
end
end)

108
core/etc/scripts/obsidian Normal file
View File

@@ -0,0 +1,108 @@
_G.requireInjector(_ENV)
local Point = require('point')
local Util = require('util')
local os = _G.os
local turtle = _G.turtle
local checkedNodes, nodes
local function addNode(node)
for i = 0, 3 do
local hi = turtle.getHeadingInfo(i)
local testNode = { x = node.x + hi.xd, z = node.z + hi.zd }
local key = table.concat({ testNode.x, testNode.z }, ':')
if not checkedNodes[key] then
nodes[key] = testNode
end
end
end
local function findObsidian()
repeat
local node = { x = turtle.point.x, z = turtle.point.z }
local key = table.concat({ node.x, node.z }, ':')
checkedNodes[key] = true
nodes[key] = nil
local _,b = turtle.inspectDown()
if b and (b.name == 'minecraft:lava' or b.name == 'minecraft:flowing_lava') then
if turtle.select('minecraft:water_bucket') then
while true do
if turtle.up() then
break
end
print('stuck')
end
turtle.placeDown()
os.sleep(2)
turtle.placeDown()
turtle.down()
turtle.select(1)
_, b = turtle.inspectDown()
end
end
if turtle.getItemCount(16) > 0 then
print('Inventory full')
print('Enter to continue...')
_G.read()
end
if b and b.name == 'minecraft:obsidian' then
turtle.digDown()
addNode(node)
else
turtle.digDown()
end
print(string.format('%d nodes remaining', Util.size(nodes)))
if Util.size(nodes) == 0 then
break
end
node = Point.closest(turtle.point, nodes)
if not turtle._goto(node) then
break
end
until turtle.isAborted()
end
turtle.run(function()
turtle.reset()
turtle.setPolicy(turtle.policies.digOnly)
local s, m = pcall(function()
repeat
checkedNodes = { }
nodes = { }
local _,b = turtle.inspectDown()
if not b or b.name ~= 'minecraft:obsidian' then
break
end
findObsidian()
if not turtle.select('minecraft:water_bucket') then
break
end
turtle._goto({ x = 0, z = 0 })
turtle.placeDown()
os.sleep(2)
turtle.placeDown()
turtle.down()
turtle.select(1)
until turtle.isAborted()
end)
if not s and m then
error(m)
end
turtle._goto({ x = 0, y = 0, z = 0, heading = 0 })
end)

1
core/etc/scripts/reboot Normal file
View File

@@ -0,0 +1 @@
os.reboot()

3
core/etc/scripts/setHome Normal file
View File

@@ -0,0 +1,3 @@
_G.requireInjector(_ENV)
local Home = require('turtle.home')
turtle.run(Home.set)

View File

@@ -0,0 +1 @@
os.shutdown()

74
core/etc/scripts/summon Normal file
View File

@@ -0,0 +1,74 @@
local function summon(id)
_G.requireInjector(_ENV)
local GPS = require('gps')
local Point = require('point')
local Socket = require('socket')
turtle.setStatus('GPSing')
turtle.setPoint({ x = 0, y = 0, z = 0, heading = 0 })
local pts = {
[ 1 ] = { x = 0, z = 0, y = 0 },
[ 2 ] = { x = 4, z = 0, y = 0 },
[ 3 ] = { x = 2, z = -2, y = 2 },
[ 4 ] = { x = 2, z = 2, y = 2 },
}
local tFixes = { }
local socket = Socket.connect(id, 161)
if not socket then
error('turtle: Unable to connect to ' .. id)
end
local function getDistance()
socket:write({ type = 'ping' })
local _, d = socket:read(5)
return d
end
local function doGPS()
tFixes = { }
for i = 1, 4 do
if not turtle._goto(pts[i]) then
error('turtle: Unable to perform GPS maneuver')
end
local distance = getDistance()
if not distance then
error('turtle: No response from ' .. id)
end
table.insert(tFixes, {
position = vector.new(turtle.point.x, turtle.point.y, turtle.point.z),
distance = distance
})
end
return true
end
if not doGPS() then
turtle.turnAround()
turtle.setPoint({ x = 0, y = 0, z = 0, heading = 0})
if not doGPS() then
socket:close()
return false
end
end
socket:close()
local pos = GPS.trilaterate(tFixes)
if pos then
local pt = { x = pos.x, y = pos.y, z = pos.z }
local _, h = Point.calculateMoves(turtle.getPoint(), pt)
local hi = turtle.getHeadingInfo(h)
turtle.setStatus('recalling')
turtle.pathfind({ x = pt.x - hi.xd, z = pt.z - hi.zd, y = pt.y - hi.yd, heading = h })
else
error("turtle: Could not determine position")
end
end
turtle.run(function() summon({COMPUTER_ID}) end)