DemonTowerFunc.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using pomelo.connector;
  7. using CommonLang.Property;
  8. using pomelo.area;
  9. namespace XmdsBotTest.Runner
  10. {
  11. public class DemonTowerFunc : BotRunner.RunnerModule
  12. {
  13. public DemonTowerFunc() {
  14. module_name = "镇妖塔";
  15. }
  16. public DemonTowerFunc(BotRunner r) : base(r)
  17. {
  18. }
  19. protected internal override void OnGateBindPlayer(BindPlayerResponse e)
  20. {
  21. base.OnGateBindPlayer(e);
  22. }
  23. protected internal override void OnBattleActorReady(CommonAI.ZoneClient.ZoneLayer layer, CommonAI.ZoneClient.ZoneActor actor)
  24. {
  25. layer.AddTimePeriodicMS(Config.CheckIntervalMS, (t) =>
  26. {
  27. autoJoinTeam();
  28. });
  29. }
  30. public override void autoJoinTeamRequest()
  31. {
  32. client.GameSocket.teamHandler.autoJoinTeamRequest(1020, 1,
  33. (err, rsp) =>
  34. { });
  35. }
  36. protected override int rand()
  37. {
  38. return Config.RandNum;
  39. }
  40. [Desc("镇妖塔配置")]
  41. [Expandable]
  42. public class Config : ConfigBase
  43. {
  44. [Desc("镇妖塔检测间隔")]
  45. public static int CheckIntervalMS = 5000;
  46. [Desc("镇妖塔随机数")]
  47. public static int RandNum = 12;
  48. public override string ToString()
  49. {
  50. return "镇妖塔配置";
  51. }
  52. public override void popG2DPropertyDialog()
  53. {
  54. CommonFroms.G2D.G2DPropertyDialog<DemonTowerFunc.Config>.Show("修改配置", this);
  55. }
  56. }
  57. }
  58. }