<a href="https://wiki.roll20.net/API:Events" rel="nofollow">https://wiki.roll20.net/API:Events</a> says if you bind to add events (such as add:graphic ) before the ready event fires, you will receive add events for objects that were already present in the campaign. So my question is basically just to double-check my solution for binding after the ready event fires. My code used to have two ON events on("ready", function() { ... } and
on("chat:message", function(msg) { .... ) Now when I added an on("add:character", function( obj ) { ... } right out in the open with the other two, it would fire once for every character in the campaign before the ready event fired. So I am uncertain how to "bind after the ready event fires. Am I supposed to make the new on statement a part of the ready event? on("ready", function() {
...
on("add:character", function( obj ) { ... }
}
on("chat:message", function(msg) { .... ) It seems to work when I do it this way, it only fires when I add a brand new character. But is this a good idea? Is this how I am supposed to do it? It seems weird and dodgy to me. Thanks!