diff --git a/ccshow.lua b/ccshow.lua new file mode 100644 index 0000000..eadebdb --- /dev/null +++ b/ccshow.lua @@ -0,0 +1,17 @@ +local ccpi = require("ccpi") +local args = { ... } + +local terminal = term.current() +if args[1] == "-m" then + table.remove(args, 1) + terminal = peripheral.wrap(table.remove(args, 1)) +end + +local img, err = ccpi.load(args[1]) +if not img then + printError(err) + return +end + +terminal.clear() +ccpi.draw(img, 1, 1, terminal) diff --git a/custom-colors.lua b/custom-colors.lua new file mode 100644 index 0000000..942d10f --- /dev/null +++ b/custom-colors.lua @@ -0,0 +1,21 @@ +local customColors = { + [colors.white] = 0xEFEFEF, + [colors.orange] = 0xD99F82, + [colors.magenta] = 0x464A73, + [colors.lightBlue] = 0xA1D5E6, + [colors.yellow] = 0xE6CCA1, + [colors.lime] = 0x86BF8F, + [colors.pink] = 0xC98F8F, + [colors.gray] = 0x515151, + [colors.lightGray] = 0xA3A3A3, + [colors.cyan] = 0xC2F2F2, + [colors.blue] = 0x6699CC, + [colors.brown] = 0x735F4B, + [colors.green] = 0x6DA18A, + [colors.red] = 0xBD555F, + [colors.black] = 0x131313 +} + +for id, color in pairs(customColors) do + term.setPaletteColor(id, color) +end diff --git a/n25.cpi b/n25.cpi new file mode 100644 index 0000000..4353ff9 Binary files /dev/null and b/n25.cpi differ diff --git a/runonchange.lua b/runonchange.lua new file mode 100644 index 0000000..da7ef93 --- /dev/null +++ b/runonchange.lua @@ -0,0 +1,40 @@ +local args = { ... } + +local modtimes = {} + +if #args == 0 then + print("usage: runonchange [files to watch ...] -- program [args...]") + return +end + +while #args > 0 do + local name = table.remove(args, 1) + if name == "--" then break end + modtimes[name] = -1 +end + +if #args == 0 then + printError("No executable was given") + return +end + +while true do + local shall_run = false + for name, modtime in pairs(modtimes) do + local modtime_new = fs.attributes(name).modified + if modtime_new ~= modtime then + shall_run = true + modtimes[name] = modtime_new + print(name .. " was modified") + end + end + if shall_run then + local succ, err = pcall(shell.run, table.unpack(args)) + if succ then + print("Process finished successfully") + else + printError("Process crashed: " .. err) + end + end + os.sleep(0.5) +end