ModuleMount.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using CommonLang.Reflection;
  2. using pomelo.connector;
  3. namespace ZeusBotTest.Runner
  4. {
  5. public class ModuleMount : BotRunner.RunnerModule
  6. {
  7. public ModuleMount(BotRunner r) : base(r)
  8. {
  9. }
  10. protected internal override void OnGateBindPlayer(BindPlayerResponse e)
  11. {
  12. base.OnGateBindPlayer(e);
  13. runner.do_gm_open_func();
  14. }
  15. protected internal override void OnBattleActorReady(CommonAI.ZoneClient.ZoneLayer layer, CommonAI.ZoneClient.ZoneActor actor)
  16. {
  17. layer.AddTimeDelayMS(Config.CheckIntervalMS, (t) =>
  18. {
  19. if (Enable)
  20. {
  21. try_ride_mount();
  22. }
  23. });
  24. layer.AddTimePeriodicMS(Config.CheckIntervalMS, (t) =>
  25. {
  26. if (Enable)
  27. {
  28. try_get_mount_info();
  29. }
  30. });
  31. }
  32. private void try_get_mount_info()
  33. {
  34. log.Log("try_get_mount_info2 : ");
  35. client.GameSocket.mountHandler.getMountInfoRequest(
  36. (err, rsp) =>
  37. {
  38. log.Log("try_get_mount_info : " + rsp);
  39. });
  40. }
  41. private void try_ride_mount()
  42. {
  43. log.Log("try_ride_mount : ");
  44. client.GameSocket.mountHandler.ridingMountRequest(1,
  45. (err, rsp) =>
  46. {
  47. });
  48. }
  49. [Desc("坐骑配置")]
  50. [Expandable]
  51. public class Config
  52. {
  53. [Desc("坐骑检测间隔")]
  54. public static int CheckIntervalMS = 5000;
  55. public override string ToString()
  56. {
  57. return "坐骑配置";
  58. }
  59. }
  60. }
  61. }