Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!

cracked.io | Best Forum Around | Free Premium Accounts




 1695

C# Trouble looping proxylist with account list in my checker.

by Redp87 - 17 May, 2019 - 09:47 PM
This post is by a banned member (Redp87) - Unhide
Redp87  
Registered
60
Posts
1
Threads
5 Years of service
#1
(This post was last modified: 19 May, 2019 - 02:53 PM by Redp87.)
Can sombody help me figure out how to do it?
 
First thing is: for example if the number of threads is 5, the problem is that it starts testing the accountList from 4 instead of 0. Secondly: I get duplicates of the last tested account and a lot of other duplicates!

Code:
   int accountPosition, accountPosition1, proxyPosition, proxyPosition1;

   //accountPosition1 = accountPosition + 1
   //proxyPosition = proxyPosition + 1


   [ThreadStatic]
   private static bool BanProxy = false;
   [ThreadStatic]
   private static bool DontR = false;
   [ThreadStatic]
   private static bool Dont = false;
   [ThreadStatic]
   private static bool Retry = false;

   public static List<string> accountLst = new List<string>();
   public static List<string> proxyLst = new List<string>();



private void Button2_Click(object sender, EventArgs e)
{
   int tCount = Convert.ToInt32(textBox2.Text);
   if (checkBox1.Checked)
      LoadProxies();
   LoadAccounts();

   for (int i = 0; i < tCount; i++)
   {
        var th = new Thread(() => Worker());
        th.Start();
   }
}
And here is the worker where the problem seems to come from. I tried everything I could think of without result.

   public void Worker()
   {
       int j = Thread.CurrentThread.ManagedThreadId;
       while (accountPosition < accountLst.Count - 1)
       {
           if (!DontR)
           {
               proxyCount++;
               if (label7.InvokeRequired)
                   Invoke((MethodInvoker)(() => this.label7.Text = $"pCount : {proxyCount}"));
           }
           if (proxyPosition1 == proxyLst.Count)
           {
               //Thread.Sleep(timetoretestproxylist);
               proxyPosition1 = 0;
           }
           proxyPosition = proxyPosition1;
           if (!DontR)
               proxyPosition1++;

           do
           {
               if (!Dont & !Retry)
               {
                    accountPostion = accountPostion1;
                    accountPostion1++;    
               }

               if (richTextBox2.InvokeRequired)
                   Invoke((MethodInvoker)(() => richTextBox2.AppendText($"accountPostion: {accountPostion}, thread: {j}" + "\n")));

               switch (Checker(accountLst[accountPostion], proxyLst[proxyPostion]))
               {
                   case FAIL_KEY:
                       failCount++;
                       BanProxy = false;
                       if (label3.InvokeRequired)
                           Invoke((MethodInvoker)(() => label3.Text = $"Bad : {failCount}"));
                       break;
                   case SUCC_KEY:
                       successCount++;
                       BanProxy = false;
                       Invoke(new MethodInvoker(() =>
                       {
                           label1.Text = $"Success : {successCount}";
                           richTextBox1.AppendText(accountLst[v] + "\n");
                       }));
                       break;
                   case FREE_KEY:
                       freeCount++;
                       BanProxy = false;
                       if (label2.InvokeRequired)
                           Invoke((MethodInvoker)(() => label2.Text = $"Free : {freeCount}"));
                       break;
                   case BAN_KEY:
                       banCount++;
                       if (label4.InvokeRequired)
                           Invoke((MethodInvoker)(() => label4.Text = $"Ban : {banCount}"));
                       BanProxy = true;
                       break;
                   case RET_KEY:
                       retCount++;
                       Retry = true;
                       break;
                   default:
                       unknownCount++;
                       BanProxy = false;
                       if (label7.InvokeRequired)
                           Invoke((MethodInvoker)(() => label5.Text = $"Unknown : {unknownCount}"));
                       break;
               }

               if (Retry)
               {
                   DontR = true;
                   break;
               }

               if (BanProxy)
               {
                   Dont = true;
                   break;
               }

               globalCount++;
               Invoke((MethodInvoker)(() =>
               {
                   richTextBox2.AppendText(accountLst[accountPostion] + "\n");
                   label6.Text = $"Total : {globalCount}/{accountLst.Count}";
               }));

               DontR = false;
               Dont = false;

           } while (accountPostion < accountLst.Count - 1);

       }
   }

BanProxy and Retry are switched off or on inside the checker.
This post is by a banned member (Pinkzord) - Unhide
Pinkzord  
Registered
26
Posts
1
Threads
5 Years of service
#2
You need to make your code more readable. try to rename this

int r, g, v, w;

to the proper function of that variables, after that I may help you :)
This post is by a banned member (Redp87) - Unhide
Redp87  
Registered
60
Posts
1
Threads
5 Years of service
#3
(19 May, 2019 - 10:40 AM)Pinkzord Wrote: Show More
You need to make your code more readable. try to rename this

 int r, g, v, w;

to the proper function of that variables, after that I may help you :)

Thank you for your response. I modified the variables so they are more readable :)
This post is by a banned member (Redp87) - Unhide
Redp87  
Registered
60
Posts
1
Threads
5 Years of service
#4
(19 May, 2019 - 04:02 PM)Pinkzord Wrote: Show More
what men, you have 2 loops on the same variables. That code is really a mess.

while (accountPosition < accountLst.Count - 1)
     
and inside that you have

  } while (accountPostion < accountLst.Count - 1);

you also do not initialize the variables,

The variables can be initialized = 0 without changing anything. And the 2 loops are for rechecking the same account if the proxy is banned with proxy + 1.

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 1 Guest(s)