private void AccountPanelTimer_Tick(object sender, EventArgs e) { string botOnline = Others.GetRequest("http://tech.thenoobbot.com/auth.php", "botOnline=true"); if (LoginServer.IsFreeVersion) { int timeLeftSec = (LoginServer.StartTime + 1000 * 60 * 20) - Others.Times; AccountName.Text = LoginServer.Login; TimeLeft.Text = Others.SecToHour(timeLeftSec / 1000); OnlineBot.Text = botOnline; } else { string timeLeft = Others.GetReqWithAuthHeader("http://tech.thenoobbot.com/auth.php?TimeSubscription=true", LoginServer.Login, LoginServer.Password)[0]; AccountName.Text = LoginServer.Login; TimeLeft.Text = timeLeft; OnlineBot.Text = nManager.Translate.Get(nManager.Translate.Id.OnlineBots) + " " + botOnline; AccountPanelTimer.Interval = 5000; } if (Remote.RemoteActive) { RemoteSessionInfo.Text = nManager.Translate.Get(nManager.Translate.Id.SessionInfo) + " " + Remote.SessionKey; } else { RemoteSessionInfo.Text = ""; } }
private static List <string> GetReqWithAuthHeader(string url, String userName, String userPassword) { try { return(Others.GetReqWithAuthHeader(url, userName, userPassword)); } catch (Exception e) { Logging.WriteError("DVSVsVrfvgrerfgd'(gtedf;: " + e); return(new List <string>()); } }
private void SendGetToServer() { try { try { if (channel == null) { channel = new Channel(); } for (int i = 0; i < 20; i++) { string v = channel.ReadWhisperChannel(); if (v != "") { channelWhisper.Add(v); if (channelWhisper.Count > 3) { channelWhisper.RemoveAt(0); } break; } } } catch (Exception e) { Logging.WriteError("Remote > SendGetToServer()#1: " + e); } string whisper = channelWhisper.Aggregate("", (current, cw) => cw.Replace("~", "-").Replace("|", "-") + "~" + current); whisper = whisper.Replace("[Whisper]", ""); Logging.LogType flag = Logging.LogType.S; flag |= Logging.LogType.D; flag |= Logging.LogType.E; flag |= Logging.LogType.F; flag |= Logging.LogType.N; PacketClient packetClient = new PacketClient { Name = ObjectManager.Me.Name, Level = (int)ObjectManager.Me.Level, Health = (int)ObjectManager.Me.HealthPercent, X = ObjectManager.Me.Position.X, Y = ObjectManager.Me.Position.Y, Z = ObjectManager.Me.Position.Z, LastLog = Logging.ReadLastString(flag), TargetName = ObjectManager.Target.Name, TargetLevel = (int)ObjectManager.Target.Level, TargetHealth = (int)ObjectManager.Target.HealthPercent, InGame = Usefuls.InGame, SubMapName = Usefuls.SubMapZoneName, ClassPlayer = ObjectManager.Me.WowClass.ToString(), BagSpace = Usefuls.GetContainerNumFreeSlots, LastWhisper = whisper, Screenshot = UploadScreenshot() }; string req = packetClient.Name + "|" + packetClient.Level + "|" + packetClient.Health + "|" + packetClient.X + "|" + packetClient.Y + "|" + packetClient.Z + "|" + packetClient.LastLog + "|" + packetClient.TargetName + "|" + packetClient.TargetLevel + "|" + packetClient.TargetHealth + "|" + packetClient.InGame + "|" + packetClient.SubMapName + "|" + packetClient.ClassPlayer + "| |" + packetClient.BagSpace + "|" + packetClient.LastWhisper + "|" + packetClient.Screenshot; List <string> result = Others.GetReqWithAuthHeader(RemoteScript + "?sessionId=" + _sessionKey + "&forServer=" + req, LoginServer.Login, LoginServer.Password); if (result[0] == null) { result[0] = ""; } string whisperContant = ""; string whisperFor = ""; if (result[0].Contains("|")) { try { string[] t = result[0].Split('|'); if (t.Length >= 3) { result[0] = t[0]; whisperFor = t[1]; whisperContant = t[2]; } } catch (Exception e) { Logging.WriteError("Remote > SendGetToServer()#2: " + e); } } if (result.Count > 0) { if (result[0] == "") { result[0] = "0"; } switch ((FlagRequest)Others.ToInt32(result[0])) { case FlagRequest.CloseBot: Logging.WriteDebug("Remote: Close bot."); try { nManager.Pulsator.Dispose(true); } catch { } Process.GetCurrentProcess().Kill(); break; case FlagRequest.CloseWow: Logging.WriteDebug("Remote: Close game."); Memory.WowProcess.KillWowProcess(); break; case FlagRequest.ShutDownPc: Logging.WriteDebug("Remote: Shutdown Computer."); Others.ShutDownPc(); break; case FlagRequest.SendWhisper: if (whisperFor != "" && whisperContant != "") { Chat.SendChatMessageWhisper(whisperContant, whisperFor); channelWhisper.Add("By me To " + whisperFor + ": " + whisperContant); if (channelWhisper.Count > 3) { channelWhisper.RemoveAt(0); } } break; } } } catch (Exception e) { Logging.WriteError("Remote > SendGetToServer()#3: " + e); } }