From e264d987390a20b23efef19bc3595faf65fcc4a5 Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Sun, 27 Jan 2019 00:27:05 -0500 Subject: [PATCH] cleanup --- core/lavaRefuel.lua | 2 -- {core => ignore}/Music.lua | 0 ignore/chars.lua | 15 +++++++++++++++ ignore/colors.lua | 37 +++++++++++++++++++++++++++++++++++++ {core => ignore}/shapes.lua | 0 milo/apps/cobblegen.lua | 2 -- milo/apps/furni.lua | 4 +--- milo/apps/water.lua | 2 -- 8 files changed, 53 insertions(+), 9 deletions(-) rename {core => ignore}/Music.lua (100%) create mode 100644 ignore/chars.lua create mode 100644 ignore/colors.lua rename {core => ignore}/shapes.lua (100%) diff --git a/core/lavaRefuel.lua b/core/lavaRefuel.lua index a000ad2..ddd4770 100644 --- a/core/lavaRefuel.lua +++ b/core/lavaRefuel.lua @@ -1,5 +1,3 @@ -_G.requireInjector(_ENV) - local Point = require('point') local device = _G.device diff --git a/core/Music.lua b/ignore/Music.lua similarity index 100% rename from core/Music.lua rename to ignore/Music.lua diff --git a/ignore/chars.lua b/ignore/chars.lua new file mode 100644 index 0000000..3091711 --- /dev/null +++ b/ignore/chars.lua @@ -0,0 +1,15 @@ +local w, h = term.getSize() + +term.clear() +term.setCursorPos(1, 1) + +local t = { } +for i = 1, 8 do + table.insert(t, '---') +end + +for i = 1, 255 do + table.insert(t, string.format('%d %c', i, i)) +end + +textutils.pagedTabulate(t) diff --git a/ignore/colors.lua b/ignore/colors.lua new file mode 100644 index 0000000..1b5c39b --- /dev/null +++ b/ignore/colors.lua @@ -0,0 +1,37 @@ +_G.requireInjector(_ENV) +local Util = require('util') + +local colors = _G.colors +local term = _G.term + +local w = term.getSize() +local x, y = 1, 2 +local filler = string.rep(' ', w) +term.clear() + +local colorTable = Util.filter(colors, function(c) + return type(c) == 'number' +end) + +term.setTextColor(colors.black) +for k,v in Util.spairs(colorTable, function(a, b) return a < b end) do + term.setBackgroundColor(v) + for i = 0, 1 do + term.setCursorPos(x, y + i) + term.write(filler:sub(1, 9)) + end + term.setCursorPos(x + ((9 - #k) / 2), y) + term.write(k) + local cs = tostring(v) + term.setCursorPos(x + ((9 - #cs) / 2), y + 1) + term.write(cs) + x = x + 9 + if x + 9 > w + 1 then + y = y + 2 + x = 1 + end +end +if x > 1 then + y = y + 2 +end +term.setCursorPos(1, y) diff --git a/core/shapes.lua b/ignore/shapes.lua similarity index 100% rename from core/shapes.lua rename to ignore/shapes.lua diff --git a/milo/apps/cobblegen.lua b/milo/apps/cobblegen.lua index be7ae54..ba30a3c 100644 --- a/milo/apps/cobblegen.lua +++ b/milo/apps/cobblegen.lua @@ -1,5 +1,3 @@ -_G.requireInjector(_ENV) - local Util = require('util') local fs = _G.fs diff --git a/milo/apps/furni.lua b/milo/apps/furni.lua index 2cf4611..a13d747 100644 --- a/milo/apps/furni.lua +++ b/milo/apps/furni.lua @@ -3,7 +3,7 @@ Use multiple furnaces at once to smelt items. SETUP: Place an introspection module into the turtles inventory. - Connect turtle to milo with a wired modem. + Connect turtle to milo network with a wired modem. Connect turtle to a second wired modem that is connected to furnaces ONLY. Add as many furnaces as needed. @@ -15,8 +15,6 @@ CONFIGURATION: Use this turtle for machine crafting. --]] -_G.requireInjector(_ENV) - local Event = require('event') local Peripheral = require('peripheral') local Util = require('util') diff --git a/milo/apps/water.lua b/milo/apps/water.lua index f229ce2..eb8a79f 100644 --- a/milo/apps/water.lua +++ b/milo/apps/water.lua @@ -1,5 +1,3 @@ -_G.requireInjector(_ENV) - local Util = require('util') local fs = _G.fs