1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- 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;
- using XmdsBattleClientBot;
- using CommonLang;
- namespace XmdsBotTest.Runner
- {
- public class CombineFunc : BotRunner.RunnerModule
- {
- List<int> CombineIds = new List<int>();
- public CombineFunc() {
- module_name = "宝石合成";
- }
- public CombineFunc(BotRunner r) : base(r)
- {
- CombineIds.Add(11001);
- CombineIds.Add(12001);
- CombineIds.Add(13001);
- CombineIds.Add(14001);
- CombineIds.Add(15001);
- }
- protected internal override void OnGateBindPlayer(BindPlayerResponse e)
- {
- base.OnGateBindPlayer(e);
- runner.do_gm_add_item("gr1",100);
- runner.do_gm_add_item("gy1", 100);
- runner.do_gm_add_item("gb1", 100);
- runner.do_gm_add_item("gg1", 100);
- runner.do_gm_add_item("gp1", 100);
- }
- protected internal override void OnBattleActorReady(CommonAI.ZoneClient.ZoneLayer layer, CommonAI.ZoneClient.ZoneActor actor)
- {
- layer.AddTimePeriodicMS(Config.CheckIntervalMS, (t) =>
- {
- if (Enable)
- {
- combineRequest();
- }
- });
- }
- private void combineRequest()
- {
- if (Enable) {
- int combineId = bot.Random.Next(0, CombineIds.Count);
- client.GameSocket.itemHandler.combineRequest(CombineIds[combineId], 1,0,
- (err, rsp) =>
- {
-
- });
- }
- }
- [Desc("宝石合成配置")]
- [Expandable]
- public class Config : ConfigBase
- {
- [Desc("宝石合成检测间隔")]
- public static int CheckIntervalMS = 5000;
- public override string ToString()
- {
- return "宝石合成配置";
- }
- public override void popG2DPropertyDialog()
- {
- CommonFroms.G2D.G2DPropertyDialog<CombineFunc.Config>.Show("修改配置", this);
- }
- }
- }
- }
|