This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function resetPalette(periph) | |
local mon | |
if periph == "term" then | |
mon = term | |
else | |
mon = assert(peripheral.wrap(periph), periph.." is not a valid peripheral") | |
end | |
for i = 0, 15 do | |
mon.setPaletteColor(2^i, term.nativePaletteColor(2^i)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* SIMPLE Java implementation of Lua tables | |
* Mainly meant as an export format | |
* | |
* @author https://github.com/MasonGulu | |
*/ | |
/** | |
* MIT License | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- FriendlyEvents | |
-- A CC event wrapper | |
-- Licensed under CC0 | |
local expect = require("cc.expect").expect | |
-- CC Event Lookup Table | |
-- This should be tables of named indicies as a map from | |
-- {2, 3, 4, ...} to string name indices into the event table | |
local eventLUT = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Inventory Abstraction Library | |
-- Inventory Peripheral API compatible library that caches the contents of chests, and allows for very fast transfers of items between AbstractInventory objects. | |
-- Transfers can occur from slot to slot, or by item name and nbt data. | |
-- This can also transfer to / from normal inventories, just pass in the peripheral name. | |
-- Use {optimal=false} to transfer to / from non-inventory peripherals. | |
-- Now you can wrap arbritrary slot ranges | |
-- To do so, rather than passing in the inventory name when constructing (or adding/removing inventories) | |
-- you simply pass in a table of the following format | |
-- {name: string, minSlot: integer?, maxSlot: integer?, slots: integer[]?} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- This program will time the execution of a program you pass in | |
-- It takes a variety of arguments | |
-- Use the -help flag to see them all, or since you're in here, peek below. | |
-- The times reported do NOT include the time waiting for events. It is removed from ALL calculations and numbers. | |
-- This INCLUDES all times reported in the saved files | |
-- Copyright 2022 Mason Gulu | |
-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
-- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---This is a library to handle mass 16 color printing in ComputerCraft. | |
-- This requires abstractInvLib https://gist.github.com/MasonGulu/57ef0f52a93304a17a9eaea21f431de6 | |
-- Copyright 2023 Mason Gulu | |
-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
-- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Basic audio playback library for CC | |
-- Loads audio from DFPWM | |
-- Maintains a seperate audio playback channel for each attached speaker | |
-- Supports a priority system allowing sounds to be overwritten by higher priority ones | |
-- To setup your audio system | |
-- local audio = require "audio" | |
-- local audioSys = audio.new() | |
-- To start running your audio system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---@diagnostic disable: duplicate-set-field | |
-- Modern recreation of stitch | |
-- This can be used as a library or as a command-line tool | |
-- Scrolling requires buffering to be enabled, pass layout.buffer = true | |
-- This significantly slows down staple, enabling literally just wraps staple in a window | |
local function getNative() | |
local i = 1 | |
while true do | |
local n, v = debug.getupvalue(peripheral.call, i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- overwrite _G.fs.open to search all disks connected to the computer for the file | |
-- create a cache of filenames -> locations | |
---@type table<string,string> | |
local filePaths = {} | |
local function cacheDir(dir) | |
for k,v in pairs(fs.list(dir)) do | |
local fn = fs.combine(dir, v) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Very simple Lua program packager. | |
-- This program takes in a single filename, your entry point. | |
-- Then it will scan that program for all of its requires, and all of its require-es requires. | |
-- After doing this for all required files it packages them up into a single file. | |
-- There are a few special rules you MUST follow for this program to work | |
-- 1) The FIRST line of ALL files you import must be an initialization of your module's table. | |
--- For example, `local data = {}` | |
--- 1.a) This variable name MUST be the same variable name used everywhere this module is. | |
-- 2) The LAST code line of your file MUST be a return, returning this module table. |
OlderNewer