Skip to content

Instantly share code, notes, and snippets.

View znepb's full-sized avatar
💥
Professional Procrastinator

Marcus znepb

💥
Professional Procrastinator
View GitHub Profile
@znepb
znepb / csi.md
Last active November 11, 2023 02:17

Deprecation Notice

CommonShopInfo is now deprecated in favor of ShopSync. Please use that instead.

CommonShopInfo 1.0.0

CommonShopInfo (CSI) is a method of storing name information within a Krist domain's A record. It can be used to storage data regarding shop info.

Basic information

A CommonShopInfo string follows the same standards as Krist Common Meta (see here), with the only notable difference being spaces replaced with + signs. CSI information should always contain the field csi=1; which marks the metadata as CSI metadata. A list of standardized fields is shown below.

Fields

@znepb
znepb / smarttrash.lua
Created January 16, 2023 07:31
A smart trash and composting program for ComputerCraft.
--- Setup
-- Place lava in front of the turtle and a composter
-- below. Compostable items (defined in the table below)
-- will be composted, and preferrably extracted via a
-- hopper. Non-compostable items will be spat into
-- lava.
local compostedItems = {
"minecraft:acacia_leaves",
"minecraft:acacia_sapling",
@znepb
znepb / farm.lua
Last active January 16, 2023 17:21
--- Setup
-- This program requires Tuttle: https://gist.github.com/znepb/72981ce3e7a2e1f4e3423ed0b2ca9510
-- The turtle's home should have a chest below (the output chest) and a chest above (the fuel chest).
-- As well as this, there should be NO OBSTACLES within the farm's area. They will be destroyed over time as the farm works.
--- Configuration Section
-- The block to search for and dig
local block = "minecraft:wheat"
-- The item to deposit into chests
local item = "minecraft:wheat"
@znepb
znepb / tuttle.lua
Last active January 16, 2023 07:14
Tuttle: A simple ComputerCraft turtle pathfinding API.
-- A simple turtle pathfinding API for ComputerCraft.
--[[
Copyright 2023 Marcus Wenzel
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:
---- Minecraft Crash Report ----
// You should try our sister game, Minceraft!
Time: 6/27/22 5:12 PM
Description: mouseReleased event handler
java.lang.NullPointerException: Registry entry not present: create:copper_backtank
at java.util.Objects.requireNonNull(Unknown Source) ~[?:1.8.0_333] {}
at com.simibubi.create.repack.registrate.util.entry.RegistryEntry.get(RegistryEntry.java:89) ~[create:mc1.16.5_v0.3.2g] {re:classloading}
at com.simibubi.create.foundation.item.CreateItemGroupBase.addItems(CreateItemGroupBase.java:56) ~[create:mc1.16.5_v0.3.2g] {re:classloading}
local f = fs.open("startup.lua", "w")
f.write("")
f.close()
local f = fs.open("startup.lua", "a")
f.write('term.clear()')
f.write('term.setCursorPos(1, 1)')
f.write('print("My OS 1.0")')
f.close()
--[[
------------------------- READ ME -------------------------
WARNING: THIS IS INTENDED TO BE USED AS A TOOL TO RUN LOTS
OF COMMANDS ON A COMPUTER QUICKLY WITH EASE. DO NOT PUT
THIS ON ANOTHER PERSON'S COMPUTER WITHOUT THEIR PERMISSION.
IF YOU GET BANNED OR SCREW UP SOMETHING REALLY BAD,
I AM NOT RESPONSIBLE. I WARNED YOU.
Warning out of the way, this is meant to be a tool. You
local api = {}
local function formPostString(data)
local out = ""
for i, v in pairs(data) do
if i == 1 then
out = textutils.urlEncode(i) .. "=" .. textutils.urlEncode(v)
else
out = out .. "&" .. textutils.urlEncode(i) .. "=" .. textutils.urlEncode(v)
end
local function getDiff(t)
return t - os.epoch("utc") / 1000
end
local function dispTime(t)
t = math.abs(t)
local y = math.floor(t / 31536000)
local d = math.floor((t % 31536000) / 86400)
local h = math.floor((t % 86400) / 3600)
local m = math.floor((t % 3600) / 60)
--[[
CCInstaller
by znepb
Version 1.0
Example configuration: https://gist.github.com/znepb/5f5be3a68faa8b8758ddaa141e253d8c
]]
local repo = "" -- The GitHub repo for your program (user/repo/branch)
local installStart = "" -- Where the installation will start at