generated from Jaysyn/ModuleTemplate
Initial commit
Initial commit
This commit is contained in:
70
_module/nss/wrap_mod_onload.nss
Normal file
70
_module/nss/wrap_mod_onload.nss
Normal file
@@ -0,0 +1,70 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Wrapper
|
||||
// wrap_mod_onload
|
||||
// by Don Anderson
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "x2_inc_switches"
|
||||
|
||||
float fMsgTimer = 45.0;
|
||||
|
||||
//Restart Module Msg
|
||||
void DoModuleMsg();
|
||||
|
||||
// Restart Module
|
||||
void RestartModule();
|
||||
|
||||
void main()
|
||||
{
|
||||
//: NOTE...KEEP THIS SCRIPT IN 1ST PLACE!!
|
||||
ExecuteScript("opw_mod_onload",OBJECT_SELF); // Olander's Realistic Systems - Master Configurations Script
|
||||
ExecuteScript("x2_mod_def_load",OBJECT_SELF); // Default Bioware
|
||||
//ExecuteScript("farm_mod_load",OBJECT_SELF); // Farming System
|
||||
//ExecuteScript("doa_mod_load",OBJECT_SELF); // DOA Gold Encumberance
|
||||
|
||||
|
||||
|
||||
|
||||
ExecuteScript("savechars", OBJECT_SELF);
|
||||
ExecuteScript("prc_onmodload", OBJECT_SELF);
|
||||
DelayCommand(86400.0, RestartModule());// 24 hrs
|
||||
|
||||
|
||||
|
||||
}
|
||||
void DoModuleMsg()
|
||||
{
|
||||
//Count down msg timer...
|
||||
fMsgTimer -= 1.0f;
|
||||
|
||||
object oPC = GetFirstPC();
|
||||
while (GetIsObjectValid(oPC))
|
||||
{
|
||||
SendMessageToPC(oPC, "Reset in "+FloatToString(fMsgTimer, 0, 0)+" secs.");
|
||||
oPC = GetNextPC();
|
||||
}
|
||||
|
||||
if(fMsgTimer != 0.0)
|
||||
{
|
||||
DelayCommand(1.0, DoModuleMsg());
|
||||
}
|
||||
else
|
||||
{
|
||||
ExportAllCharacters();
|
||||
oPC = GetFirstPC();
|
||||
while (GetIsObjectValid(oPC))
|
||||
{
|
||||
BootPC(oPC);
|
||||
oPC = GetNextPC();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RestartModule()
|
||||
{
|
||||
DoModuleMsg();
|
||||
DelayCommand(fMsgTimer + 4.0, SetLocalString(GetModule(),"NWNX!RESETPLUGIN!SHUTDOWN","1"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user