Skip to content

Instantly share code, notes, and snippets.

@branleur
branleur / keycodegen.py
Created June 14, 2024 00:41
Dink keyboard key script identifier
# Run this in your STORY subdir to generate some key-*.c scripts for testing with
from os.path import exists
for i in range(24,256):
fname = "key-" + str(i) + ".c"
if not exists(fname):
with open(fname, "w") as f:
f.write("void main()\n{\nint &key = " + str(i) + "\n say(\"Key is &key\", 1)\nkill_this_task()\n}")
print("Wrote " + fname)
else:
@branleur
branleur / ddecompress.py
Created June 10, 2023 16:28
Dink Smallwood d2c decompressor
"""ddecompress - attempts to decompress .d script files"""
import click
import struct
import os
import glob
@click.command()
@click.argument("path")
def checkpath(path):
"""Checks to see if you've provided a dir or a script path"""