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

API to circumvent /as

As I've stated many times before, I think limiting /emas and /as to GM only is one of the worst ideas ever. Thanks to some help from some API guys I'm able to fake an /emas now, with the only problem being that the emote pops up at the end of the text. I figure if I can replicate the /as command and stick it under the /emas, it would pop the commands out in the right order. It would be a bit of work to add this to all of my power macros, but well worth it. Can anybody help write a simple script to create a bolded name defined by a command, followed by standard text?
Post the emas script you're using.
1424317187
The Aaron
Pro
API Scripter
You mean like this? <a href="https://github.com/shdwjk/Roll20API/blob/master/Em" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Em</a>... =D Expanded the Emas script to have a !as command.
Glorious.
1424318977

Edited 1424319350
I hate to ask for more when you've already done so much... but could you add an API-based whisper so that all the basic message types are available under the same API? Ack, and what about non-inline dice rolls?
1424320687
The Aaron
Pro
API Scripter
=D I give and give and give... <a href="https://github.com/shdwjk/Roll20API/blob/master/Em" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Em</a>... Added !w, !r, !gr
1424322695
Lithl
Pro
Sheet Author
API Scripter
Note: If you make a macro with several of these kinds of commands on separate lines, you are not guaranteed that they'll pop up in chat in the same order you wrote them for the macro. Most of the time it'll probably be right, but sometimes you'll see it pop up in the wrong order. Such is the pain of asynchronous programming.
1424323660
The Aaron
Pro
API Scripter
Right. Robert and I discussed this at length a few months ago. I believe mainly he's trying to avoid the situation where they are ALWAYS out of order due to the greater API round trip.
Thanks. Well I hope it works most of the time. this is the best solution I'll get short of changing the way roll20 works. i appreciate it.
1424351723
Gen Kitty
Forum Champion
I have what is probably a really dumb question. Why not tweak the script so you could have a !delay between the other lines? That would increase the chances of the lines appearing in the correct order, yeah?
1424352559
The Aaron
Pro
API Scripter
something like what you are saying could be done, but the real problem is not these commands, but other commands that are taking longer, like say powercards, which are interspersed within /emas and whisper. Thinks could be delayed around them, of course, but it would be a tedious process.
1424353512

Edited 1424353566
Okay, okay. I would ask for /desc because it would be helpful to have a third color for descriptive effects. But this script already puts everything out in grey. Could you add one that outputs text with no defined speaker? Basically just emas in a different color?
1424357779
The Aaron
Pro
API Scripter
Updated to add !desc <a href="https://github.com/shdwjk/Roll20API/blob/master/Em" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/Em</a>... That's actually easier than adding color to the emotes (currently, this is a simple pass thru script, adding color would mean delving into making the HTML for the message, etc. ). If that doesn't work for you, I can add more output flexibility instead.
This should be fine for now. I'll let you know. Thanks again.
1424360040
The Aaron
Pro
API Scripter
yup!
It seems that !w outputs two whisper messages when used.
Also, am I not allowed to use inline rolls in text generated this way?
1424372669
The Aaron
Pro
API Scripter
Whispers: it whispers once to the target and once to the person speaking. otherwise, it would seem like it didn't do anything because only the target would see the text. Inline Rolls: I can add that, but it might have to wait until later tonight...
1424373016

Edited 1424374672
I'd appreciate it. Should keep changing the basic macros under the assumption that they will pretty much work as before with the new script?
1424374034
The Aaron
Pro
API Scripter
Certainly the syntax will be the same.
Do you think you'll be able to do it sometime today? All the actions in my campaign are backward until it's fixed.
1424557485
The Aaron
Pro
API Scripter
Done: <a href="https://github.com/shdwjk/Roll20API/blob/prod/Emas" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/prod/Emas</a>... Sorry for the delay!
Thanks a bunch. You've mentioned before that certain API is prone to tracking too many objects at a time and can cause lag and crashing. Is that a likelihood or possibility with this script? Because pretty much each of 300+ objects in my campaign will be referencing this script at least 10 times.
1424568253
The Aaron
Pro
API Scripter
No. The issues I was talking about were more along the lines of someone doing a findObjs(blah), multiple times. This script is pretty much as light as you can imagine. It really is just an API based passthrough for the real commands.
Now that 3d dice are improved, I'm using them again. However, I've discovered 3 major problems with the way it interacts with this script. the !r function doesn't display 3d dice. I'd love to see them, but I can't. Whispered inline rolls are still displayed for everyone to see. I know that this is a problem with roll20 and not the API, but maybe there is an API solution. This is independent from the update, but I discovered it recently: When you put an inline roll in the !w function, it makes 2 different rolls: one for the user and one for the GM. And as I said before, one of them is even displayed on the table for everyone to see. In short, the visual display I was hoping for is pretty much backward if I want to use 3d dice. Are there any tweaks you could make to fix any of these?
1426359247
The Aaron
Pro
API Scripter
Yeah, this was always something of a hack. I can likely fix 3), but can't really do anything about the display of 3d dice.