Skip to content

Instantly share code, notes, and snippets.

@Rio6
Rio6 / makefile
Last active September 12, 2017 02:59
makefile template
SRCDIR:=src
BUILDDIR:=build
CXXFLAGS:=-O2 -Wall
LIBS:=-llibs
SRCS:=$(wildcard $(SRCDIR)/*.cpp)
HDRS:=$(wildcard $(SRCDIR)/*.hpp)
OBJS:= $(patsubst $(SRCDIR)/%.cpp,$(BUILDDIR)/%.o,$(SRCS))
TGT:=name
@Rio6
Rio6 / build.xml
Last active March 15, 2020 00:34
ant build.xml template
<project name="Name" default="dist" basedir=".">
<description>
Description
</description>
<property name="version" value="0.1" />
<property name="src" location="src"/>
<property name="build" location="build"/>
@Rio6
Rio6 / grub.cfg
Created November 19, 2017 22:59
Grub config to boot windows iso content
default=1
timeout=15
menuentry "Start Windows Installation" {
insmod ntfs
insmod search_label
insmod search_fs_uuid
search --no-floppy --set=root --fs-uuid <uuid>
ntldr /bootmgr
boot
@Rio6
Rio6 / IstrolidTheme.js
Last active March 30, 2024 21:10
Custom theme for Istrolid
var r26_theme = r26_theme || {};
// Function to hook
r26_theme.hooks = r26_theme.hooks || {
process: Interpolator.prototype.process,
drawSprite: Atlas.prototype.drawSprite
};
// Change this for different colors
r26_theme.theme = r26_theme.theme || {
@Rio6
Rio6 / SwapUnit.js
Last active May 13, 2020 21:08
Swap unit with mouse wheel in Istrolid
var scrollunit = {};
scrollunit.draw = buildBar.draw;
scrollunit.slotFleet = [6, 6, 4, 4, 7, 2, 3, 5, 5, 1];
scrollunit.slotIndex = [];
scrollunit.findUnitIndex = function(spec, fleet) {
for(var i = 0; i < 10; i++) {
if(commander.fleet[fleet + "," + i] === spec) {
return i;
@Rio6
Rio6 / Linemove.js
Last active January 12, 2019 02:25
Improved linemove for Istrolid
var linemove = {};
linemove.center = function(points) {
var rst = v2.create();
for(var point of points) {
v2.add(rst, point);
}
return v2.scale(rst, 1 / points.length);
}
@Rio6
Rio6 / archiveFleet.js
Last active January 28, 2020 23:53
Archive/restore fleets for Istrolid. Now obsolete.
/*
* From version 0.51.1, fleet tab replaces this mod
* Below is a script that transfers archived fleets to a new tab
*/
var moveArchive = function() {
if(!commander) {
setTimeout(moveArchive, 1000);
return;
}
@Rio6
Rio6 / copyPage.js
Last active December 28, 2021 23:00
A menu that lets you copy all your fleets to another account. Note: the overwrite button overwrites all fleets in the target account, not just one fleet.
// edited from original copy page so it only copies the fleets
//
(function() {
ui.copyPage = function() {
return ui.inScreen("menu", "Copy Import/Export", function() {
onecup.padding_bottom(100);
onecup.position("relative");
onecup.textarea("#commanderCode", function() {
onecup.position("absolute");
onecup.top(70);
@Rio6
Rio6 / fleetSwap.js
Last active October 9, 2021 17:34
Swap fleets using keyboard shortcut in Istrolid
/*
* Swapping fleet using shift + arrow up/down key.
* Use alt-shift-num to select one of the first 10 fleets
*/
var fleetSwap = window.fleetSwap || {
onkeydown: ControlsMode.prototype.onkeydown
}
ControlsMode.prototype.onkeydown = function(e) {
@Rio6
Rio6 / modloader.js
Last active April 16, 2022 16:39
Istrolid mod loader
// A mod loader for Istrolid
// To install, download asar file from https://www.dropbox.com/sh/loia3j5gryzyoga/AACC2FOEO_rB1iacyxT1TKUga?dl=0
// then replace Steam/steamapps/common/Istrolid/resources/app.asar with that file
// Alternatively, you can use whatever way you want to load this script at start up (Temper Monkey, Grease Monkey, whatever)
//edited from src/challanges.js
r26_modloader = window.r26_modloader || {
account_signinReply: account.signinReply
};