Here's a quick script that affects the Player ribbon page. Just threw this together with no error handling to speak of and barely tested, lol, so let me know if you run into issues. Syntax !daylight <#> //where # is between 0 and 1 Code: const Daylight = (() => {
const version = '0.1';
const scriptName = 'Daylight';
const checkInstall = () => {
log(`-=> ${scriptName} v${version}<=-`);
};
const handleInput = (msg) => {
if (msg.type === "api" && msg.content.toLowerCase().indexOf("!daylight") === 0 ) {
let args = msg.content.split(/\s+/);
if (args.length > 1){
let opacity = parseFloat(args[1]) || 0;
let page = getObj('page', Campaign().get('playerpageid'));
if (page) {
page.set({daylightModeOpacity: opacity, force_lighting_refresh: true});
}
}
}
};
const registerEventHandlers = () => {
on('chat:message', handleInput);
};
on('ready', () => {
checkInstall();
registerEventHandlers();
});
})(); Example macro: !daylight ?{What light level?|Pitch Black,0|Dim Moon,0.2|Bright Moon,0.35|Dawn/Dusk,0.55|Moderately Bright,0.7|Very Bright,1.0}