Skip to content

Instantly share code, notes, and snippets.

@cgarz
cgarz / English.txt
Last active February 18, 2023 23:34
A quick gist to help show the specific changes in the Worms Armaggeddon language file mod. Click revisions to see whats been added/removed/tweaked.
English
#version 3.8.1
# Generic
BLANK " "
CUSTOM "\1"
YES "Yes"
NO "No"
@cgarz
cgarz / wa_character_encoding.py
Last active October 22, 2021 04:37
Simple script to convert text files to WA (Worms Armageddon) encoded format. For wkTextMacros (https://worms2d.info/WkTextMacros).
#!/usr/bin/env python3
# based on https://github.com/elfoor/armabuddy/blob/master/wa_encoder.py
# char table detailed here: https://worms2d.info/WA_character_table
# pyinstaller exe version:
# https://cdn.discordapp.com/attachments/863028348351807488/898253659601797190/wa_character_encoding.exe
import os
import argparse
WA_CHAR_TABLE = (
@cgarz
cgarz / waTotalTimeSum.py
Last active March 23, 2021 06:05
Simple python script for Worms Armageddon to get the total time from all replay files logs. Optionally exporting them first if not present.
#!/usr/bin/env python3
from datetime import timedelta
from subprocess import run, DEVNULL
from mmap import mmap, ACCESS_READ
import os, re
# CHANGE ME
WA_DIR = r'C:\PATH\TO\WA\INSTALL\CHANGE\ME'
@cgarz
cgarz / hackeyMotionWaitVibrate.sh
Created November 8, 2020 17:42
A hacky Termux bash script that uses the accelerometer to make an alarm that fires when the phone changes orientation.
#!/data/data/com.termux/files/usr/bin/bash
echo "getting wake lock state"
termux-notification-list | jq -r '.[] | select(.id == 1337).content' | grep -qF 'wake lock held' && locked="true" || locked="false"
if [ "$locked" = "false" ]; then
echo "wake lock not set, setting for duration of script"
termux-wake-lock
else
echo "wake lock set, Will not alter wake lock state."
fi
@cgarz
cgarz / messageLoggerParse.py
Last active November 2, 2020 01:41
A small script to parse messages from a specific time range from the better discord plugin MessgeLoggerv2's json file. Made specifically for WA dojo.
#!/usr/bin/env python3
import json
import datetime
CHANNELS = {
506442111084920845: 'about',
733402345316286464: 'members',
497469150881513472: 'news',
497471609553158164: 'worms-faq',
@cgarz
cgarz / ytwls.py
Created April 29, 2020 03:43
Youtube watch later stats. Gets statistics and video links from your watch later playlist using python3, requests, BeautifulSoup and browser_cookie3 for authentication.
#!/usr/bin/env python3
# adapted from https://github.com/bulbipop/ytwlstats/blob/master/cmd.py
from bs4 import BeautifulSoup as bs
from datetime import datetime, timedelta
from argparse import ArgumentParser
from filecmp import cmp as compare
import requests
import browser_cookie3
@cgarz
cgarz / waReplayRes.vbs
Created April 29, 2020 03:00
Small vbscript to play WAgame replay files with Worms Armageddon at a specific resolution. Useful for recording.
'Define desired variables
exe_directory = "C:\Program Files (x86)\Steam\steamapps\common\Worms Armageddon"
exe_filename = "WA.exe"
res_x = 800
res_y = 600
'======== Script start ========
'Quit with error return (1) if not a .WAgame file
replay_file = WScript.Arguments(0)
@cgarz
cgarz / spotifySavedTracks.py
Created February 2, 2020 10:56
Pretty print all saved tracks and associated info from a Spotify account using Spotipy
#!/usr/bin/env python3
import spotipy
import dateutil.parser
USERNAME = 'XXX'
CLIENT_ID = 'XXX'
CLIENT_SECRET = 'XXX'
REDIRECT_URI = 'http://localhost/'