public void CallInvokes()
 {
     if (Script != null)
     {
         for (int i = Script.Invokes.Count - 1; i >= 0; i--)
         {
             if (Script.Invokes[i].Time < DateTime.UtcNow)
             {
                 if (Script.Invokes[i].Called)
                 {
                     Script.Invokes.RemoveAt(i);
                     RelogCalling?.Invoke(false);
                 }
                 else
                 {
                     Script.Invokes[i].Call();
                     RelogCalling?.Invoke(true);
                 }
             }
         }
         if (CallingPaueScript)
         {
             if (scriptPauserTime < DateTime.UtcNow)
             {
                 if (Running == State.Paused)
                 {
                     Pause();
                 }
             }
         }
     }
 }
Exemple #2
0
 public void CallInvokes()
 {
     if (Script != null)
     {
         for (int i = Script.Invokes.Count - 1; i >= 0; i--)
         {
             if (Script.Invokes[i].Time < DateTime.UtcNow)
             {
                 if (Script.Invokes[i].Called)
                 {
                     Script.Invokes.RemoveAt(i);
                     RelogCalling?.Invoke(false);
                 }
                 else
                 {
                     Script.Invokes[i].Call();
                     RelogCalling?.Invoke(true);
                 }
             }
         }
         if (CallingPaueScript)
         {
             if (scriptPauserTime < DateTime.UtcNow)
             {
                 if (Running == State.Paused)
                 {
                     Pause();
                 }
             }
         }
         if (AfterMessageProcess < DateTime.UtcNow && messageProcess && BeAwareOfStaff)
         {
             if (Game != null)
             {
                 Game.UseItem(Game.Items.Find(i => i.Name.Contains("Escape Rope")).Id);
                 Logout(false);
             }
             messageProcess = false;
         }
     }
 }