Skip to content

Instantly share code, notes, and snippets.

View FelixWolf's full-sized avatar
💭
https://youtu.be/NvVFHIr6T9Y

Kyler "Félix" Eastridge FelixWolf

💭
https://youtu.be/NvVFHIr6T9Y
View GitHub Profile
#!/usr/bin/env python3
from PIL import Image
from PIL import ImageShow
ImageShow.register(ImageShow.DisplayViewer, 0)
def lerp(a, b, p):
return a + p * (b - a)
def bilinear(a, b, c, d, x, y):
@FelixWolf
FelixWolf / shutdown.ds
Created January 12, 2023 02:07
Close dream
* Ensure it is set to zero. It should already be set to zero but do it just in case.
(0:0) When everything is starting up,
(5:300) set variable %dreamclosed to the value 0.
* Restrict it to the owner
(0:31) When someone says {!closedream},
(1:10) and they are the Dream owner,
(5:300) set variable %dreamclosed to the value 1.
* This works because anyone entering the dream will trigger it
import logging
from django.conf import settings
from django.urls import get_urlconf, set_urlconf
logger = logging.getLogger(__name__)
#We only really need the lower case variant, so cast it to lower case
#instead of doing it every time
ROOT_HOSTROOT = ("localhost",)
if hasattr(settings, "ROOT_HOSTROOT"):
#!/usr/bin/env python3
import struct
import io
"""
* indicates comment, this is read until newline
{ indicates string literal start.
} indicates string literal end.
@ indicates raw integer variable number. (EG: @12)
% indicates integer variable. (EG: %fdsa)
~ indicates a string variable.
@FelixWolf
FelixWolf / dspires_convert.py
Created November 2, 2022 02:27
Convert dragonspires map format to furcadia map format
#!/usr/bin/env python3
import struct
tiles = []
items = []
width = 52
height = 100
def decode(head, tack):
return (head*95+tack)
for z in range(1, 51):
MAP <integer version> Furcadia
Key=Value (Repeat key value property until reading next element)
BODY (Specifically \nBODY\n)
unsigned short floors[width*height]
unsigned short objects[width*height]
unsigned byte walls[width*height * 2]
if version > 1.30:
unsigned short regions[width*height]
unsigned short effects[width*height]
if version >= 1.50:
@FelixWolf
FelixWolf / bramble_maze.py
Created October 25, 2022 11:06
Bramble Maze
#!/usr/bin/env python3
from PIL import Image
import struct
palette = [
0x00000000, 0x000001ff, 0xfffffeff, 0xb57b4aff, 0xf0e0c0ff, 0xa88068ff,
0x784830ff, 0x906810ff, 0xe08048ff, 0xf0e8e8ff, 0xc07800ff, 0x18a800ff,
0x502818ff, 0x604808ff, 0xb09058ff, 0x3888c8ff, 0xe06068ff, 0x108000ff,
0xd6d6ceff, 0xb53129ff, 0x940808ff, 0xb50000ff, 0xad2910ff, 0xbd4218ff,
0xe74a52ff, 0xb53910ff, 0xce4a52ff, 0xbd3918ff, 0x943110ff, 0xd67318ff,
0xa53918ff, 0xde7b42ff, 0x9c4218ff, 0xe7844aff, 0xbd5a18ff, 0xce6318ff,
@FelixWolf
FelixWolf / simple_fs.py
Last active September 22, 2022 14:03
Public Domain (Or zlib, take your pick!) implementation of a simple file system. No support for file or directories (YET), but structure is there.
#!/usr/bin/env python3
"""
Description:
Virtual file system implementation.
Currently supports blocks, block chaining, and block bitmaps.
No support for files and directories, but the structure is there.
Publishing this as-is right now in case I never get around to finishing it.
Check back for updates.
Flaws:
@FelixWolf
FelixWolf / sl_puppetry.md
Last active September 8, 2022 16:23
How to install, setup, and use the puppetry viewer and plugins

How to use LEAP on windows

Note on instructions

There are a lot of steps involved here, but that's because this is in-development. Once this is finalized, people will be developing stuff that is stand alone, without the need to install all this stuff.

Important pre-install steps

If you have python installed from the windows store, UNINSTALL IT! Windows store installs python in a virtual environment, which makes it not work