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

3d dice via API with send chat.

is there any way I can have a 3d dice with a sendchat function with a callback parameter? Example: on("chat:message", function(msg) { .       if (msg.content == "!bow"){          sendChat(msg.who,"/r 1d20",function(ops){                        //if is a critical hit roll double damage, if not roll normal damage                })     }   });
1543805498
The Aaron
Pro
API Scripter
Nope. If you want 3D dice from the API, your messsge must go to chat.  However, you should be able to fake it by having the chat output an API command which you then respond to. You’d need to store anything you need to deal with from the issuing code so you can pick it up again in the next command. You can do that by creating a unique id and using it as both the index of a an object, and an argument to the command. Look at the push functionality in my Mutant Year Zero script for an example.