// Github: https://github.com/shdwjk/Roll20API/blob/master/Torch/Torch.js // By: The Aaron, Arcane Scriptomancer // Contact: https://app.roll20.net/users/104025/the-aaron const Torch = (() => { // eslint-disable-line no-unused-vars const version = '0.8.13'; const lastUpdate = 1565053382; const schemaVersion = 0.1; const flickerURL = 'https://s3.amazonaws.com/files.d20.io/images/4277467/iQYjFOsYC5JsuOPUCI9RGA/thumb.png?1401938659'; const flickerPeriod = 400; const flickerDeltaLocation = 2; const flickerDeltaRadius = 0.1; const flickerDeltaAngle = 5; const ch = (c) => { const entities = { '<' : 'lt', '>' : 'gt', "'" : '#39', '@' : '#64', '{' : '#123', '|' : '#124', '}' : '#125', '[' : '#91', ']' : '#93', '"' : 'quot', '*' : 'ast', '/' : 'sol', ' ' : 'nbsp' }; if( entities.hasOwnProperty(c) ){ return `&${entities[c]};`; } return ''; }; const showHelp = (who) => { sendChat('', '/w "'+who+'" '+ '
Torch provides commands for managing dynamic lighting. Supplying a first argument of help to any of the commands displays this help message, as will calling !torch or !snuff with nothing supplied or selected.
'+ 'Torch now supports Jack Taylor inspired flickering lights. Flicker lights are only active on pages where a player is (GMs, drag yourself to other pages if you don'+ch("'")+'t want to move the party.) and are persisted in the state. Flicker lights can be used in addition to regular lights as they are implemented on a separate invisible token that follows the nomal token.
'+ 'Sets the light for the selected/supplied tokens. Only GMs can supply token ids to adjust.
'+ 'Note: If you are using multiple '+ch('@')+ch('{')+'target'+ch('|')+'token_id'+ch('}')+' calls in a macro, and need to adjust light on fewer than the supplied number of arguments, simply select the same token several times. The duplicates will be removed.
'+ 'Turns off light for the selected/supplied tokens. Only GMs can supply token ids to adjust.
'+ 'Note: If you are using multiple '+ch('@')+ch('{')+'target'+ch('|')+'token_id'+ch('}')+' calls in a macro, and need to adjust light on fewer than the supplied number of arguments, simply select the same token several times. The duplicates will be removed.
'+ 'Behaves identically to !torch, save that it creates a flickering light.
'+ 'Behaves identically to !snuff, save that it affects the flickering light.
'+ 'Turns off dynamic lighting for the current player page, or the page of the selected/supplied token.
'+ 'Turns on dynamic lighting for the current player page, or the page of the selected/supplied token.
'+ 'Toggles Global Illumination for the current player page, or the page of the selected/supplied token.
'+ '