Skip to content

Instantly share code, notes, and snippets.

@Rio6
Rio6 / prune-backup.sh
Last active September 7, 2022 01:39
Prune list of backup files to be daily, weekly, monthly, and yearly depending on the backup age.
#!/bin/sh
# usage: prune-backup [-f] files...
# By default the script prints files to be deleted. Use -f to actually delete.
# Assuming the file names have format of %Y-%m-%dT*
# exit on failure, disable glob
set -ef
filter_date() {
format="$1"
@Rio6
Rio6 / fleetshare.js
Last active January 12, 2022 15:14
Adds bottons to import and export individual fleet to the fleet menu for Istrolid.
/*
* Adds bottons to import and export individual fleet to the fleet menu
* by R26
*/
window.r26_fleetshare = window.r26_fleetshare || {
fleetUI: window.fleetUI,
};
r26_fleetshare.showShareBox = false;
r26_fleetshare.fleetNum = -1;
@Rio6
Rio6 / flip.js
Last active November 5, 2021 01:56
A script that lets you press f when dragging a part to flip it. Only works on your own client.
/*
* A script that lets you press f when dragging a part to flip it.
* Only works on your own client.
*
* by R26
*/
window.flipPartHooks = window.flipPartHooks || {
design_onkeyup: designMode.onkeyup,
design_rotatePart: designMode.rotatePart,
design_draw: designMode.draw,
@Rio6
Rio6 / scrollTab.js
Last active December 31, 2020 18:28
Enables scrolling on fleet tab buttons
/*
* Enables scrolling on fleet tab buttons
*
* Also change it so tabs can be deleted/renamed by clicking the buttons
* instead of dragging.
*
* by R26
*/
(function() {
@Rio6
Rio6 / copyFleet.js
Last active September 17, 2020 22:30
A script that exports your currrent fleet to a script that replaces your current fleet with the exported fleet
/*
* A script that exports your currrent fleet to a script that
* replaces your current fleet with the exported fleet.
*
* by R26
*/
console.log(`JSON.parse(atob("${btoa(JSON.stringify(commander.buildBar))}")).forEach((e, i) => buildBar.setSpec(i, e)); control.savePlayer()`);
@Rio6
Rio6 / alert.js
Last active July 25, 2020 04:56
Script that makes a notification sound when someone mentions your name in the chat
/*
* This script makes a notification sound when someone mentions your name in the chat
* You can also add more keywords by using r26_mention.keywords.push("morewords") after loading this
*/
window.r26_mention = window.r26_mention || {
chat_push: chat.lines.push,
keywords: [commander.name], // Can also be regex
sound: "data:audio/mpeg3;base64,SUQzBAAAAAAATVRYWFgAAAAgAAADY29tbWVudABNYWRlIHdpdGggQUNJRCBQcm8gNy4wAFRTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA//tQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAAcAAAuhgANDQ0WFhYWHx8fKCgoKDExMTo6OjpDQ0NMTExMVVVVVV5eXmdnZ2dwcHB5eXl5goKCi4uLi5SUlJSdnZ2mpqamr6+vuLi4uMHBwcrKysrT09PT3Nzc5eXl5e7u7vf39/f///8AAAAATGF2YzU4LjU0AAAAAAAAAAAAAAAAJAT7AAAAAAAALoZ/HZzqAAAAAAAAAAAAAAAAAAAAAP/7kGQAAAJ9F8gVPMAANoIX4Kw8AFZVe225h4AYswslhzBgAgPF4XMy245Doip9RyGmdbPe7Gr2fZ5MmTtoywQIQyzyaev2jvesTTHAgc9YIFz8SBhYPg/qDBQ5lAfeGP9QYEhzgh+Jz4P4f/wwU6wQ4kDEUgNYdp6+AAY1MCGCMJ64dlJ4JVoPvMnImA+oCQBgJZFT6HqOPAV7PuA8p+YePgEQAR0+GfgAIht2xuW3a27W27bfb/MTZ2AJNmUmzVt3HSTQmIbruZPD
@Rio6
Rio6 / istrol3d.js
Last active March 23, 2024 21:27
Turns Istrolid into 3D
/*
* Turns Istrolid into 3D
* by R26
*/
var istrol3d = window.istrol3d || {
GameMode_toGameSpace: GameMode.prototype.toGameSpace,
GameMode_fromGameSpace: GameMode.prototype.fromGameSpace,
BattleMode_reset: BattleMode.prototype.reset,
BattleMode_onmousemove: BattleMode.prototype.onmousemove,
@Rio6
Rio6 / br.sh
Last active August 27, 2020 22:25
Some qemu scripts
#/bin/sh
IFACE=enp59s0f1
test $UID -ne 0 && echo Need root && exit 1
modprobe tun
s6-rc -v2 -d change dhcpcd
wait $(pgrep -x dhcpcd)
@Rio6
Rio6 / magic.js
Last active February 24, 2024 21:52
This script shows stat change for parts on Magic server
/*
* This script shows stat change for parts on Magic server
*/
var magic = window.magic || {
process: Interpolator.prototype.process
};
Interpolator.prototype.process = function(data) {
if(data.settings || data.fullUpdate) {
@Rio6
Rio6 / Istrolid Magic Server Guide.md
Last active October 3, 2023 05:00
Istrolid Magic Server Guide

Istrolid Magic Server Guide

Old guide by Uthel can be found here.

The Magic server is a server made by R26. It's main goal is to let people change the variables for testing or for fun.

Commands

These are the commands avaiable on Magic server. Some of the commands can only be issued by the host.

!mode <game mode>

Change the game mode. Type !mode alone to get the list of game mode available.