Skip to content

Instantly share code, notes, and snippets.

@scooper4711
scooper4711 / setDiscordUsernames.js
Created November 28, 2025 04:35
Associate discord usernames with FoundryVTT users. This is needed for the exportSceneToSage.js gist
// FoundryVTT Macro: Set Discord Usernames for Users
// This macro allows the GM to map Foundry usernames to Discord usernames
(async () => {
// Check if user is GM
if (!game.user.isGM) {
ui.notifications.warn("Only the GM can set Discord usernames");
return;
}
@scooper4711
scooper4711 / exportTokensToSage.js
Last active November 30, 2025 13:56
Exports selected tokens to a TSV format suitable for import into SageRPG
// FoundryVTT Macro: Export Selected Tokens to TSV
// This macro exports selected token data to a tab-separated value format
(async () => {
// Check if any tokens are selected
let selectedTokens = canvas.tokens.controlled;
if (selectedTokens.length === 0) {
ui.notifications.warn("Please select at least one token");
return;
}
@scooper4711
scooper4711 / exportSceneToSage.js
Created November 28, 2025 04:32
Exports the current FoundryVTT scene to RPGSage.io map format, for use with https://rpgsage.io/maps/
// FoundryVTT Macro: Export Current Scene to Map File
// This macro exports the current scene data to a map file format
(async () => {
// Get the current scene (not necessarily the active one)
const scene = canvas.scene;
if (!scene) {
ui.notifications.warn("No scene is currently loaded");
return;
}
@scooper4711
scooper4711 / computeChallengePoints.js
Created May 19, 2025 01:37
Pathfinder Society Challenge Point Calculator
// This FoundryVTT macro will calculate the challenge points for
// a pathfinder society game.
// It pops up a dialog asking how many players (2-6), and
// the lowest allowed level for the adventure.
// Based on those answers, it will ask for the level for each
// character.
// it will then output a chat card with the number of pre-generated
// NPCs needed, the level for the pre-gens and how many
// Challenge points.