Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- waituntil {alive player};
- GAIA_CACHE_STAGE_1 = 1200;
- publicvariable "GAIA_CACHE_STAGE_1";
- if (isNil "tort_debug") then {tort_debug = false};
- if (!isNil "GAIA_dynamicCache") then {
- if (!scriptDone GAIA_dynamicCache) then {
- terminate GAIA_dynamicCache;
- waitUntil {scriptDone GAIA_dynamicCache};
- };
- };
- _scriptname = "GAIA_dynamicCache";
- if (tolower(str(_this#0)) find "false" >= 0) exitWith {tort_tasks = tort_tasks - [_scriptname]; systemchat "GAIA_dynamicCache script terminated."};
- if (isnil "tort_tasks") then {tort_tasks = [_scriptname]} else {if !(_scriptname in tort_tasks) then {tort_tasks pushback _scriptname}};
- GAIA_dynamicCache = _this spawn
- {
- sleep (30 + random 10);
- private _optimalFPS = param [0, 50];
- private _seconds = param [1, 30]; _seconds = 5 max (_seconds - random(_seconds*0.1) + random(_seconds*0.1));
- private _GAIAmin = 500;
- private _GAIAmax = 2000;
- private _actionCounter = 0;
- private _subseqActions = 4;
- private _sleep = _seconds;
- while {alive player} do
- {
- _fps = 0; for "_i" from 1 to 10 do {_fps = _fps + diag_fps; sleep 0.5}; _fps = 0.1*_fps;
- if ((_fps < (0.75 * _optimalFPS)) && (_actionCounter < _subseqActions)) then
- {
- GAIA_CACHE_STAGE_1 = _GAIAmin max (GAIA_CACHE_STAGE_1 - 100);
- _sleep = 0.8 * _seconds;
- _actionCounter = _actionCounter + 1;
- };
- if ((_fps > _optimalFPS) && (_actionCounter < _subseqActions)) then
- {
- GAIA_CACHE_STAGE_1 = _GAIAmax min (GAIA_CACHE_STAGE_1 + 100);
- _sleep = 1.3 * _seconds;
- _actionCounter = _actionCounter + 1;
- };
- if (_actionCounter >= _subseqActions) then {_sleep = _seconds; _actionCounter = 0};
- systemchat format ["_fps:%1, _sleep:%2, CACHE:%3, _atn:%4",_fps,_sleep,GAIA_CACHE_STAGE_1,_actionCounter];
- sleep (_sleep - 5);
- };
- };
- tort_tasks = tort_tasks - [_scriptname];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement