Skip to content

Instantly share code, notes, and snippets.

View PJB3005's full-sized avatar
🤔
Wondering why anybody would use these status messages.

Pieter-Jan Briers PJB3005

🤔
Wondering why anybody would use these status messages.
View GitHub Profile
@PJB3005
PJB3005 / grayscale_falloff_gen.py
Last active January 29, 2016 22:47
Python grayscale falloff generator for BYOND.
#!/usr/bin/env python
# To run this you need the BYONDTools library, get it here: https://gitlab.com/N3X15/ByondTools
# It takes exactly 1 extra argument, the size of the falloff area to calculate.
# For example: $ python grayscale_falloff_gen.py 5`
# MIT Licensed.
from __future__ import division # For all the nerds using Python 2, yes I'm aware BYONDTools doesn't even correctly install without modifications in 3.
from PIL import Image
from math import sqrt
from sys import argv
from byond.DMI import DMI, State
@PJB3005
PJB3005 / changelog.py
Created May 14, 2016 19:48
SS13 changelog bot for /vg/station
#!/usr/bin/python
# Ran through https://github.com/carlos-jenkins/python-github-webhooks
# Uses gitpython
import sys, os, os.path, json, re, time
from git import Repo
starttime = int(time.time())
print starttime
with open("time.txt", "w+") as timefile:
timefile.write(str(starttime))
@PJB3005
PJB3005 / Boxpox.md
Last active July 7, 2016 04:45
All issues with box station.

A list of issues with /vg/ Box Station.

There is a very big gap in the /vg/station13 community due to the different maps and their different quality levels. The most picked map however, is Box Station.

Box Station has existed for ages and is the most used map for a lot of code bases which stem from TG originally. However I do not believe it aged well. A lot of issues have begun to arise which would take a ton of work to fix and require redoing entire departments. This Gist details those issue.

Poor mapping

Box hasn't ages well, and as a result there are poorly mapped in areas around the place. Here are some examples:

@PJB3005
PJB3005 / .atom-build.json
Last active October 4, 2018 06:51
So you want to ascend to Atom for coding BYOND?
{
"cmd": "C:/Program Files (x86)/BYOND/bin/dm.exe",
"args": [ "C:/path/to/your/specific/code.dme" ],
"sh": false,
"errorMatch":
[
"\n(?<file>[\\\\\/0-9a-zA-Z\\._]+):(?<line>\\d+).*"
]
}
@PJB3005
PJB3005 / nearest_dmi.py
Last active July 31, 2016 13:56
32->64
#!/usr/bin/env python2
# Requires Pillow (fork of PIL) and BYONDTools.
# For Pillow you can just run "$ pip instal pillow" (without quotes) in a terminal.
# If your PATH doesn't include Python just go to %Python directory%/scripts/, it's in there.
# As for BYONDTools: download a ZIP of https://gitlab.com/N3X15/ByondTools, then run setup.py install from a terminal.
from __future__ import print_function
from byond.DMI import DMI
from byond.DMI.State import State
import PIL.Image
import os
@PJB3005
PJB3005 / vgui_server_draft.dm
Last active August 22, 2016 11:31
/vg/UI public API draft.
///// /datum LEVEL.
// PUBLIC API.
/*
This is the proc used to open a UI on a datum. No exceptions.
Arguments:
- user: Mob to open the UI for.
- force_reopen: Whether to forcefully reopen the UI instead of updating it if it is already open.
- exargs: Extra arguments to pass to ui_config(). See below.
Returns:
#!/usr/bin/env python2
from __future__ import print_function, division
from flask import Blueprint, request, render_template, abort, send_file
import os.path
import os
import byond.DMI
import PIL.Image
import random
@PJB3005
PJB3005 / __init__.py
Created October 14, 2016 20:55
Discord Relay
#!/usr/bin/env python2
from __future__ import print_function
from flask import Blueprint, request, abort
from multiprocessing.connection import Client
discordrelay = Blueprint("discordrelay", __name__)
@discordrelay.route("/discord")
def relay():
message = {
Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)
Import-Module posh-git
# Set up a simple prompt, adding the git prompt parts inside git repos
function global:prompt {
$realLASTEXITCODE = $LASTEXITCODE
Write-Host($pwd.ProviderPath) -nonewline -ForeGroundColor green
import colorsys
from random import randint
for x in range(10):
h = randint(0, 360)
s = randint(0, 100)
l = randint(0, 100)
r, g, b = colorsys.hls_to_rgb(h/360, l/100, s/100)