Last active
September 14, 2018 08:39
-
-
Save fmonaca/8067391 to your computer and use it in GitHub Desktop.
Creates an empty HERO System character sheet in Roll20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on('chat:message', function(msg) { | |
if(msg.type == 'api' && msg.content.indexOf('!newsheet ') != -1) | |
{ | |
var name = msg.content.substring(10); | |
var ocharacter = findObjs({ | |
_type: "character", | |
_name: name, | |
}); | |
if(ocharacter.length==0) | |
{ | |
var character = createObj('character', { | |
name: name, | |
bio: '', | |
gmnotes: '', | |
archived: false, | |
inplayerjournals: '', | |
controlledby: msg.playerid | |
}); | |
var sheetID = character.id | |
} | |
else | |
{ | |
var character = ocharacter[0]; | |
var sheetID = ocharacter[0].id; | |
} | |
createObj('attribute', { | |
name: 'STR', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'DEX', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'CON', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'INT', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'EGO', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'PRE', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'OCV', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'DCV', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'OMCV', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'DMCV', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'SPD', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'PD', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'ED', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'rPD', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'rED', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'REC', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'END', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'BODY', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'STUN', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'RUN', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'SWIM', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'Leap', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'tempOCV', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'tempDCV', | |
_characterid: sheetID | |
}); | |
createObj('attribute', { | |
name: 'tempRange', | |
_characterid: sheetID | |
}); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment