Esempio n. 1
0
 public static void filter_min_exp(string [] args)
 {
     if(args.Length!=4)
     {
         ConsoleLog.WriteLine("checkbanned list out_list minexp");
         return;
     }
     string[] Bots=System.IO.File.ReadAllLines(args[1]);
     System.IO.TextWriter outs=new System.IO.StreamWriter(args[2],true);
     //System.Net.WebClient client=new System.Net.WebClient();
     NerZul.Core.Network.HttpClient client=new NerZul.Core.Network.HttpClient();
     int cnt=1;
     foreach (string Bot in Bots)
     {
         ConsoleLog.WriteLine("["+cnt.ToString()+"/"+Bots.Length.ToString()+"] "+
                           "Checking "+Bot.Split('|')[0]); cnt++;
         string botinfo=Bot.Split('|')[0].Replace(" ","%20");
         botinfo="http://api.erepublik.com/v1/feeds/citizens/"+botinfo+"?by_username=true";
         botinfo=client.DownloadString(botinfo);
         botinfo=System.Text.RegularExpressions.Regex.
             Match(botinfo,@"\<experience-points\>(\w+)\<").Groups[1].Value;
         if (int.Parse(botinfo)>=int.Parse(args[3]))
         {
             outs.WriteLine(Bot);
             outs.Flush();
             ConsoleLog.WriteLine("OK");
         }
         System.Threading.Thread.Sleep(3000);
     };
 }
Esempio n. 2
0
        public static void Worker(string[] args)
        {
            Pop3.Pop3Client mailclient=new Pop3.Pop3Client();
            ConsoleLog.WriteLine("Connecting to "+args[1]);
            mailclient.Connect(args[1],args[2],args[3]);
            ConsoleLog.WriteLine("Logged in. Retrieving message list...");
            System.Collections.Generic.List<Pop3.Pop3Message> messages=mailclient.List();
            foreach (Pop3.Pop3Message message in messages)
            {
                mailclient.Retrieve(message);
                if(!message.Body.Contains("erepublik"))
                {
                    mailclient.Delete(message);
                    ConsoleLog.WriteLine("Unrelated message. Deleted.");
                }else
                {
                    string sBuf = message.Body;
                    sBuf = sBuf.Replace("\n", "");
                    sBuf = sBuf.Replace("\r", "");
                    string link = sBuf.Substring(sBuf.IndexOf("http://www.erepublik.com/en/register-validate/"));
                    link=link.Remove(link.IndexOfAny(new char[]{'\r','\n', '\"', '<'}));
                    link = link.Replace("=", "");
                    ConsoleLog.WriteLine(link);
                    NerZul.Core.Network.HttpClient http =new NerZul.Core.Network.HttpClient();
                    try
                    {
                        link = http.DownloadString(link);
                    }
                    catch (System.Exception e)
                    {
                        ConsoleLog.WriteLine("Activation error: " + e.Message);
                    }
                    if (link.Contains("Congratulations"))
                    {
                        ConsoleLog.WriteLine("Activated");
                    };
                    if (link.Contains("has either expired"))
                    {
                        ConsoleLog.WriteLine("Expired");
                    };
                    mailclient.Delete(message);
                    ConsoleLog.WriteLine("Deleted.");

                    System.Threading.Thread.Sleep(1000);
                }
            }
        }
Esempio n. 3
0
        public static bool OpenLink(string link)
        {
            NerZul.Core.Network.HttpClient http = new NerZul.Core.Network.HttpClient();
            if (!Globals.BotConfig.useTOR)
            {
                http.SetProxy(Globals.BotConfig.ProxyList.GetRandomString(), Globals.BotConfig.proxyCredentials);
            }
            else
            {
                http.SetProxy("127.0.0.1:8118", null);//Globals.BotConfig.ProxyList.GetString(0);

                if (!(new TorClient(http.GetProxy(), "")).GetNewIP())
                    throw new Exception("Error getting new TOR IP");

                ConsoleLog.WriteLine("TOR new IP obtained!");
            }

            try
            {
                link = http.DownloadString(link);

                if (link.Contains("Congratulations"))
                {
                    ConsoleLog.WriteLine("Activated");
                    return true;
                }
                if (link.Contains("has either expired"))
                {
                    ConsoleLog.WriteLine("Expired");
                    return true;
                }
            }
            catch (System.Exception e)
            {
                ConsoleLog.WriteLine("Error: " + e.Message);
            }

            return false;
        }