Skip to content

Instantly share code, notes, and snippets.

View palikhov's full-sized avatar
🐉
E5E / SRD 5.1 rus / Excel GM Tools

Anton Palikhov palikhov

🐉
E5E / SRD 5.1 rus / Excel GM Tools
View GitHub Profile
@palikhov
palikhov / Roll20 Macros.md
Created September 15, 2018 10:26 — forked from AndruC/Roll20 Macros.md
Macros that I use to improve my D&D games

Macro Must-Haves

These are my must-have macros for running games online. I make full use of the compendium, which gives these macros access to common actions and rolls, saving me time.

Remember to add /w gm or @{selected|wtype} to hide sensitive info from your players. WTYPE is an attribute used in the 5th Edition OGL character sheet, a prerequisite for most of these.

Here's what my bar looks like.

Macro Quickbar

Traceback (most recent call last):
File "c:\users\avpal\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\avpal\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\avpal\AppData\Local\Programs\Python\Python37-32\Scripts\mkdocs.exe\__main__.py", line 9, in <module>
File "c:\users\avpal\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "c:\users\avpal\appdata\local\programs\python\python37-32\lib\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
@palikhov
palikhov / handouts.js
Created February 11, 2019 08:09
Handouts: loop over each handout and ask if it should be visible to all players
(function () {
Campaign.handouts.models.forEach(h => {
if(confirm(`Make ${h.attributes.name} visible by all?`)) {
h.save({inplayerjournals: "all"});
}
})
})();
@palikhov
palikhov / Cards.js
Created February 11, 2019 08:09
Cards: minify playing card icons next to user avatars (lasts that session)
#playerzone .deckhands {
min-height: unset;
}
#playerzone .deckhands .hand .cardback img {
max-height: 20px;
max-width: 20px;
}
#playerzone .deckhands .hand .cardback span {
font-size: 12px;
}
@palikhov
palikhov / CreateNumbeOfCharacterSheets.js
Created February 11, 2019 08:10
: Character Sheets: create an arbitrary amount of blank characters that can be viewed and edited by everyone:
(function() {
var numCharacters = parseInt(prompt("How many blank characters should be created?", "1"));
for (var i = 0; i < numCharacters; i++) {
window.Campaign.characters.create({
name: `Blank Sheet ${i}`,
inplayerjournals: "all",
controlledby: "all"
});
}
})();
@palikhov
palikhov / MusicTrackEachDeleteorNo.js
Created February 11, 2019 08:11
Music Tracks: for each, track prompt whether it should be deleted or not
(function() {
let idx = Jukebox.playlist.models.length;
while(idx --> 0) {
const track = Jukebox.playlist.models[idx];
if(confirm(`Delete track "${track.attributes.title}"?`)) {
track.destroy();
}
}
})();
@palikhov
palikhov / LFG.js
Created February 11, 2019 08:11
Bookmarklet for LFG: to filter out Roll 20 LFG games with too many players
javascript:((thresh) => {$(`.lfglisting`).each((i, e) => {const $e = $(e);const cur = Number($e.find(`strong:contains('Current Player')`).text().replace(/^([\d,.]+) C.*$/g, "$1"));const open = Number($e.find(`span:contains('Open Slot')`).text().replace(/[()]/g, "").replace(/^([\d,.]+) O.*$/g,"$1"));const total = cur + open;if (total > thresh) $e.remove();});})(50);
@palikhov
palikhov / Clearjukebox.js
Created February 11, 2019 08:11
Jukebox: clear jukebox
(function(){
while(Jukebox.playlist.length) {
Jukebox.playlist.models[0].destroy();
}
d20.Campaign.save({jukeboxfolder: ""});
})();
@palikhov
palikhov / Jukeboxkeybind.js
Created February 11, 2019 08:12
Jukebox keybind: bind playlists/tracks to keys
(function() {
const startPlaylist = (playlistName) => {
$(`#jukeboxfolderroot div.folder-title:contains("${playlistName}")`).closest(".dd-content").find(".playlistcontrols .play").click();
};
const startTrack = (trackName) => {
$(`#jukeboxfolderroot .jukeboxitem .title:contains("${trackName}")`).closest(".dd-content").find(".play").click()
};
Mousetrap.unpause();
@palikhov
palikhov / Character2Handout.js
Created February 11, 2019 08:12
Character to Handout: Migrate character bio/gm notes/avatar into handouts with the character names
(function(){
Campaign.characters.models.forEach(m => {
if(!confirm(m.attributes.name)) return;
let handout = Campaign.handouts.create({
name: m.attributes.name,
avatar: m.attributes.avatar
});
const migrateBlob = (sourceName, destName) => {