Skip to content

Instantly share code, notes, and snippets.

/*
* From version 0.51.1 the game already has this functionality
*/
@Rio6
Rio6 / bigBuild.js
Last active January 12, 2019 01:43
Enable larger build area. Open developer console (f10 on steam or f12 on browser), and paste the whole thing in. Backing up ship share code is recommended when building giant ships.
// Generated by CoffeeScript 1.12.7
(function() {
var offset, partSize,
modulo = function(a, b) { return (+a % (b = +b) + b) % b; };
window.NxN = 100;
window.SIZE = 20;
window.validSpec = function(player, spec) {
@Rio6
Rio6 / bigMap.js
Last active November 12, 2018 23:12
Istrolid big map mod
sim.numSpawns = 5;
sim.numComPoints = 16;
sim.mapScale = 3;
types.SpawnPoint.prototype["static"] = false;
sim.setRallyPoint = function(player, point) {
if (!player) {
return;
}
@Rio6
Rio6 / repl.js
Last active December 8, 2019 22:12
#!/usr/bin/node
var net = require('net')
var sock = net.connect(process.argv[3] || 5001, process.argv[2])
process.stdin.pipe(sock)
sock.pipe(process.stdout)
sock.on('connect', function () {
@Rio6
Rio6 / imageloader.js
Last active February 27, 2023 00:40
Load images into atlas so it can be drawn using `atlas.drawSprite()`
/*
* Load images into atlas so it can be drawn using `atlas.drawSprite()`
*
* Use imgloader.addImage(name, url) to add images you want to load
* Use imgloader.combineImages() after adding all the images
* Now you can use atlas.drawSprite(name, pos, size, rot, color) to draw the image
*/
if(!imgloader) {
var imgloader = {
@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
};
@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 / 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 / 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 / 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);
}