This file contains 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
async function setName(type) { | |
const token = canvas.tokens.controlled[0] | |
if (!token) { | |
return; | |
} | |
if (type === "Dragon") { | |
const dragonTable = game.tables.getName(`Dragon Name`); | |
let dragonName = await dragonTable.roll(); | |
return token.document.update({name: `${dragonName.results[0].text}`}); |
This file contains 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
const searchMachine = Machine({ | |
id: 'search', | |
initial: 'idle', | |
context: { | |
results: [], | |
errorMessage: null, | |
}, | |
states: { | |
idle: { | |
on: { FETCH: 'loading' }, |
This file contains 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
[alias] | |
## | |
# One letter alias for our most frequent commands. | |
# | |
# Guidelines: these aliases do not use options, because we want | |
# these aliases to be easy to compose and use in many ways. | |
## | |
a = add |
This file contains 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
const tsA = [[1, 'a'], [3, 'c'], [4, 'c'], [8, 'b'], [9, 'a']] | |
const tsB = [[1, 'c'], [2, 'b'], [3, 'c'], [4, 'a'], [5, 'b'], [7, 'a'], [9, 'a']] | |
function getNext(A, B) { | |
let smallestA = A[0]; | |
let smallestB = B[0]; | |
if (!smallestB && smallestA) { | |
return A.shift() | |
} |