using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using pomelo.connector; using CommonLang.Property; using pomelo.area; namespace XmdsBotTest.Runner { public class BuyIntergalItemProto : BotRunner.RunnerModule { public BuyIntergalItemProto() { module_name = "积分商店"; } public BuyIntergalItemProto(BotRunner r) : base(r) { } protected internal override void OnGateBindPlayer(BindPlayerResponse e) { base.OnGateBindPlayer(e); } protected internal override void OnBattleActorReady(CommonAI.ZoneClient.ZoneLayer layer, CommonAI.ZoneClient.ZoneActor actor) { layer.AddTimeDelayMS(Config.CheckIntervalMS, (t) => { if (Enable) { } }); layer.AddTimePeriodicMS(Config.CheckIntervalMS, (t) => { if (Enable) { buyIntergalItemRequest(); } }); } private void buyIntergalItemRequest() { client.GameSocket.intergalMallHandler.buyIntergalItemRequest(Config.shopType, Config.itemId,Config.buyCount, (err, rsp) => { if(err != null && !err.Equals("")) Console.WriteLine("buyIntergalItemRequest:", err); }); } [Desc("积分商店配置")] [Expandable] public class Config : ConfigBase { [Desc("积分商店检测间隔")] public static int CheckIntervalMS = 5000; [Desc("积分商店购买数量")] public static int shopType = 1; // 商店类型 1:杂货商店 2:积分商店 3:仙缘商店 4:竞技商店 5:仙盟商店 public static int itemId = 1; // 购买的物品id public static int buyCount = 1; // 购买的数量 public override string ToString() { return "积分商店配置"; } public override void popG2DPropertyDialog() { CommonFroms.G2D.G2DPropertyDialog.Show("修改配置", this); } } } }