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

[?] Any Scripts out there for getting URLs for images?

1485431932
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Any Scripts out there for getting URLs for images? With the changes to the image library that has gotten a little more difficult.  Been thinking about writting one but...... don't have any real ideas on what would be most useful yet. Could throw toggleable  "text" labels on the GM layer centered on the images: "A(map)", "B(object)", "C(GM)", "D(object)"...etc and then spam the URLs to chat with labels.... could even be color coded with boxbounding borders (with rotation arm) of the same color.
1485441884

Edited 1485442023
The Aaron
Pro
API Scripter
There's this snippet I wrote for a guy a while back... on('ready',function(){ &nbsp; &nbsp; 'use strict'; &nbsp; &nbsp; var getCleanImgsrc = function (imgsrc) { &nbsp; &nbsp; &nbsp; &nbsp;var parts = imgsrc.match(/(.*\/images\/.*)(thumb|med|original|max)(.*)$/); &nbsp; &nbsp; &nbsp; &nbsp;if(parts) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return parts[1]+'thumb'+parts[3]; &nbsp; &nbsp; &nbsp; &nbsp;} &nbsp; &nbsp; &nbsp; &nbsp;return; &nbsp; &nbsp; }; &nbsp; &nbsp; on('chat:message',function(msg){ &nbsp; &nbsp; &nbsp; &nbsp; if('api' === msg.type && msg.content.match(/^!user-image/) && playerIsGM(msg.playerid) ){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; let who=getObj('player',msg.playerid).get('_displayname'), &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; output = _.chain(msg.selected) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .map( s =&gt; getObj('graphic',s._id)) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .reject(_.isUndefined) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .map( o =&gt; o.get('imgsrc') ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .map( getCleanImgsrc ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .reject(_.isUndefined) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .map(u =&gt; `&lt;div&gt;&lt;img src="${u}" style="max-width: 3em;max-height: 3em;border:1px solid #333; background-color: #999; border-radius: .2em;"&gt;&lt;code&gt;${u}&lt;/code&gt;&lt;/div&gt;`) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .value() &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .join('') || `&lt;span style="color: #aa3333; font-weight:bold;"&gt;No selected tokens have images in a user library.&lt;/span&gt;` &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendChat('UserImage',`/w "${who}" &lt;div&gt;${output}&lt;/div&gt;`); &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; }); }); Select a bunch of things and run !user-image Original post:&nbsp;<a href="https://app.roll20.net/forum/permalink/4462334/" rel="nofollow">https://app.roll20.net/forum/permalink/4462334/</a>
1485442740
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
I feel like I wasted a "wish."
1485443218
The Aaron
Pro
API Scripter
HAHAHAAH, you just didn't spell it out well enough and I weaseled the weakest interpretation out in granting it. =D