Skip to content

Instantly share code, notes, and snippets.

View umnikos's full-sized avatar

Alex Stefanov umnikos

  • Sofia, Bulgaria
View GitHub Profile
@umnikos
umnikos / diamond.lua
Last active September 19, 2024 19:44
SC3 `\diamond` sell shop's code
if not chatbox.hasCapability("command") or not chatbox.hasCapability("tell") then
error("Chatbox does not have the required permissions. Did you register the license?")
end
local helper = require "helper"
-- SETUP:
-- have a turtle with an entity sensor on its right (to detect player presence) and wireless modem on its left (for shopsync)
-- have slots 2-16 full of dummy items (gold swords, for example), only leaving slot 1 empty
-- and finally, place a chest below the turtle (that's where received diamonds will be stored)
@umnikos
umnikos / fh.py
Created March 7, 2024 21:59
Fuckhard interpreter (Brainfuck derivative)
code = input("program: ")
data = [0]
ip = 0
dp = 0
input_buffer = ""
def error(msg):

SwitchCraft 3 introduction for new players

SC3 is a minecraft server built around computercraft. Apart from CC:Tweaked, Plethora, and a few homebrewed mods, there is not much else in the modpack. This gives the game a very vanilla+ feel which manages to have a rather extended endgame due to progression not being the main focus. You probably joined for the computercraft mod, and this tutorial will get to it eventually, but first let me introduce you to all (most) of the new items from all of the mods:

  1. Computers
  • Computers: Blocks that execute arbitrary Lua code.
-- A Radon layout for 1x1 monitor shops
-- This is a modification of the default theme that comes with with Radon itself
-- https://github.com/Allymonies/Radon
--- Imports
local _ = require("util.score")
local sound = require("util.sound")
local eventHook = require("util.eventHook")
local renderHelpers = require("util.renderHelpers")
@umnikos
umnikos / geocaching.md
Last active March 27, 2024 23:58
Geocaching for the SC3 minecraft server

Rules:

  1. You will be given the coordinates of the cache (aka. chest), but they will intentionally be slightly (or not so slightly) wrong. The coordinates listings will be paired with a measure of how accurate they are. (measured using chebyshev distance)

Example:
Listed coords: 100 69 420 (10 blocks accuracy)
Actual coords: 97 79 412

  1. While searching you are not allowed to use a block scanner, chorus fruit, ender pearls, or break blocks, unless the cache specifies you may do so.
@umnikos
umnikos / hopper.lua
Last active August 1, 2023 20:24
computercraft program: move items from A to B without any hassle
-- Copyright umnikos (Alex Stefanov) 2023
-- Licensed under MIT license
-- Version 1.2.1
-- CURRENTLY BUGGY, USE v1.2!
-- https://gist.githubusercontent.com/umnikos/72d4d537822b5f347e294edda2497648/raw/ad3e070385daab08b56dfbc1c9029290612dbba1/hopper.lua
local help_message = [[
hopper script v1.2.1, made by umnikos
@umnikos
umnikos / exchange.txt
Last active May 23, 2022 16:28
Exchange esolang specification
Exchange is a programming language in which atoms traverse lines and exchange numbers.
Atoms:
Atoms are unordered lists of positive integers (1, 2, 3, etc.). You can create a constant stream of new empty atoms with a >> symbol at the beginning of a line, or a single empty atom with a > symbol at the beginning of the line. You can also destroy atoms with a > symbol at the end of a line.
Example:
>----------->
Here an empty atom is created and then immediately destroyed.
Numbers in atoms: __
// ==UserScript==
// @name Kaboom superchording
// @namespace Kaboom
// @match https://pwmarcz.pl/kaboom/
// @grant none
// @version 0.6
// @author umnikos
// ==/UserScript==
// TODO:
@umnikos
umnikos / bandcamp-download.user.js
Last active January 31, 2022 18:04
Download button for bandcamp.com
// ==UserScript==
// @name Bandcamp downloader
// @namespace Bandcamp
// @version 1.0
// @description Adds a download button next to songs on bandcamp.com
// @author umnikos
// @match http*://*.bandcamp.com/*
// @license GPL3
// @grant GM_download
// @require https://cdn.jsdelivr.net/npm/@violentmonkey/dom@1
@umnikos
umnikos / saveload.user.js
Last active January 31, 2022 14:09
Kaboom save and load buttons (https://pwmarcz.pl/kaboom/)
// ==UserScript==
// @name Kaboom save and load
// @namespace Kaboom
// @match https://pwmarcz.pl/kaboom/
// @grant none
// @version 1.0
// @author umnikos
// ==/UserScript==
function isObject(item) {