Nov 14, 2021 5:23 pm
1. Grab your NPCs BBCode.
2. Visit https://token.otfbm.io/. It'll say "Thar be tokens here". It's like a premonition or something.
3. Press F12 and paste this code into the console window:
But replace the blue bit of text with your own NPC list, and press return.
4. The screen will show you your snippet list to paste into your custom character sheet.

Now to use them.
Inside a map tag, your OtFBM tokens will be available as snippets.
2. Visit https://token.otfbm.io/. It'll say "Thar be tokens here". It's like a premonition or something.
3. Press F12 and paste this code into the console window:
var npcs=`
[npcs="SKT"]
Augrek Brighthelm | https://imgur.com/MzE6Gur.jpg
Beldora | https://imgur.com/4GeTTJq.jpg
Darathra Shendrel | https://imgur.com/fkNf03l.jpg
Darz Helgar | https://imgur.com/8R6gykU.jpg
Duvessa Shane | https://imgur.com/gYvBfrY.jpg
Ghelryn Foehammer | https://imgur.com/E1ZrAOg.jpg
Lifferlas | https://imgur.com/q58uOwc.jpg
Markham Southwell | https://imgur.com/54cqnh6.jpg
Miros Xelbrin | https://imgur.com/V2UE8wz.jpg
Narth Tezrin | https://imgur.com/MO5aiLP.jpg
Naxene Drathkala | https://imgur.com/mUCQK3u.jpg
Oren Yogilvy | https://imgur.com/kKnPl5M.jpg
Othovir | https://imgur.com/wSqDRTP.jpg
Shalvus Martholio | https://imgur.com/FiQIhlf.jpg
Sir Baric Nylef | https://imgur.com/yaZzYTR.jpg
Sirac of Suzail | https://imgur.com/MHCAvLr.jpg
Urgala Meltimer | https://imgur.com/vgPgSz0.jpg
Yuan-ti | https://imgur.com/xbEiTYr.jpg
Zi Liang | https://imgur.com/2azZgwI.jpg
[/npcs]
`;
var npcRegEx=/^\s*(.*)\s*\|\s*(.*)\s*$/igm;
var npcList=npcRegEx.exec(npcs);
document.body.innerHTML='[snippets="OtFBM tokens"]<br/>';
var npcObjects=[];
do {
m = npcRegEx.exec(npcs);
if (m) {npcObjects.push({name:m[1].trim(),avatar:m[2].trim()});}
} while (m);
function fetchNextNpc(i){
fetch("https://token.otfbm.io/meta/"+btoa(npcObjects[i].avatar),
{method: 'GET',headers: {},mode: 'no-cors'})
.then(function (response){
response.text().then(function (text) {
var regexBody=/<body>(.*)<\/body>/g;
var arr = regexBody.exec(text);
document.body.innerHTML=document.body.innerHTML
+'#'+npcObjects[i].name
+'<br/>/a1-'+npcObjects[i].name
+'~'+arr[1]+'<br/>';
if((i+1)<npcObjects.length)
{fetchNextNpc(i+1);}
else
{document.body.innerHTML=document.body.innerHTML+'[/snippets]'}
})});
};
fetchNextNpc(0);
But replace the blue bit of text with your own NPC list, and press return.
4. The screen will show you your snippet list to paste into your custom character sheet.

Now to use them.
Inside a map tag, your OtFBM tokens will be available as snippets.

Last edited November 16, 2021 9:32 pm