//set time arrays: cycle = [begin, end] (measured in-between, so like 6, 6 would mean the hour of 6)
_morning = [0, 4];
_dawn = [5, 5];
_day = [6, 18];
_dusk = [19, 19];
_night = [20, 23];
//Create the color correction effect and enable it
_hndl = ppEffectCreate ["colorCorrections", 1501];
_hndl ppEffectEnable true;
//while loop, goes on forever
while {true} do {
//get the hour in the server
_hour = date select 3;
//check against table, rest should be self-explanatory
if (_hour >= (_morning select 0) && _hour <= (_morning select 1)) then {
//Clear contrast
_hndl ppEffectAdjust [ 1, 1, 0, [0, 0, 0, -0.31],[1.9, 1.9, 1.73, 0.7],[0.2, 1.1, -1.5, 1.64]];
_hndl ppEffectCommit 0;
};
if (_hour >= (_dawn select 0) && _hour <= (_dawn select 1)) then {
//Sandy
_hndl ppEffectAdjust [ 1, 1, 0, [1.01, -2.46, -1.23, 0],[2.11, 1.6, 0.71, 0.8],[1.43, 0.56, 3.69, 0.31]];
_hndl ppEffectCommit 0;
};
if (_hour >= (_day select 0) && _hour <= (_day select 1)) then {
//Wasteland
_hndl ppEffectAdjust [1, 1, 0, [0.0, 0.0, 0.0, 0.0], [0.8*2, 0.5*2, 0.0, 0.7], [0.9, 0.9, 0.9, 0.0]];
_hndl ppEffectCommit 0;
};
if (_hour >= (_dusk select 0) && _hour <= (_dusk select 1)) then {
//Heavy Colour Correction
_hndl ppEffectAdjust [1, 1.04, -0.004, [0.0, 0.0, 0.0, 0.0], [1, 0.8, 0.6, 0.5], [0.199, 0.587, 0.114, 0.0]];
_hndl ppEffectCommit 0;
};
if (_hour >= (_night select 0) && _hour <= (_night select 1)) then{
//Operation Flashpoint
_hndl ppEffectAdjust [1,1,0,[0,0,0,0],[1,1,1.2,0.85],[1,1,-2.5,0]];
_hndl ppEffectCommit 0;
};
//make sure the script checks every 5 minutes, could be increased (in second interval)
sleep 300;
};