Skip to content

Instantly share code, notes, and snippets.

Avatar

Kevin Streicher NoxMortem

  • Vienna
View GitHub Profile
View Shadowrun.js
// Github:
// By: Wandler, The Apprentice
// Contact:
var Shadowrun = Shadowrun || (function() {
'use strict';
var version = '0.0.1',
lastUpdate = 1427604268,
tableCache = {},
@NoxMortem
NoxMortem / css.css
Created Apr 26, 2016
[SR 5] Custom Script Supported: Wandlers Charactersheet v0.1
View css.css
/* Reset */
{}
div.sheet-wrapper{
margin-left: -25px !important;
margin-top: -25px !important;
width: 108% !important;
}
.sheet-wrapper input {
@NoxMortem
NoxMortem / css.css
Created May 14, 2016
Modified Shadowrun 5e sheet for kevin z (roll20)
View css.css
/* Uploaded to GitHub 12/07 */
/* No changes, resubmit of update */
/* Light colored background */
/* Template 2 */
.sheet-rolltemplate-sr2 table {
width: 100%;
background-color: white;
border: 1px solid #000;
View css.css
/* Uploaded to GitHub 12/07 */
/* No changes, resubmit of update */
/* Light colored background */
/* Template 2 */
.sheet-rolltemplate-sr2 table {
width: 100%;
background-color: white;
border: 1px solid #000;
View roll20 Python Extractor
import sys
import re
import os
prefix = sys.argv[1]
print("Extract:"+prefix);
def lreplace(pattern, sub, string):
"""
Replaces 'pattern' in 'string' with 'sub' if 'pattern' starts 'string'.
@NoxMortem
NoxMortem / parse.py
Created May 19, 2016
A tiny python script which parses an input file in the same folder for strings between "" or '' and searches for a prefix. Example usage: python parse.py "html.html" "attr_"
View parse.py
import sys
import re
import os
inputfile = sys.argv[1]
prefix = sys.argv[2]
print("Extract:"+prefix);
def lreplace(pattern, sub, string):
"""
View Working Example.js
on("sheet:opened change:repeating_attrmodkon remove:repeating_attrmodkon",function() {
TAS.repeating("attrmodkon")
.attrs("kon_mod") //< getting the attributes for the totals
.fields('value','active') //< specifying the fields we care about
.reduce(function(m,r){
var active = r.active;
if(active == "on"){
m += parseInt(r.I.value); //< Generate a running cost
}
return m;
View cleanup roll20.js
var cleanUp = function(){
var attributes_of_deleted = findObjs({type:'attribute'});
var abilities_of_deleted = findObjs({type:'ability'});
//log("#Attributes after delete: "+attributes_of_deleted.length);
var count = 0;
log("LIST trash attributes");
for(var attr in attributes_of_deleted){
attr = attributes_of_deleted[attr];
var chr = findObjs({type:'character',id:attr.get('characterid')});
View copyCharacter.js
var copyCharacter = function(name){
var characters = findObjs({type:'character'});
var i = characters.length;
var old = _.filter(characters,function(o){return o.get('name') === name})[0];
if(old === undefined){log("Character "+name+" not found!");return;}
var nr = 0;
var c_name = name+" "+nr;
while(_.filter(characters,function(o){return o.get('name') === c_name}).length>0){
nr++;//Increment counter until we found a unique character
c_name = name+" "+nr;
@NoxMortem
NoxMortem / css.css
Last active Jun 12, 2016
Kevin de Kerpel Charactersheet Hack Version 2016-06-12
View css.css
/* Uploaded to GitHub 12/07 */
/* No changes, resubmit of update */
/* Light colored background */
/* Template 2 */
.sheet-rolltemplate-sr2 table {
width: 100%;
background-color: white;
border: 1px solid #000;