Hi, I am fairly new to the API for roll20 and have limited knowledge with javascript, but I'm well versed in other programming languages and I'm a fast learner. Hence, I figured I could create my own API script to add a feature I was missing for my macros. I need to be able to reuse the same roll within the same macro. - I'm running into some issues though ^^' As I see it, when you send a message to the chat via the API (sendChat) you lose the macro formatting. How do I keep that formatting? This is my script to roll any size dice and keep them temporarily: on("chat:message", function(msg) { if(msg.type !== "api") return; if(msg.content.indexOf("!keeproll ") !== -1) { var apicallmsg = msg.content.substring(msg.content.indexOf("!keeproll "), msg.content.indexOf("SR!") + 2); var dindex = apicallmsg.indexOf("d") var redicecount = apicallmsg.substring(10, dindex); //<redicecount>d<redicesize> var redicesize = apicallmsg.substring(dindex + 1, apicallmsg.length - 2); var remsg = msg.content.replace("!keeproll " + redicecount + "d" + redicesize + "SR!",""); var i; var reroll = 0; for (i = 0; i < redicecount; i++) { reroll += randomInteger(redicesize); //between [1,d] } while(remsg.indexOf("!getroll") !== -1) { remsg = remsg.replace("!getroll", reroll); } sendChat(msg.who, remsg); } }); This is my macro and the output in roll20 chat: PS: I am also using !TokenMod within the same type of macro. I left it out of the example above to simply things. Any help is greatly appreciated! Thanks!