Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //========================================
- // Weather Auto Change By Greger (Veteran)
- //========================================
- // You can:
- // Use and modify this script
- // Make money with it
- // Lie to people that you made this script
- // Anything else you want
- //========================================
- //CONFIGURATION VARIABLES
- CFG_minOvercast = 0; //MINIMUM OVERCAST (0-1)
- CFG_maxOvercast = 1; //MAXIMUM OVERCAST THAT WILL BE REACHED (0-1)
- CFG_chanceToChangeWeather = 0.5; //DEFAULT IS 0.5 (50%)
- CFG_waitIfNotChange = 600; //IN SECONDS
- CFG_weatherDegug = true; //SHOW FULL CHANGE TIME PREDICTION
- //INIT
- private _oStart = CFG_minOvercast+random (CFG_maxOvercast-CFG_minOvercast);
- 0 setOvercast _oStart;
- forceWeatherChange;
- //DEBUG CODE
- if (CFG_weatherDegug) then {
- _oStart spawn {
- private _last = _this;
- waitUntil {
- uiSleep 5;
- private _now = overcast;
- private _delta = _now-_last;
- if (_delta isNotEqualTo 0) then {
- private _minutesLeft = (5*(overcastForecast-overcast)/_delta)/60;
- systemChat format ["Overcast (%1%3 now) will reach %2%3 in %4 minutes and %5 seconds.",round (overcast*100),round (overcastForecast*100),"%",floor _minutesLeft,round ((_minutesLeft-floor _minutesLeft)*60)];
- };
- _last = _now;
- false
- };
- };
- };
- //WEATHER CHANGE CODE
- waitUntil {
- if (abs(overcast-overcastForecast) < 0.01) then {
- if (random 1 < CFG_chanceToChangeWeather) then {
- 0 setOvercast CFG_minOvercast+random (CFG_maxOvercast-CFG_minOvercast);
- } else {
- uiSleep CFG_waitIfNotChange;
- };
- } else {
- uiSleep 30;
- };
- false
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement