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

How to get the id of a Token

1587381895

Edited 1587385140
Hello, this is my first time posting here. I'm new to using the API. I am trying to figure out how to get the id of a selected token in order to dynamically write abilities to the NPC (monster, standard NPC, etc.). Specifically what I am trying to accomplish is when I drop a token on the fieldI would like to check if there is an ability named "menu-macro" and if not write a series of standard abilities for that NPC; e.g perception check. a menu of repeating attacks, etc. I want to write these abilities so that I can standardize the "macro buttons" in order to speed up game play.  I have the function to create abilities handled, but I am struggling with the code to simply grab the id of the token that I have selected. It is surprisingly not well documented or I am just an idiot who isn't reading the documentation well. :) Any help anyone could provide would be great! Thanks!
1587384562
Andreas J.
Forum Champion
Sheet Author
Translator
This might help: Character and Token ID Lookup Macro
Andreas J. said: This might help: Character and Token ID Lookup Macro Thanks Adreas J. ! However I found this in my continued searching and it is exactly what I was planning on writing. No need to reinvent the wheel. This is a perfect solution.&nbsp;<a href="https://app.roll20.net/forum/permalink/8458497/" rel="nofollow">https://app.roll20.net/forum/permalink/8458497/</a>