This file contains hidden or 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
-- CCPL license: https://github.com/cc-tweaked/CC-Tweaked/blob/mc-1.16.x/LICENSE | |
-- Note that this breaks help on vanilla CC (CC:T help still works) | |
textutils.pagedPrint = function(contents, freeLines) | |
freeLines = freeLines or 0 | |
local foldLines = true | |
local lines = {} |
This file contains hidden or 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 classcompiler = {} | |
--[[ | |
-- Example syntax: | |
class MyClass { | |
num = 0 | |
function __init(num) | |
self.num = num | |
end |
This file contains hidden or 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
-- MIT License | |
-- | |
-- Copyright (c) 2019 JackMacWindows | |
-- | |
-- 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: |
This file contains hidden or 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
-- WARNING: Render crashes are lethal and will 100% kill the computer | |
local loadBDF = require "readBDFFont" -- get from https://gist.github.com/MCJack123/3cbce89640923b3c42d4d0a0b8eaa7b2 | |
if term.setGraphicsMode == nil then error("This requires CraftOS-PC v1.2 or later.") end | |
local font, oldterm, gfxMode | |
local nativeTerm = term.native() | |
local oldSetGfx, oldGetGfx = term.setGraphicsMode, term.getGraphicsMode | |
local nativeWidth, nativeHeight = term.getSize() | |
nativeWidth = nativeWidth * 6 |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import json, os, shutil, sys | |
if len(sys.argv) < 4 or sys.argv[1] == "--help" or sys.argv[1] == "-h": | |
print("Usage: " + sys.argv[0] + " <path to .minecraft/assets> <major.minor version, ex. 1.15> <output directory>") | |
sys.exit(1) | |
fp = open(sys.argv[1] + "/indexes/" + sys.argv[2] + ".json", "r") | |
if fp == None: raise FileNotFoundError("Could not find index file at " + sys.argv[1] + "/indexes/" + sys.argv[2] + ".json") | |
index = json.load(fp) | |
fp.close() | |
def recursive_mkdir(path): |
This file contains hidden or 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
-- UnBIOS by JackMacWindows | |
-- This will undo most of the changes/additions made in the BIOS, but some things may remain wrapped if `debug` is unavailable | |
-- To use, just place a `bios.lua` in the root of the drive, and run this program | |
-- Here's a list of things that are irreversibly changed: | |
-- * both `bit` and `bit32` are kept for compatibility | |
-- * string metatable blocking (on old versions of CC) | |
-- In addition, if `debug` is not available these things are also irreversibly changed: | |
-- * old Lua 5.1 `load` function (for loading from a function) | |
-- * `loadstring` prefixing (before CC:T 1.96.0) | |
-- * `http.request` |
This file contains hidden or 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
-- UnBIOS (MoonScript) by JackMacWindows | |
return if _HOST\find "UnBIOS" | |
keptAPIs = bit32: true, bit: true, ccemux: true, config: true, coroutine: true, debug: true, fs: true, http: true, io: true, mounter: true, os: true, periphemu: true, peripheral: true, redstone: true, rs: true, term: true, _HOST: true, _CC_DEFAULT_SETTINGS: true, _CC_DISABLE_LUA51_FEATURES: true, _VERSION: true, assert: true, collectgarbage: true, error: true, gcinfo: true, getfenv: true, getmetatable: true, ipairs: true, loadstring: true, math: true, newproxy: true, next: true, pairs: true, pcall: true, rawequal: true, rawget: true, rawlen: true, rawset: true, select: true, setfenv: true, setmetatable: true, string: true, table: true, tonumber: true, tostring: true, type: true, unpack: true, xpcall: true, turtle: true, pocket: true, commands: true, _G: true | |
_G[v] = nil for _,v in ipairs [k for k in pairs _G when not keptAPIs[k]] | |
_G.term = _G.term.native! | |
_G.http.checkURL = _G.http.checkURLAsync | |
_G.http.websocket = _G.http.websocketAsync | |
d |
This file contains hidden or 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 deconstruct | |
deconstruct = function(t, values, tables) | |
local retval = { } | |
for k, v in pairs(t) do | |
local id | |
for i, w in ipairs(values) do | |
if v == w or (type(v) == "table" and type(w) == "table" and tables[w[1]] == v) then | |
id = i | |
break | |
end |
This file contains hidden or 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
-- ModemShark: Modem packet sniffer for ComputerCraft | |
-- By JackMacWindows | |
-- Licensed under GPLv2+ | |
local stackWindow, viewerWindow, lines, scrollPos | |
local w, h = term.getSize() | |
local selectedLine | |
local stack = {} | |
local file |
This file contains hidden or 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
-- Save this as startup.lua on each client computer with a drive and modem attached. You can also optionally attach a speaker for audio feedback. | |
local secret = "" -- Set this to the same secret that was set in the server file. | |
local redstoneSide = "left" -- Set this to the side the redstone signal should be output on. | |
local openTime = 5 -- Set this to the number of seconds to keep the door open for. | |
local defaultOutput = false -- Set this to the default redstone state for the door. If set to true, this means power will be cut when unlocking. | |
-- This allows you to place a door sideways, and then have it stay closed even when power is applied externally. | |
if not secret or secret == "" then error("Please set some keys inside the script before running.") end | |
local ok, err = pcall(function() |