From c5d209161efe7585a5d327cb1aa200e0dc76e42f Mon Sep 17 00:00:00 2001 From: kepler155c Date: Fri, 30 Nov 2018 19:26:56 -0500 Subject: [PATCH] autoruns --- farms/farmer.lua | 3 ++- farms/rancher.lua | 5 +++-- farms/treefarm.lua | 3 ++- milo/apps/furni.lua | 7 ++++--- miners/scanningMiner.lua | 8 ++++++++ 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/farms/farmer.lua b/farms/farmer.lua index 09626d6..1a94f74 100644 --- a/farms/farmer.lua +++ b/farms/farmer.lua @@ -46,7 +46,8 @@ end if not fs.exists(STARTUP_FILE) then Util.writeFile(STARTUP_FILE, [[os.sleep(1) -shell.openForegroundTab('packages/farms/farmer.lua')]]) +shell.openForegroundTab('farmer.lua')]]) + print('Autorun program created: ' .. STARTUP_FILE) end local retain = Util.transpose { diff --git a/farms/rancher.lua b/farms/rancher.lua index cae6c27..3ff984b 100644 --- a/farms/rancher.lua +++ b/farms/rancher.lua @@ -68,11 +68,12 @@ local c = Peripheral.lookup('type/minecraft:chest') or error('Missing chest') local directions = { top = 'down', bottom = 'up' } local direction = directions[c.side] or getLocalName() local chest = Adapter({ side = c.side, direction = direction }) or error('missing chest') -_G._p = chest + if not fs.exists(STARTUP_FILE) then Util.writeFile(STARTUP_FILE, [[os.sleep(1) -shell.openForegroundTab('packages/farms/rancher.lua')]]) +shell.openForegroundTab('rancher.lua')]]) + print('Autorun program created: ' .. STARTUP_FILE) end local dispenser = Peripheral.lookup('type/minecraft:dispenser') diff --git a/farms/treefarm.lua b/farms/treefarm.lua index ecc2912..9890bbb 100644 --- a/farms/treefarm.lua +++ b/farms/treefarm.lua @@ -81,7 +81,8 @@ local state = Util.readTable('usr/config/treefarm') or { if not fs.exists(STARTUP_FILE) then Util.writeFile(STARTUP_FILE, [[os.sleep(1) -shell.openForegroundTab('packages/farms/treefarm.lua')]]) +shell.openForegroundTab('treefarm.lua')]]) + print('Autorun program created: ' .. STARTUP_FILE) end local clock = os.clock() diff --git a/milo/apps/furni.lua b/milo/apps/furni.lua index e80c85c..390342e 100644 --- a/milo/apps/furni.lua +++ b/milo/apps/furni.lua @@ -1,10 +1,11 @@ --[[ -Use 4 furnaces at once to smelt items. +Use multiple furnaces at once to smelt items. SETUP: Place an introspection module into the turtles inventory. - Connect with wired modem at bottom of turtle. - Place furnaces on each side EXCEPT for bottom and left. + Connect turtle to milo with a wired modem. + Connect turtle to a second wired modem that is connected to furnaces ONLY. + Add as many furnaces as needed. CONFIGURATION: Set turtle as a "Generic Inventory" diff --git a/miners/scanningMiner.lua b/miners/scanningMiner.lua index 1c3cbe4..fcffcb1 100644 --- a/miners/scanningMiner.lua +++ b/miners/scanningMiner.lua @@ -42,6 +42,7 @@ local MAX_FUEL = turtle.getFuelLimit() local DICTIONARY_FILE = 'usr/config/mining.dictionary' local PROGRESS_FILE = 'usr/config/scanning_mining.progress' +local STARTUP_FILE = 'usr/autorun/scanningMiner.lua' local mining local ignores = { @@ -541,6 +542,13 @@ if not fs.exists(DICTIONARY_FILE) or options.setTrash.value then addTrash() end +if not fs.exists(STARTUP_FILE) then + Util.writeFile(STARTUP_FILE, + [[os.sleep(1) +shell.openForegroundTab('scanningMiner.lua')]]) + print('Autorun program created: ' .. STARTUP_FILE) +end + Event.addRoutine(function() turtle.reset()