This tutorial I will show you
- how file load order works
- how to think and structure lua mods
- how to modify vanilla behaviour
- how to use
require
with passion - and more...
/** | |
* Updated for game version 2.4.0 | |
*/ | |
/** @param {NS} ns */ | |
export async function main(ns) { | |
ns.disableLog(`ALL`); // Failures are still logged, this just prevents unnecessary log spam. | |
ns.tprintf(`\x1b[1;35mUsing colors in script output with \x1b[1;36mtprint\x1b[1;35m & \x1b[36;1mtprintf\x1b[1;35m (terminal) and \x1b[36;1mprint\x1b[1;35m & \x1b[1;36mprintf\x1b[1;35m (log)`); |
version: '3.5' | |
networks: | |
default: | |
name: rclone | |
driver: "bridge" | |
services: | |
rclone: |
#!/usr/bin/env python3 | |
# | |
# original: https://gist.github.com/joswr1ght/595d49d5a7914cf7305b73512f37186a | |
import sys | |
def countips(netblock): | |
v = netblock.split('/') | |
# nothing? |
#!/usr/bin/env bash | |
# set -x | |
# Return commit of last successful WebKit build (default: GTK-Linux-64-bit-Release-Ubuntu-LTS-Build). | |
# Changes: | |
# 2022-11-16: Reworked script using changes suggested by asutherland to fetch commit number of last successful build directly from build.webkit.org. | |
BUILDER_NAME=${1:-GTK-Linux-64-bit-Release-Ubuntu-LTS-Build} |
#!/usr/bin/env bash | |
# shellcheck disable=SC2155,SC2034,SC2059 | |
# get script directory | |
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
# | |
# Register debug logger functions that are controlled by DEBUG= environment variable | |
# Examples: | |
# DEBUG=* - print all logs |
#! /bin/bash | |
# Usage: | |
# ./git-move.sh path1/ path2/... path/to/destination/repo | |
args=("$@") | |
# All but last argument: | |
paths=("${args[@]::${#args[@]}-1}") | |
# Last argument: | |
dest="${args[${#args[@]}-1]}" |
#!/bin/bash | |
# (C) Pekka Järvinen 2022 | |
# Name for bridge which virtual namespaces will use to communicate with each other | |
BRIDGENAME="gamebr0" | |
# Prefix for network | |
NETPREFIX="192.168.255." | |
# Starting IP (NETPREFIX + this) | |
let STARTIP=10 |
#!/bin/sh | |
set -eu | |
set -x | |
usage() { | |
cat <<'EOF' | |
difmap: diff two files after mapping them through a shell filter | |
Examples: |
#!/bin/bash | |
ansi() { printf "\e[${1}m${*:2}\e[0m"; } | |
bold() { ansi 1 "$@"; } | |
dgreen() { ansi "1;32" "$@"; } | |
green() { ansi "1;92" "$@"; } | |
yellow() { ansi "1;93" "$@"; } | |
orange() { ansi "38;5;214" "$@"; } | |
red() { ansi "1;91" "$@"; } | |
lblue() { ansi "1;96" "$@"; } |