Author Topic: Help with time script?  (Read 310 times)

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Help with time script?
« on: December 18, 2010, 10:22:07 pm »


               I am using genysis timie_keeper script .

Problem ::: I set it to reload module not restart server ...it counts time perfectly (example  1hour 20 min until reset)until first module reload .Then says (0 hours  -500min until restart) and the -min keeps growing and module will not reload .

I am a newb so if you are familar with his system please tell me what I'm doing wrong .

Thanks
               
               

               
            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Help with time script?
« Reply #1 on: December 19, 2010, 04:41:58 am »


               ware is link to genysis timie_keeper script, there must be something that say what the two are reload mod vrs reset.  First time I heard of genysis timie_keeper script. sounds like it could work great.
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Help with time script?
« Reply #2 on: December 19, 2010, 02:51:48 pm »


               Yes it looks awesome and other people use it but Im having trouble.

http://www.mediafire...zd6z8x76vbd287b
               
               

               


                     Modifié par Knight_Shield, 19 décembre 2010 - 02:52 .
                     
                  


            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
Help with time script?
« Reply #3 on: December 19, 2010, 04:17:45 pm »


               Wonder why he is not using the vault again. Many people will not visit mediafire because of the methods used in their coded pages.



Good luck with that script set though.



               
               

               
            

Legacy_Birdman076

  • Sr. Member
  • ****
  • Posts: 320
  • Karma: +0/-0
Help with time script?
« Reply #4 on: December 19, 2010, 04:55:19 pm »


               This is what I use, of course I am using the NWNX2 shutdown plugin but it does either way. It restarts about every 24hrs as configured.



////////////////////////////////////////////////////////////////////////////////
//::
//:: This script will shutdown or restart your module using either NWNX2 or
//:: not. At the very bottom of the script there are two lines which depending
//:: on whether you use the NWNX2 restart plugin or not will determine your
//:: selection of code. Comment out "SetLocalString(GetModule(),"NWNX!RESETPLUGIN!SHUTDOWN","1");"
//:: if you DO NOT use the NWNX2 restart plugin.
//::
//:: This script also accounts for horses being used hence the execute "x3_mod_def_hb"
//::
////////////////////////////////////////////////////////////////////////////////
void main()
{
int iHour = GetTimeHour ();
int iMinute = GetTimeMinute ();
int iSecond = GetTimeSecond ();
int iMillisecond = GetTimeMillisecond();
SetTime(iHour, iMinute, iSecond, iMillisecond);
ExecuteScript("x3_mod_def_hb", OBJECT_SELF);
 int timekeeper = GetLocalInt(GetModule(), "loadtimer");
        SetLocalInt(GetModule(), "loadtimer", (timekeeper+1)) ;
 if (timekeeper == 9000){
              object oWarn = GetFirstPC();
              while ((oWarn != OBJECT_INVALID))
        {
          SendMessageToPC(oWarn, "Auto Restart Sequence Will Begin In One Hour!!!");
            oWarn = GetNextPC();
        }
         }

 if (timekeeper == 9300){
              object oWarn = GetFirstPC();
              while ((oWarn != OBJECT_INVALID))
        {
          SendMessageToPC(oWarn, "Auto Restart Sequence Will Begin In Thirty Minutes!!!");
            oWarn = GetNextPC();
        }
         }

 if (timekeeper == 9450){
              object oWarn = GetFirstPC();
              while ((oWarn != OBJECT_INVALID))
        {
          SendMessageToPC(oWarn, "Auto Restart Sequence Will Begin In FIFTEEN Minutes!!!");
            oWarn = GetNextPC();
        }
         }
 if (timekeeper == 9550){
              object oWarn = GetFirstPC();
              while ((oWarn != OBJECT_INVALID))
        {
          SendMessageToPC(oWarn, "Auto Restart Sequence Will Begin In FIVE Minutes!!!");
            oWarn = GetNextPC();
        }
         }
                       if (timekeeper == 9598){
              object oWarn = GetFirstPC();
              while ((oWarn != OBJECT_INVALID))
        {
          location lVis = GetLocation(oWarn);
          SendMessageToPC(oWarn, "Auto Reload Sequence Active: Server will restart in two minutes.");
          SendMessageToPC(oWarn, "You WILL have to reconnect.");
          SendMessageToPC(oWarn, "Saving all characters.");
          ExportAllCharacters();
          ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_TIME_STOP), lVis, 5.0);
          ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), lVis, 20.0);
            oWarn = GetNextPC();
        }
         }
 
            if (timekeeper == 9599){
              object oWarn = GetFirstPC();
              while ((oWarn != OBJECT_INVALID))
        {
          location lVis = GetLocation(oWarn);
          SendMessageToPC(oWarn, "Auto Restart Sequence Active, you will have to reconnect.");
          ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_METEOR_SWARM), lVis, 5.0);
            oWarn = GetNextPC();
        }
         }
 
            if (timekeeper == 9600){
              object oWarn = GetFirstPC();
              while ((oWarn != OBJECT_INVALID))
        {
          location lVis = GetLocation(oWarn);
          SendMessageToPC(oWarn, "Auto Restart Sequence Active, you will have to reconnect.");
          ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_METEOR_SWARM), lVis, 5.0);
            oWarn = GetNextPC();
        }
         }
              if (timekeeper == 9601){
              object oWarn = GetFirstPC();
              while ((oWarn != OBJECT_INVALID))
        {
          location lVis = GetLocation(oWarn);
          SendMessageToPC(oWarn, "Auto Restart Sequence Active, you will have to reconnect.");
          ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_METEOR_SWARM), lVis, 5.0);
            oWarn = GetNextPC();
        }
       }
         if (timekeeper >= 9602){
        SetLocalInt(GetModule(), "loadtimer", 0) ;
        //DelayCommand( 20.0, StartNewModule( GetModuleName() ) ); // <---- use this for module reload
      SetLocalString(GetModule(),"NWNX!RESETPLUGIN!SHUTDOWN","1"); // <---- use this if using the NWNx restart plugin
        }
}

               
               

               


                     Modifié par Birdman076, 19 décembre 2010 - 04:55 .
                     
                  


            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Help with time script?
« Reply #5 on: December 19, 2010, 11:58:34 pm »


               Ok looks good Birdman076  2 questions ?

Where do I put this ..on an object and if so do I have to give it a Tag?

Do I put my module name in it here ?

//DelayCommand( 20.0, StartNewModule( GetModuleName(my_mod_here) ) );
               
               

               
            

Legacy_Birdman076

  • Sr. Member
  • ****
  • Posts: 320
  • Karma: +0/-0
Help with time script?
« Reply #6 on: December 20, 2010, 12:24:56 am »


               Knight,



You don't have to add your module name anywhere as that line will restart the currently running module. As far as where to place it, it would need to go in the module heartbeat event.
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Help with time script?
« Reply #7 on: December 20, 2010, 01:10:44 pm »


               Thanks for your help Birdman076 .