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]Share images in chat

1390137050

Edited 1390138979
DXWarlock
Sheet Author
API Scripter
Not sure if anyone would find it useful, but here is my script contribution: After linking images in chat for creatures they see, and players having to click and open a new tab and look then close the tab, or players just linking funny images relevant to what was going on ingame they found (animated gifs of random things seen as parallels of whats going on in game) and people having to do the same thing: click, newtab, close. I figured Id make a quick script to directly show the image in chat for everyone. all you have to do it do !pic [image address] to have it show up in chat. It works for all images. animated gifs, jpg, etc. For example you would type: !pic <a href="http://somesite.com/picture.jpg" rel="nofollow">http://somesite.com/picture.jpg</a> It works great for when I need to throw up an image of a creature they ran into, or see, much easier than changing an image on a handout and popping it up in front of the players, or giving external link to click. or players wanting to toss in an image for a laugh relevent to game, without making everyone pause to go look. here is an example screenshot of me tossing up a kobold image in chat <a href="http://i.imgur.com/FnrpAAI.jpg" rel="nofollow">http://i.imgur.com/FnrpAAI.jpg</a> code: on("chat:message", function (msg) { var cmdName = "!pic "; var msgTxt = msg.content; var msgWho = msg.who; var piclink = msgTxt.slice(cmdName.length); if (msg.type == "api" && msgTxt.indexOf(cmdName) !== -1) { log(piclink); sendChat(msgWho, '/direct &lt;b&gt;&lt;u&gt;shared:&lt;img src="' + piclink + '"&gt;'); }; });
Works perfectly. As base as it is, I'm using this for reaction face type .gifs. Thumbs up!
1393111795
Konrad J.
Pro
API Scripter
Great idea. I'm only using Roll20 for face to face, but this is a very goo use of the chat window and graphics!
I'd really like to use this, but I can't get it to work. I'm just starting to use macros, so maybe it's something I'm doing. I created a macro, named it pic, and pasted the code into the code window. Then, to activate it, I'm typing !pic <a href="http://i.imgur.com/FnrpAAI.jpg" rel="nofollow">http://i.imgur.com/FnrpAAI.jpg</a> Nothing is appearing in the chat window. Sorry, it's probably really simple!
1393187598

Edited 1393187644
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
You don't have access to API. See: support
Max P. said: I'd really like to use this, but I can't get it to work. I'm just starting to use macros, so maybe it's something I'm doing. I created a macro, named it pic, and pasted the code into the code window. Then, to activate it, I'm typing !pic <a href="http://i.imgur.com/FnrpAAI.jpg" rel="nofollow">http://i.imgur.com/FnrpAAI.jpg</a> Nothing is appearing in the chat window. Sorry, it's probably really simple! This is an API script, not a macro. You have to be a Mentor to use it and your GM has to put this script into their campaign's API section.