private void button_Gacha1_Click(object sender, EventArgs e) { List <GachaResult> ls = new List <GachaResult>(); switch (tabControl1.SelectedIndex) { case 0: ls.Add(MainGacha.KC_Gacha()); ls.Add(MainGacha.KC_GachaSub()); break; case 1: case 2: ls.Add(MainGacha.JZ_GachaMain(tabControl1.SelectedIndex == 1 ? PoolName.精准A : PoolName.精准B)); ls.Add(MainGacha.JZ_GachaMaterial()); break; case 3: ls.Add(MainGacha.BP_GachaMain()); ls.Add(MainGacha.BP_GachaSub()); break; } listBox_Result.Items.Add(ls[ls.Count - 2].name); listBox_Result.Items.Add(ls[ls.Count - 1].name); listBox_Result.SelectedIndex = listBox_Result.Items.Count - 1; }
private void button_Gacha10_Click(object sender, EventArgs e) { List <GachaResult> ls = new List <GachaResult>(); switch (tabControl1.SelectedIndex) { case 0: for (int i = 0; i < 10; i++) { ls.Add(MainGacha.KC_Gacha()); ls.Add(MainGacha.KC_GachaSub()); } break; case 1: case 2: for (int i = 0; i < 10; i++) { ls.Add(MainGacha.JZ_GachaMain(tabControl1.SelectedIndex == 1 ? PoolName.精准A : PoolName.精准B)); ls.Add(MainGacha.JZ_GachaMaterial()); } break; case 3: for (int i = 0; i < 10; i++) { ls.Add(MainGacha.BP_GachaMain()); ls.Add(MainGacha.BP_GachaSub()); } break; } ls = ls.OrderByDescending(x => x.value).ToList(); for (int i = 0; i < ls.Count; i++) { for (int j = i + 1; j < ls.Count; j++) { if (ls[i].name == ls[j].name && ls[i].type != TypeS.Stigmata.ToString() && ls[i].type != TypeS.Weapon.ToString()) { ls[i].count += ls[j].count; ls.RemoveAt(j); i--; j--; if (i == -1) { i = 0; } } } } foreach (var item in ls) { listBox_Result.Items.Add(item.name + " x" + item.count); } listBox_Result.Items.Add(""); listBox_Result.SelectedIndex = listBox_Result.Items.Count - 2; }
public FunctionResult Progress(QMGroupMessageEventArgs e) { FunctionResult result = new FunctionResult { result = QMEventHandlerTypes.Intercept, SendFlag = true }; SendText sendText = new SendText(); sendText.SendID = e.FromGroup.Id; result.SendObject.Add(sendText); bool exist = SQLHelper.IDExist(e); if (!exist) { sendText.MsgToSend.Add(PublicArgs.noReg.Replace("<@>", $"[@{e.FromQQ.Id}]")); return(result); } int diamond = SQLHelper.GetDiamond(e); if (diamond < 280) { sendText.MsgToSend.Add(PublicArgs.lowDiamond.Replace("<@>", $"[@{e.FromQQ.Id}]") .Replace("<#>", diamond.ToString())); return(result); } QMApi.CurrentApi.SendGroupMessage(e.RobotQQ, e.FromGroup, PublicArgs.JZA1 .Replace("<@>", $"[@{e.FromQQ.Id}]").Replace("<#>", diamond.ToString())); List <GachaResult> ls = new List <GachaResult> { MainGacha.BP_GachaMain(), MainGacha.BP_GachaSub() }; SQLHelper.AddItem2Repositories(ls, e); CombinePng cp = new CombinePng(); SQLHelper.SubDiamond(e, 280); SQLHelper.AddCount_Gacha(e, 1); IniConfig ini = new IniConfig($@"{MainSave.AppDirectory}概率\标配概率.txt"); ini.Load(); sendText.MsgToSend.Add(ini.Object["详情"]["ResultAt"].GetValueOrDefault("0") == "1" ? $"[@{e.FromQQ.Id}]" : "" + Save.AppConfig.Object["ExtraConfig"]["TextGacha"].GetValueOrDefault("0") == "1" ? Helper.TextGacha(ls) : $"[pic=" + $"{cp.MakePic(ls, PublicArgs.PoolName.标配, diamond - 280, e.FromQQ.Id, e.FromGroup.Id)}]"); return(result); }
public static void Main() { Stopwatch sw = new Stopwatch(); sw.Start(); MainSave.AppDirectory = @"E:\QQMini机器人开发\QQMiniPro\Data\me.luohuaming.bh3gacha\"; Save.AppConfig = new IniConfig(Path.Combine(MainSave.AppDirectory, "Config.ini")); Save.AppConfig.Load(); Event_StartUp.Init(); //Event_StartUp.ReadConfig(); //BH3rdGacha.SQLHelper.Register(891787846, 863450594); Console.WriteLine(BH3rdGacha.SQLHelper.GetDiamond(891787846, 863450594)); sw.Stop(); Console.WriteLine("初始化耗时:" + sw.ElapsedMilliseconds + "ms"); sw.Restart(); BH3rdGacha.SQLHelper.IDExist(891787846, 863450594); sw.Stop(); Console.WriteLine("查询存在耗时:" + sw.ElapsedMilliseconds + "ms"); sw.Restart(); Console.WriteLine(BH3rdGacha.SQLHelper.GetDiamond(891787846, 863450594)); sw.Stop(); Console.WriteLine("查询钻石耗时:" + sw.ElapsedMilliseconds + "ms"); sw.Restart(); BH3rdGacha.SQLHelper.Sign(891787846, 863450594); Console.WriteLine(BH3rdGacha.SQLHelper.GetDiamond(891787846, 863450594)); sw.Stop(); Console.WriteLine("签到耗时:" + sw.ElapsedMilliseconds + "ms"); sw.Restart(); List <GachaResult> ls = new List <GachaResult>(); for (int i = 0; i < 10; i++) { var c = MainGacha.KC_Gacha(); Console.WriteLine(c.ToString()); ls.Add(c); c = MainGacha.BP_GachaSub(); Console.WriteLine(c.ToString()); ls.Add(c); } CombinePng pic = new CombinePng(); Console.WriteLine(pic.MakePic(ls, PublicArgs.PoolName.扩充, 1288, 863450594, 891787846)); Console.WriteLine("抽卡耗时:" + sw.ElapsedMilliseconds + "ms"); sw.Restart(); BH3rdGacha.SQLHelper.AddItem2Repositories(ls, 891787846, 863450594); sw.Stop(); Console.WriteLine("加入仓库耗时:" + sw.ElapsedMilliseconds + "ms"); Console.ReadKey(); }
public FunctionResult Progress(QMGroupMessageEventArgs e) { FunctionResult result = new FunctionResult { result = QMEventHandlerTypes.Intercept, SendFlag = true }; SendText sendText = new SendText(); sendText.SendID = e.FromGroup.Id; result.SendObject.Add(sendText); bool exist = SQLHelper.IDExist(e); if (!exist) { sendText.MsgToSend.Add(PublicArgs.noReg.Replace("<@>", $"[@{e.FromQQ.Id}]")); return(result); } int diamond = SQLHelper.GetDiamond(e); if (diamond < 2800) { sendText.MsgToSend.Add(PublicArgs.lowDiamond.Replace("<@>", $"[@{e.FromQQ.Id}]") .Replace("<#>", diamond.ToString())); return(result); } QMApi.CurrentApi.SendGroupMessage(e.RobotQQ, e.FromGroup, PublicArgs.JZA10 .Replace("<@>", $"[@{e.FromQQ.Id}]").Replace("<#>", diamond.ToString())); List <GachaResult> ls = new List <GachaResult>(); for (int i = 0; i < 10; i++) { ls.Add(MainGacha.BP_GachaSub()); ls.Add(MainGacha.BP_GachaMain()); } ls = ls.OrderByDescending(x => x.value).ToList(); for (int i = 0; i < ls.Count; i++) { for (int j = i + 1; j < ls.Count; j++) { if (ls[i].name == ls[j].name && ls[i].type != PublicArgs.TypeS.Stigmata.ToString() && ls[i].type != PublicArgs.TypeS.Weapon.ToString()) { ls[i].count += ls[j].count; ls.RemoveAt(j); i--; j--; if (i == -1) { i = 0; } } } } SQLHelper.AddItem2Repositories(ls, e); CombinePng cp = new CombinePng(); SQLHelper.SubDiamond(e, 2800); SQLHelper.AddCount_Gacha(e, 10); IniConfig ini = new IniConfig($@"{MainSave.AppDirectory}概率\标配概率.txt"); ini.Load(); sendText.MsgToSend.Add(ini.Object["详情"]["ResultAt"].GetValueOrDefault("0") == "1" ? $"[@{e.FromQQ.Id}]" : "" + Save.AppConfig.Object["ExtraConfig"]["TextGacha"].GetValueOrDefault("0") == "1" ? Helper.TextGacha(ls) : $"[pic=" + $"{cp.MakePic(ls, PublicArgs.PoolName.标配, diamond - 2800, e.FromQQ.Id, e.FromGroup.Id)}]"); return(result); }