Here is a very simplistic script that will ping pull the controlling players to the selected tokens. Will pull anyone who can control a token or character a token represents. It will ping for every selected token, so if you're on several, your screen might jump around. Only the controlling players see the ping happen. If all is in the control list, everyone is pinged: !pull-players Code: on('ready',()=>{
const getControllingPlayers = (token) => {
let players = token.get('controlledby')
.split(/,/)
.filter(s=>s.length);
if('' !== token.get('represents') ) {
players = [...new Set([...players,
... (getObj('character',token.get('represents')) || {get: function(){return '';} } )
.get('controlledby').split(/,/)
.filter(s=>s.length)
])];
}
return players;
};
const sendPingControllingPlayers = (token) => {
let players = getControllingPlayers(token);
let left = token.get('left');
let top = token.get('top');
let pageid = token.get('pageid');
if(players.includes('all')){
sendPing(left,top,pageid,null,true);
} else if(players.length){
sendPing(left,top,pageid,null,true,players);
}
};
on('chat:message', (msg)=>{
if('api'===msg.type && /^!pull-players\b/.test(msg.content) && playerIsGM(msg.playerid)){
(msg.selected||[])
.map(o=>getObj('graphic',o._id))
.filter(g=>undefined !== g)
.forEach( t=> sendPingControllingPlayers(t))
;
}
});
});