Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Kyle Spier-Swenson MrStonedOne

🎯
Focusing
Block or report user

Report or block MrStonedOne

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:40885c342ab4b9ef5a67ecd1c4a7eb1c
//here is some mouse proc debugging code you can use in a test project to figure out how mouse calls work.
/client
Click(...)
world << "[.....]([args.Join(", ")]) = `[. = ..()]`\n"
MouseDown()
world << "[.....]([args.Join(", ")]) = `[. = ..()]`\n"
MouseUp()
world << "[.....]([args.Join(", ")]) = `[. = ..()]`\n"
MouseDrag()
View IsBanned.dm
//Blocks an attempt to connect before even creating our client datum thing.
//How many new ckey matches before we revert the stickyban to it's roundstart state
//These are exclusive, so once it goes over one of these numbers, it reverts the ban
#define STICKYBAN_MAX_MATCHES 20
#define STICKYBAN_MAX_EXISTING_USER_MATCHES 5 //ie, users who were connected before the ban triggered
#define STICKYBAN_MAX_ADMIN_MATCHES 2
/world/IsBanned(key,address,computer_id,type,real_bans_only=FALSE)
log_connection_debug("[.....]([args.Join(", ")]): Start")
@MrStonedOne
MrStonedOne / code.dm
Created Dec 30, 2018
object defined template language preview
View code.dm
/client/verb/Display_Tokens()
var/list/characterMappings = list()
for (var/type in typesof(/datum/templateToken))
var/datum/templateToken/tType = type
var/character = initial(tType.character)
var/word = initial(tType.word)
if (isnull(character))
continue
@MrStonedOne
MrStonedOne / _output.txt
Last active Sep 23, 2018
Memory usage stats of different collections in BYOND
View _output.txt
Sample Size = 500000
Starting Usage = 39.09mb
List of lists, before fill: 42.96mb Diff:3.87mb Each:8.12b
List of lists, after fill: 61.04mb Diff:18.08mb - 37.92b
List of datums, before fill: 64.87mb Diff:3.82mb Each:8.02b
List of datums, after fill: 83.14mb Diff:18.27mb Each:38.32b
List of strings, before fill: 86.96mb Diff:3.82mb Each:8.01b
List of strings, after fill: 162.11mb Diff:75.14mb Each:157.59b
List of strings, preloaded string tree, before fill: 165.93mb Diff:3.83mb Each:8.03b
List of strings, preloaded string tree, after fill: 165.94mb Diff:4kb Each:0.01b
View 1output.txt
Sample Size = 100000
List of lists, before fill: 824kb - 8.44b
List of lists, after fill: 3.98mb - 41.74b
List of datums, before fill: 784kb - 8.03b
List of datums, after fill: 3.86mb - 40.47b
List of strings, before fill: 784kb - 8.03b
List of strings, after fill: 15.66mb - 164.21b
Assoicated list of strings, before fill: 784kb - 8.03b
Assoicated list of strings, after fill: 18.43mb - 193.29b
View buildtgstation-cron.sh
#!/bin/bash
cd ~/git/tgstation
git fetch
git reset --hard origin/master
git clean -df
DreamMaker -o tgstation.dme > ~/web/public/objecttree.xml
zip -jD9 /home/static/web/public/byond/tgstation.zip tgstation.rsc
mkdir -p /home/static/web/public/nightlies/$(date '+%Y/%m')
View runtimes.txt
[2018-07-08 02:41:56.058] ### VarEdit by MrStonedOne/(MrStonedOne): /datum/controller/subsystem/timer last_invoke_tick=13689.5 => 1
[2018-07-08 02:41:56.070] ## WARNING: No regular timers processed in the last 600 ticks, resetting buckets! in code/controllers/subsystem/timer.dm at line 51 src: Timer usr: .
[2018-07-08 02:41:56.071] Timer bucket reset. world.time: 13698.5, head_offset: 12600, practical_offset: 1017
[2018-07-08 02:41:56.073] Active timers at index 24:
[2018-07-08 02:41:56.075] Timer: Timer: 22702 ([0x210c120b]), TTR: 13211.5, Flags: TIMER_STOPPABLE, callBack: [0x2111a14f], callBack.object: some_magic_bullshit[0x600037f](GLOBAL_PROC), callBack.delegate:/proc/qdel(the green laser)Prev: NULL, Next: NULL
[2018-07-08 02:41:56.077] Active timers at index 60:
[2018-07-08 02:41:56.077] Timer: Timer: 22733 ([0x21138387]), TTR: 13229.5, Flags: TIMER_STOPPABLE, callBack: [0x2112fd6f], callBack.object: some_magic_bullshit[0x600037f](GLOBAL_PROC), callBack.delegate:/proc/qdel(the green laser)Prev: Timer: 22
View meta mem usage.dm
//the final number in a line is the usage, the previous numbers are the after and before total memory usage
mem:_maps/map_files/MetaStation/MetaStation.dmm(mapload):229.46MB-227.61MB=1.85MB
mem:_maps/map_files/MetaStation/MetaStation.dmm(mapload):255.37MB-230.09MB=25.29MB
mem:_maps/map_files/Mining/Lavaland.dmm(mapload):255.38MB-256.96MB=-1.65478e+006B
mem:_maps/map_files/Mining/Lavaland.dmm(mapload):290.12MB-255.87MB=34.25MB
mem:_maps/map_files/generic/City_of_Cogs.dmm(mapload):293.19MB-291.14MB=2.05MB
mem:_maps/RandomRuins/SpaceRuins/spacehotel.dmm(mapload):301.45MB-299.93MB=1.52MB
mem:/turf/closed/mineral(new()):27.61MB
mem:/turf/closed/mineral/random(new()):27.61MB
View gist.dm
/world/turf = /turf/open/space/basic
/turf
icon = 'space.dmi'
icon_state = "0"
name = "\proper space"
var/intact = 0
plane = -95
layer = 8.5
var bv1 = 91.21312
var bv12 = 91.21323
View The memory of a z - bare project.md

server mem usage:

Prototypes:

  • obj: 2156 (20)
  • mob: 2172 (1)
  • proc: 7452 (53)
  • str: 16496 (586)
  • appearance: 17576 (5)
  • id array: 10580 (117)
  • map: 8248 (255,255,0)
You can’t perform that action at this time.