Advertisement
Guest User

Untitled

a guest
Feb 15th, 2017
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.28 KB | None | 0 0
  1. Sanderling.Parse.IMemoryMeasurement Measurement => Sanderling?.MemoryMeasurementParsed?.Value;
  2.  
  3. var    chatLocal =
  4.      Sanderling.MemoryMeasurementParsed?.Value?.WindowChatChannel
  5.      ?.FirstOrDefault(windowChat => windowChat?.Caption?.RegexMatchSuccessIgnoreCase("local") ?? false);
  6.  
  7. bool hostileOrNeutralsInLocal => 1 != chatLocal?.ParticipantView?.Entry?.Count(IsNeutralOrEnemy);
  8.  
  9. bool IsNeutralOrEnemy(IChatParticipantEntry participantEntry) =>
  10.    !(participantEntry?.FlagIcon?.Any(flagIcon =>
  11.      new[] { "good standing", "excellent standing", "Pilot is in your (fleet|corporation)", }
  12.      .Any(goodStandingText =>
  13.         flagIcon?.HintText?.RegexMatchSuccessIgnoreCase(goodStandingText) ?? false)) ?? false);
  14.  
  15. while(true)
  16. {
  17. var    chatLocal =
  18.      Sanderling.MemoryMeasurementParsed?.Value?.WindowChatChannel
  19.      ?.FirstOrDefault(windowChat => windowChat?.Caption?.RegexMatchSuccessIgnoreCase("local") ?? false);
  20.  
  21.  
  22.  if(chatLocal?.ParticipantView?.Entry?.Count(IsNeutralOrEnemy) > 1)    
  23.  
  24.      {
  25. Host.Log(hostileOrNeutralsInLocal);
  26. Host.Log(chatLocal?.ParticipantView?.Entry?.Count(IsNeutralOrEnemy));
  27. System.Media.SoundPlayer simpleSound = new System.Media.SoundPlayer(@"C:\watchalm.wav");
  28.     simpleSound.Play();
  29.  }
  30.  
  31.  
  32. Host.Delay(4000);
  33.  
  34. Sanderling.InvalidateMeasurement();
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement