private void tCore_Tick(object sender, EventArgs e) { if (CheckParams()) { if (cbAutoAccept.Checked) { tRequest readyReq = Request(RestSharp.Method.GET, "/lol-matchmaking/v1/ready-check"); if (readyReq.IsAvaible()) { ReadyCheck.Root readyCheck = JsonConvert.DeserializeObject <ReadyCheck.Root>(readyReq.Content); if (readyCheck.State == "InProgress") { Request(RestSharp.Method.POST, "/lol-matchmaking/v1/ready-check/accept"); } } } if (cbTimeStatus.Checked) { tRequest chatReq = Request(RestSharp.Method.GET, "/lol-chat/v1/me"); if (chatReq.IsAvaible()) { Chat.Root chat = new Chat.Root(); chat.StatusMessage = DateTime.Now.ToString("hh:mm"); tRequest chatPutReq = Request(RestSharp.Method.PUT, "/lol-chat/v1/me", JsonConvert.SerializeObject(chat), RestSharp.DataFormat.Json); } } } }
private void MainForm_Load(object sender, EventArgs e) { if (LCU.LCU.CheckParams()) { LCU.LCU.tRequest summonerReq = LCU.LCU.Request(RestSharp.Method.GET, "/lol-summoner/v1/current-summoner"); if (summonerReq.IsAvaible()) { Summoner.Root summoner = JsonConvert.DeserializeObject <Summoner.Root>(summonerReq.Content); lblUsername.Text = summoner.DisplayName; pbProfile.ImageLocation = "http://ddragon.leagueoflegends.com/cdn/10.24.1/img/profileicon/" + summoner.ProfileIconId + ".png"; pbLevel.Value = summoner.PercentCompleteForNextLevel; pbLevel.Content = "(" + summoner.XpSinceLastLevel + "/" + summoner.XpUntilNextLevel + ")"; } LCU.LCU.tRequest walletReq = LCU.LCU.Request(RestSharp.Method.GET, "/lol-store/v1/wallet"); if (walletReq.IsAvaible()) { Wallet.Root wallet = JsonConvert.DeserializeObject <Wallet.Root>(walletReq.Content); lblBE.Text = wallet.Ip.ToString(); lblRP.Text = wallet.Rp.ToString(); } tRequest chatReq = Request(RestSharp.Method.GET, "/lol-chat/v1/me"); if (chatReq.IsAvaible()) { Chat.Root chat = JsonConvert.DeserializeObject <Chat.Root>(chatReq.Content); tbStatus.Content = chat.StatusMessage; } } }
private void btnChangeStatus_Click(object sender, EventArgs e) { if (CheckParams()) { tRequest chatReq = Request(RestSharp.Method.GET, "/lol-chat/v1/me"); if (chatReq.IsAvaible()) { Chat.Root chat = new Chat.Root(); chat.StatusMessage = tbStatus.Content; tRequest chatPutReq = Request(RestSharp.Method.PUT, "/lol-chat/v1/me", JsonConvert.SerializeObject(chat), RestSharp.DataFormat.Json); } } }