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

API thay asks question

I am pretty sure the answer to this is no but I need to ask.  Is there anyway to have an API ask a question at startup?  I am tring to get an api to check if a charecter has been deleted or archived.  If so, I want to ask the gm if he wants to remove them from the api influence.  I know I can output a button to the chat but I would like to popup a window.
1488087183

Edited 1488087497
PaprikaCC
API Scripter
Yes you can make scripts run at startup! Just use: on(ready, function(){ "use strict"; yourFunction() yourOtherFunction() }) However you cannot create a new browser window (the API cannot manipulate the DOM). At most you can just make a fancy chat message with a bunch of buttons to remove deleted characters.
1488118281

Edited 1488120378
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yep, what paprika said. For an example of how command button menu formatting looks, check pretty much any Aaron script or my scripts: EasyExperience, PageNavigator, or Roll20AM. All of those also use the on(ready) behavior to run their checkinstall function. EDIT: Specifically the outputConfig function in each of my scripts will use buttons asking for input, usually via a roll query.