Skip to content

Instantly share code, notes, and snippets.

@Rio6
Rio6 / istrolid-turing.js
Created July 13, 2019 05:12
Make tesla turing complete
parts.TeslaTurret.prototype.energyDamage = 10000;
parts.TeslaTurret.prototype.damage = 0;
parts.TeslaTurret.prototype.bounceRange = 150;
parts.TeslaTurret.prototype.maxZap = 2;
if(typeof(log_makeBullet) === "undefined") {
log_makeBullet = parts.TeslaTurret.prototype.makeBullet;
}
if(typeof(log_zap) === "undefined") {
@Rio6
Rio6 / autostarter.js
Last active July 30, 2019 22:17
Auto start game when you are host in istrolid
var autostart = autostart || {
hasPlayer: false,
lastState: sim.state,
intv: null,
say: function(msg) {
if(chat.channel === "local") {
chat.lines.push({
text: msg,
name: commander.name,
color: commander.color,
@Rio6
Rio6 / unitbubble.js
Last active January 30, 2020 07:30
show unit data in a bubble when selected. Press t to toggle
var ub_window_body = ub_window_body || window.body;
var ub_battlemode_onkeydown = ub_battlemode_onkeydown || battleMode.onkeydown;
var ub_enabled = false;
function ub_drawBubble() {
let fmod = function(a,b) { return Number((a - (Math.floor(a / b) * b)).toPrecision(8)); };
let wrapAngle = th => {
let rst = fmod(th + Math.PI, 2 * Math.PI);
return rst < 0 ? rst + Math.PI : rst - Math.PI;
};
@Rio6
Rio6 / replay.js
Last active April 10, 2024 01:14
Replay script - records, save, and replay istrolid games
/*
* Replay script - records, save, and replay istrolid games
*
* After loading the script, it's recommended to rejoin the server or press the
* "Reset Game" button in case of local to reload the interpolator.
*
* Loading non-normal saves - saves from modded games, corrupted or modified
* saves - might brake the game client. Just restart the game and not to load
* that file.
*
@Rio6
Rio6 / stickyTab.js
Last active May 16, 2020 21:33
Istrolid sticky fleet tab for browsers that doesn't support position: sticky
(function() {
var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
var slice = [].slice;
eval(onecup.import());
FleetMode.prototype.newTab = false;
FleetMode.prototype.editTab = false;
@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.

@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 / 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 / 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 / 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