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

[Script] Dealer -- Gives error message when I'm calling the !Deal-Init script

In my Savage Titanfall game, I use the Dealer script to deal out bennies (akin to D&D Inspiration) and Adventure Deck cards.  But I also just started using the DealInit script, which is special script for Savage Worlds games. It deals "custom item" (cards) to the Turn Tracker (Savage Worlds uses playing cards for initiative). Any time I call the DealInit script, the Dealer script thinks I'm talking to it.  For instance, giving the following DealInit chat command: !deal-init --deal2chat Causes the [Dealer] script to complain: Every !deal-init command causes this error from Dealer. Doesn't break game play, just makes the chat column "noisy".
1632793370

Edited 1632793381
The Aaron
Roll20 Production Team
API Scripter
I sent a correction to Keith for this.  If you want to implement it locally until it gets into the 1-click, you can replace line 10 with this: if ('api' === msg.type && /!deal (\b\s|$) /i.test(msg.content) && msg.selected) { (I bolded the actual change.) Just a side note: by convention, we put [Script] in the titles of posts that are providing a script.  =D
1632806312
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks! I put in the fix and gave it a test. I don't know if I got it in under the wire for tomorrow's pull, but hopefully.
Thanks, Aaron -- both for the code, and the post naming convention. Since Roll20 locks threads after a certain date, and there were no active threads for Dealer, I thought that's how I went about specifying which script I was opening an issue on. I'm edumacated now, thank you!