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

Macros Countdown

Hello, I'm considering subscribing, I got a question I wanna make a Macro that runs and player has to type a random character interval (Y,Z,X,V,F) within 5 seconds (example: player gets "punched" and needs to type one of those in order to dodge) -Is that possible through API Macro? Sometimes the player might be hit by 2-3 enemies - can each have their own countdowns if each is a different macro? -And is that as well possible through API Macro? WHAT I MEAN AS EXAMPLE: Enemy#1: *Attempts to punch you in the face using his left jab, you have 5 seconds to press Y to Dodge* Countdown: 5 Countdown: 4 Enemy#2: *Attempts to kick your leg forcefully, using their left hand, you have 5 seconds to press X to Dodge* Countdown: 5 Countdown: 3 (from the other countdown) Player: Y Countdown: Successful! Countdown: 4 Player: X Countdown: Successful! Is this possible? And if yes, any guidance to do it? Thanks so much
1714314687
timmaugh
Forum Champion
API Scripter
Lots of things are possible with the API. =D Is something like this already built? No. However, I can mock something up using the Metascript Toolbox: !{{(^)   You have been attacked. Press D to Dodge. Press B to Bloviate.   ...5...{^&delay 1}   ...4...{^&delay 1}   ...3...{^&delay 1}   ...2...{^&delay 1}   ...1...{^&delay 1}   ...0{^&delay 1} }} You can see the result is that each output hits the chat at a bit of a delay. The recipient of the attack would have to place their command into chat prior to the countdown reaching 0. Two caveats to this approach: 1) the user input (of a response action) doesn't stop the countdown... you would just have to check if their response hit the chat before the final lines of the countdown reached it. 2) You'll always have (with this or a custom solution to your situation) a bit of gray in the mix... dealing with network speeds, lag, etc.
I tried this and it looks nice but it shows " player|API " as the user who says this and not my current "As:" name?
1714340906
timmaugh
Forum Champion
API Scripter
Ah... you need to configure SelectManager to give back a few things. Three properties are changed when a script sends a message instead of a player (in this case we're using ZeroFrame to send the message). The "selected" tokens, "who" sent the message, and the "playerid". SelectManager can give all of these back, if you have it configured. It comes pre-configured to give the selected tokens, so run this command to get the other 2 turned on, as well: !smconfig +who +playerid You only have to run that once, and it will stick around. Then run your command again.
Thanks so much!!