public void Run() { var battleId = _client.ViewModel.GuildBattleId; while (_client.ViewModel.TpValue >= 10 && _client.ViewModel.IsRunning) { GuildBattleInfo battleInfo = GuildBattle(battleId); _client.ViewModel.TpValue = battleInfo.status.tp.value; // attack var type = "front".Equals(battleInfo.status.position) ? "attack" : "yell"; var ablility = "front".Equals(battleInfo.status.position) ? "ability_front_attack_default" : "ability_back_yell_default_1"; GuildBattleCmdInfo cmdInfo = GuildBattleCmd(battleId, type); var cmd = cmdInfo.cmd.Find(item => ablility.Equals(item._id)); if (cmd != null) { GuildBattleCmd(battleId, ablility, type); } } TpInfo tpInfo = GuildBattleTpInfo(); // quest TpQuest(); }
private GuildBattleCmdInfo GuildBattleCmd(string battleId, string type) { var result = _client.GetXHR("http://astrum.amebagames.com/_/guildbattle/cmd?_id=" + battleId + "&type=" + type); GuildBattleCmdInfo cmdInfo = JsonConvert.DeserializeObject <GuildBattleCmdInfo>(result); //PrintCmdInfo(cmdInfo); InfoUpdater.UpdateGuildBattleStatus(cmdInfo.status, _client.ViewModel); _client.DelayShort(); return(cmdInfo); }