Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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) {
/*
* From version 0.51.1 the game already has this functionality
*/
@Rio6
Rio6 / apod-bg
Last active May 27, 2019 01:05
Use apod as wallpaper
#!/bin/sh
#wait for internet
while ! ping -q -w 1 -c 1 apod.nasa.gov > /dev/null; do sleep 5; done
html=$(curl https://apod.nasa.gov/apod/astropix.html)
yturl=$(grep -Eom1 "https://www.youtube.com/embed/[^\"]+" <<< "$html")
if [ ! -z $yturl ]; then
youtube-dl "$yturl" -o /tmp/apod
name=$(echo /tmp/apod.* | cut -f 1 -d ' ')
@Rio6
Rio6 / _partLoader.js
Last active April 16, 2020 19:41
Community made parts. _partLoader.js loads all the parts automatically with images so you just need to load that one. Try load this mod before others if there's any conflict with other mods.
/*
* Loads all weapons in this gist, plus their images
*/
if(!window.partLoader_partsLoaded) {
let imgloaderUrl = "https://gist.githubusercontent.com/Rio6/456ce90a98f38d74d095e7caf5a63f31/raw/"; // image loader
let parts = [
"https://gist.githubusercontent.com/Rio6/51e853a5d8252a9a362c80e29f6c82d1/raw/energyBeam.js", // Leach beam
"https://gist.githubusercontent.com/Rio6/51e853a5d8252a9a362c80e29f6c82d1/raw/jwdeWeapons.js", // Battle Cannon, Needle Gun
@Rio6
Rio6 / ffaui.js
Last active July 14, 2020 23:08
UI fix for istrolid custom FFA mode
(function() {
var ffaTypes = ["FFA", "IO", "Race"];
eval(onecup["import"]());
quickScorePlayer = function(player) {
if (player.side === "dead") {
return;
}
@Rio6
Rio6 / teamChat.js
Last active June 22, 2019 21:31
Team chat for istrolid
/*
* Super hackable team chat
*
* Put $ sign in front of your message and it will get encrypted
* Only people who has this script and is on your team will be able to understand it
*/
if(!teamChat) {
var teamChat = {
network_end: RootConnection.prototype.send,
#!/bin/sh
# A script to record a screen area using ffmpeg
while getopts hwso:: opts; do
case $opts in
h)
echo "$0 [-w | -s] [-o dir]"
exit
;;
w)
echo "Select win"