PsyOps

Sentinel.Main

Nov 20th, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. using System.Timers;
  7. using BattleCore;
  8. using BattleCore.Events;
  9. using BattleCore.PsyOps;
  10.  
  11. namespace Sentinel
  12. {
  13. // Add the attribute and the base class
  14. [Behavior("Main", "true", "0.01", "PsyOps", "Sentinel main module.")]
  15. public class Main: BotEventListener
  16. {
  17. public Main()
  18. {
  19.  
  20. }
  21.  
  22. // Is cgf loaded, and sentinel is rdy
  23. bool activated = false;
  24. // Custom chat module
  25. Chat msg = new Chat();
  26. // Main game timer
  27. Timer MainGameTimer = new Timer();
  28. Config Sent = new Config();
  29.  
  30. //-------------------------------------\\
  31. // Main Game Timer |
  32. //-------------------------------------//
  33. public void GameTimer(object source, ElapsedEventArgs e)
  34. {
  35. if (activated)
  36. {
  37. }
  38. }
  39.  
  40. //-------------------------------------\\
  41. // Game Events |
  42. //-------------------------------------//
  43. public void PlayerPositionUpdate(object sender, PlayerPositionEvent p)
  44. {
  45. if (activated)
  46. {
  47. }
  48. }
  49.  
  50. //-------------------------------------\\
  51. // BotID Info |
  52. //-------------------------------------//
  53. string botname,arena;
  54. bool identifyed = false;
  55. // Receive and store BotID info
  56. public void GetID(object sender, ChatEvent c)
  57. {
  58. if (c.Message.StartsWith("!returnID:"))
  59. {
  60. // Collect bot info
  61. string[] info = c.Message.Split(':');
  62. botname = info[1];
  63. arena = info[2];
  64. identifyed = true;
  65.  
  66. MainGameTimer.Elapsed += new ElapsedEventHandler(GameTimer);
  67. MainGameTimer.Interval = 75;
  68. MainGameTimer.Start();//and start it
  69.  
  70. //Sent.LoadCFG(botname);
  71.  
  72. Game(msg.arena("BotID confirmed. Main game timer started."));
  73. }
  74. }
  75. public override void Dispose()
  76. {
  77. throw new NotImplementedException();
  78. }
  79. }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment