I have an issue! I use for my shard ore vein regeneration system from Austin Heilman.
I don't understand some things. Wish you can help me.
In my settings.cfg
Code: Select all
Elem Settings
{
// Minutes the ore vein regeneration waits between cycles.
RegenWait 10
}
Code: Select all
/*
* $Id: regenOre.src 563 2006-07-04 13:20:27Z austinheilman $
*
*/
use uo;
use os;
use polsys;
use util;
include ":datafile:inc_public/datafile";
include ":mining:inc_public/settings";
include ":mining:inc_public/report";
program GlobalControl()
MSP_ReportText("---=[ GLOBAL ORE REGENERATOR HAS STARTED UP ]=---", MSP_REPORT_SYSLOG);
var settings := MSP_GetSettingsCfgElem("Settings");
var cycle_wait := CInt(settings.RegenWait);
if ( cycle_wait < 1 )
cycle_wait := 3;
endif
cycle_wait *= 60;
// 1 = 1 min 20 sec
// 2 = 1 min 20 sec
// 3 = 1 min 26 sec
// 5 = 1 min 28 sec
// 10 = 1 min 34 sec
//cycle_wait := 3;
SetGlobalProperty("#GlobalOreRegenPId", GetPid());
Set_Priority(1);
while( 1 )
foreach realm_name in ( Realms().Keys() )
RegenVeins(realm_name);
endforeach
syslog(" GlobalControl() | cycle_wait : " + cycle_wait + " | Time: " + StrFormatTime("%Y-%m-%d %H:%M:%S") ); // DEBUG
Sleep( cycle_wait );
endwhile
endprogram
function RegenVeins( realm_name )
MSP_ReportText("Running global ore regeneration cycle for realm '"+realm_name+"'...", MSP_REPORT_SYSLOG);
var data_file := DFOpenDataFile(realm_name+"-OreSpots", DF_CREATE);
foreach elem_name in DFGetElemNames(data_file)
var data_elem := DFFIndElement(data_file, elem_name);
var amount := CInt(data_elem.GetProp("RemainingOre"));
if( amount < 30 )
//amount += 1;
amount += 5;
print(" regenOre.src | RegenVeins() | amount : " + amount ); // DEBUG
data_elem.SetProp("RemainingOre", amount);
else
data_elem.SetProp("RemainingOre", 30 );
endif
Sleep(1);
endforeach
return 1;
endfunction
Code: Select all
var script := Start_Script("oreGlobal/regenOre");
if ( script.errortext )
SysLog("Error starting global ore vein regen ->"+script.errortext);
else
//Print("Starting global ore regeneration controller... OK.");
SysLog("Starting global ore regeneration controller... OK.");
endif
set_critical(0);
// 1 = 1 min 20 sec
// 2 = 1 min 20 sec
// 3 = 1 min 26 sec
// 5 = 1 min 28 sec
// 10 = 1 min 34 sec
And I don't understand why it's so?!
I set up 1, 2, 3, 5 & 10 seconds, but sleep were more then 80 seconds!!!!
How can I fix it to make true values and seconds?
With best regards!