Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Script] TokenNameNumber -- Automatic Numbering of Qualifying Tokens

1427851321
The Aaron
Pro
API Scripter
Happens to the best of us! :)
you think this is good? Check out the Bump script, its so much fun :P
1427853868
The Aaron
Pro
API Scripter
If you like the drag in action, you might like my MonsterHitDice script. =D
this one is awesome, bump is just amazing!
1428867475

Edited 1428867729
Kryx
Pro
Sheet Author
API Scripter
@The Aaron. I love this script. Though I need some guru guidance. I currently use the token's name to find a journal with a matching name as Jean-Francouis did for the default 5e importer. This obviously doesn't work with %%NUMBERED%% Is there another way I can get the journal from the token that will work with this script? Maybe "token.get('represents')"?
1428870778
The Aaron
Pro
API Scripter
Yeah, token.get('represents') will be the id of the character object, so that should work swimmingly. =D
Love this script Aaron, as Mark mentioned it does cause complications with some of the conversion / importing tools. Idea: how hard/easy would it be to have a variation that uses the same name, rather than %%numbered%%, but changes the "color" so that its unique, after it runs out of colors it just appends a 1 to the end of the name and goes back through the color scheme again. also, maybe to incorporate that if the "hp" bar get to 0 it changes the marker to the red X or Skull or something configurable. I think you had something like this second part already but I can't find it.
1428874917
The Aaron
Pro
API Scripter
Somewhat hard or somewhat not-automatic, possibly both. The %%NUMBERED%% marker not only sets the position where the number will be placed, but also lets the script know that the token is intended to be numbered. Once a token is placed on the page, there is a bit of regular expression magic that is used to determine if a copy/pasted token should be re-numbered, but that is build on the necessity of having that marker. I could make a version that would always append a number to the end of a token that was added to a page without the marker, but that would mean number PCs. I could add some exception system, but that starts to get quiet a bit more complicated... The script you're referring to is the MonsterHitDice script. I need to do some updating on it, but you can find it in my repo here: 5e: <a href="https://github.com/shdwjk/Roll20API/blob/master/Mo" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Mo</a>... other: <a href="https://github.com/shdwjk/Roll20API/blob/master/Mo" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Mo</a>... It started as a quick hack, and hasn't be updated to a full script yet, so apologies for the nasty config...
The hp &lt;=0 changing to skull or X marker on the token is in the hit dice script?
1428877194
The Aaron
Pro
API Scripter
It totally is... not. whoops! <a href="https://github.com/shdwjk/Roll20API/blob/master/Te" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Te</a>... Sorry, was distracted... =D
As for the colored number script what about an option to activate a script that will add a color, to all tokens with the same name? Would be easier than a drop right? And/or after the 8 colors the name change? Maybe an update to tokenmod? Just brainstorming.
1428878911
Kryx
Pro
Sheet Author
API Scripter
I fixed the issue on the shaped import/convert so it shouldn't be an issue now Greg. You can use this script with it to convert. :)
1428879080
The Aaron
Pro
API Scripter
That does give me an idea for a possible option. I could probably make a version of this script that would work without the marker by looking for duplicate names. It's unlikely that a PC name would be a duplicate after all. Could potentially provide an exemption based some character attribute (is_npc = 0, for example). Then as soon as you pulled 2 "Goblin" tokens onto the page, it could add a number to the end of each as well as successive instances.
@Mark awesome will try it out, thanks. @Aaron, yay... See I help, not just create work for you.
1428881230
The Aaron
Pro
API Scripter
Ha! Don't expect a release any time soon... I can only placate the GenKitty so long, have to work on group init...
1428911260
Gen Kitty
Forum Champion
Harrumph ^_- The GM of that game is on an 'internet sabbatical' until the end of the month, so I suppose you could work on items for other people , if that's what you really want to do. (/Rarity)
Lmao, wow the passive aggressive undertone in that statement makes my brain hurt. :) she at least realizes it, what changes to group-initial are on the horizon? I use that script to for monster Inits.
1428929249
vÍnce
Pro
Sheet Author
That's cool that you're working on an update for the Group Initiative script Aaron. Thanks :-P
1428930063
Gen Kitty
Forum Champion
Aaron knows darn well I'm teasing him. :&gt;
Yeah that was pretty clear even to an outsider like me. :)
1428937583
The Aaron
Pro
API Scripter
Hehehehe. Here's my GenKitty list: <a href="https://github.com/shdwjk/Roll20API/issues?q=is%3A" rel="nofollow">https://github.com/shdwjk/Roll20API/issues?q=is%3A</a>...
1428941122
Gen Kitty
Forum Champion
I only recall asking for one of those! Don't blame the whole list on me! ^_^
1428942739
The Aaron
Pro
API Scripter
Ha! Let's say they all came out of the conversation with you. :). Which was your #1?
1428948368
Gen Kitty
Forum Champion
Being prompted for an init bonus at macro run time, for GMs like mine who prefer to not set up journals for their mobs.
1428949013
The Aaron
Pro
API Scripter
That's certainly the easiest of the 4. :)
Hey Aaron. Do you (or anyone else for that matter) have a script to randomly roll a creatures hp when placed on the table? would be nice to be able to input the hd formula from the statblock so that each of your creatures has varying health rather than the average
1428962755
The Aaron
Pro
API Scripter
5e: <a href="https://github.com/shdwjk/Roll20API/blob/master/Mo" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Mo</a>... other: <a href="https://github.com/shdwjk/Roll20API/blob/master/Mo" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Mo</a>...
Zepth said: Hey Aaron. Do you (or anyone else for that matter) have a script to randomly roll a creatures hp when placed on the table? would be nice to be able to input the hd formula from the statblock so that each of your creatures has varying health rather than the average If you are using JF-Import be aware that Aaron's script although awesome doesn't modify HP's based on ConBonus, and Jf's Stat block script cuts the Monster HD block off to only use the 2d8, not the 2d8+2 listed in the MM for a creature with a +1 con bonus.
1428972367
The Aaron
Pro
API Scripter
Just so we're clear, is that Con bonus the +2 in your example? Mine just does /roll @{npc_hp} or whatever. If the attribute has the right formula, it will make the right roll.
that script is awesome, and so simple. Thanks Aaron
1429021434
Kryx
Pro
Sheet Author
API Scripter
The Aaron said: Just so we're clear, is that Con bonus the +2 in your example? Mine just does /roll @{npc_hp} or whatever. If the attribute has the right formula, it will make the right roll. The attribute using JF's importer does not have the right formula. He cuts off the +X. Though he has his own roll HP script built in. I leave the modifier in for my 5e Shaped importer and use the same built in script that JF does.
1429600961
The Aaron
Pro
API Scripter
Update 0.5.1: Added a help screen with the !tnn command, added GenConS configuration for Random Space, added multi-status setting for identification. Defaults to a rainbow of dots, but you can click them off and on in whatever order you like. With Dots turned on, it converts the token number to a representation based on the Dots you have configured: Since it is converting to a radix based on the number of selected statuses, the pattern of dots is always unique: Use whatever symbols you like:
1429607524
Kryx
Pro
Sheet Author
API Scripter
Aaron, this is amazing. I need to incorporate this into my game soon. I'll add a setting in my 5e import script to use your "%%NUMBERED%%" syntax.
1429610543
Ziechael
Forum Champion
Sheet Author
API Scripter
I think it is about time i started using this too... i have the 'auto-dead' script that uses the red dot which i use to use as part of a numbering system for my mooks... so that had to stop as it was crashing the lovely time saving 'this mook be dead now' script. I then just gave up numbering those suckers and let the players use language and pings to tell me who they were bullying. But with this latest development it's time i took the plunge and numbered those suckers for realsies. I was worried about revealing names but adding them to the initiative order already does that... i also worried about revealing the number of enemies but again that initiative order list screws me over there too (i'm not a fan of mass initiative by mook group, too overpowered in my opinion... or underpowered depending on the roll ;) ). Net result, yet another of Aaron's scripts making the cut for my campaign =D
1429610739
Kryx
Pro
Sheet Author
API Scripter
Ziechael said: I think it is about time i started using this too... i have the 'auto-dead' script that uses the red dot which i use to use as part of a numbering system for my mooks... so that had to stop as it was crashing the lovely time saving 'this mook be dead now' script. There is a script for that? Please share the link!
1429611367
Ziechael
Forum Champion
Sheet Author
API Scripter
Sure: Bloodied and Dead Status Markers - Extended For reference, i've had very little issues with it... mainly from pre-existing pages where token had red dots applied. Once i removed them and stopped using them for numbering it's been an absolute life saver, ironically. Worth taking the time to customise it with the user settings too to make it system or personal preference specific :) Have fun
1429619384
Gen Kitty
Forum Champion
Ziechael said: I think it is about time i started using this too... i have the 'auto-dead' script that uses the red dot which i use to use as part of a numbering system for my mooks... so that had to stop as it was crashing the lovely time saving 'this mook be dead now' script Adjust the auto-dead script to use the big red X for 'it be dead, boss'?
1429619917

Edited 1429620009
Ziechael
Forum Champion
Sheet Author
API Scripter
GenKitty said: Ziechael said: I think it is about time i started using this too... i have the 'auto-dead' script that uses the red dot which i use to use as part of a numbering system for my mooks... so that had to stop as it was crashing the lovely time saving 'this mook be dead now' script Adjust the auto-dead script to use the big red X for 'it be dead, boss'? Yup, i have that setup already... can't recommend it enough :) I was still getting odd behaviour when using the red dot for things regardless though so just live without the red dot, certainly not a deal breaker!
1429622682
The Aaron
Pro
API Scripter
You could just leave the red dot out of the TNN Dots list. :)
1429624935
Ziechael
Forum Champion
Sheet Author
API Scripter
Don't worry Aaron, went slightly off topic to highlight that the Bloodied and Dead Status Marker script caused conflict when i used red dots previously... and manually before using this script. The beauty of your script as you rightly say is that anyone using that script can simply omit the red dot if they are using dots for ID'ing mooks :)
1430871026
The Aaron
Pro
API Scripter
Update 0.5.2: Now much faster token renaming thanks to Stephen S. pointing out that although the on('add:graphic',...) event provides a malformed object, there is an immediately following on('change:graphic',...) which contains the fully formed object. I'm not queueing up the object id in the 'add', and when I get the next 'modify' for it, I do the rename. (Thanks Stephen S.!)
I just installed the new version, but it's not working for me - just giving me this: The older version was working properly, albeit with a delay. Could it be another script is interfering?
1430889232
The Aaron
Pro
API Scripter
Hmm. Possible? Are you running Blood and Honor? That seems to cause issues for some other scripts but shouldn't for this one...
1430889656
vÍnce
Pro
Sheet Author
New version isn't Not working for me either.
Hi Aaron, I have the same problem as Gozer and i'm not using the Blood and Honor script.
No Blood and Honor for me either.
1430890512
vÍnce
Pro
Sheet Author
It has to be the addition of the "Pink" dot in the latest verison Aaron. :-P
1430913103
The Aaron
Pro
API Scripter
Ha! Ok. I guess pm me some join links...
You've got mine already...
1430914998
The Aaron
Pro
API Scripter
Ok. Found it. Fixed it in your Campaign Gozer. Pushing out a fix now...