private void MyRefreah() { GroupIdList.Items.Clear(); QQIdList.Items.Clear(); DayList.Items.Clear(); DmgList.Items.Clear(); pcrbot = Event_GroupMsg.GetPrcbot(); if (pcrbot != null) { foreach (var p in pcrbot) { GroupIdList.Items.Add("" + p.Key); } } }
private void Button_Click(object sender, RoutedEventArgs e) { str = new string[14]; str[0] = rootMemberId.Text; str[1] = GroupId.Text; str[2] = pcrbotKey.Text; str[3] = maxMember.Text; str[4] = (SaveDatPre.IsChecked == true) ? "1" : "0"; str[5] = reMsgMaxLine.Text; str[6] = MaxLotteryTimes.Text; str[7] = star1c.Text; str[8] = star1.Text; str[9] = star2c.Text; str[10] = star2.Text; str[11] = star3c.Text; str[12] = star3.Text; str[13] = ImgRandom.Text; var rootMemberList = rootMemberId.Text.Split(','); var GroupIdList = GroupId.Text.Split(','); Dictionary <long, Pcrbot> pcrbot = null; try { pcrbot = Event_GroupMsg.GetPrcbot(); }catch (Exception ex) { if (Common.CQLog != null) { Common.CQLog.Warning("获取pcrbot失败" + ex.Message); } } foreach (var p in pcrbot) { p.Value.key = str[2]; p.Value.rootMember.Clear(); int.TryParse(str[3], out int max); int.TryParse(str[5], out p.Value.reMsgMaxLine); int.TryParse(str[6], out p.Value.lotteryTimes); if (max >= 1) { p.Value.MaxAttackCount = max; } else { maxMember.Text = "1"; } p.Value.SaveDatPer = str[4].Equals("1"); int.TryParse(str[7], out int s1c); int.TryParse(str[9], out int s2c); int.TryParse(str[11], out int s3c); p.Value.ChangePool(s1c, str[8], s2c, str[10], s3c, str[12]); p.Value.RandomImgStr = str[13]; foreach (var id in rootMemberList) { if (long.TryParse(id, out long temp)) { p.Value.rootMember.Add(temp); } } p.Value.UseGroupId.Clear(); foreach (var id in GroupIdList) { if (long.TryParse(id, out long temp)) { p.Value.UseGroupId.Add(temp); } } } Save(); Close(); }