Skip to content

Instantly share code, notes, and snippets.

View TS000's full-sized avatar

TylerS TS000

View GitHub Profile
@nolivo
nolivo / mapSizer.js
Last active May 31, 2022 19:04
mapSizer.js A script that resizes an image and page to specific dimensions, centers the image on the page and puts it on the map layer.
//usage - !mapSizer imageWidthInPixels imageHeightInPixels
on("ready",function(){
on("chat:message",function(msg){
if(msg.type=="api" && msg.content.indexOf("!mapSizer")==0){
var args = msg.content.split(" ");
var mapWidth = Number(args[1]);
var mapHeight = Number(args[2]);
var selected = msg.selected;
if(selected===undefined){
sendChat("API","Please select a graphic");