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

Output to Chat Windows?

1367716199
Konrad J.
Pro
API Scripter
OK, this is going to be extremely obvious for most, but I'm new to Javascript and the API!  I've looked at all the examples and I can't seem to find an example that outputs something to the chat window.  There is an example of doing that after the user types !something into the chat window with sendchat. All I want to do for testing purposes is when an object is moved its left, top, and rotation are output to the chat window so I can see the values so I can know what to expect. Thanks, Konrad
You should use the log() command for this. See here:&nbsp; <a href="https://wiki.roll20.net/API:Debugging" rel="nofollow">https://wiki.roll20.net/API:Debugging</a> The results will output to your API Console. You definitely shouldn't use sendChat() for this since all chat messages are stored long-term, and that would make your campaign very, very large very, very quickly :-). The log() command is designed to be used for frequent messages that you only want to see once then don't care about.
1367723896
Konrad J.
Pro
API Scripter
Thanks, figured that out. &nbsp;The problem is you need to have to windows open and go back and forth to see the log window. &nbsp;Not a big deal. This would just be for testing though so it wouldn't be during a game session, there wouldn't be a lot of stuff to the chat, but I'm using log now. Still would be nice to know how to send to the chat window.
Just use sendChat().&nbsp; <a href="https://wiki.roll20.net/API:Chat" rel="nofollow">https://wiki.roll20.net/API:Chat</a> You can call it anywhere you want. It doesn't have to be called in an event callback.
1367724090
Konrad J.
Pro
API Scripter
Riley D. said: Just use sendChat().&nbsp; <a href="https://wiki.roll20.net/API:Chat" rel="nofollow">https://wiki.roll20.net/API:Chat</a> You can call it anywhere you want. It doesn't have to be called in an event callback. OK, I'll try it again, but I was getting errors. &nbsp;I must have missed a { or a ( somewhere! :) &nbsp;But log is working perfectly thanks!