Don't like ads? PRO users don't see any ads ;-)
Guest

fvgrrghrtyh

By: a guest on Apr 30th, 2012  |  syntax: C#  |  size: 4.82 KB  |  hits: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Threading;
  10.  
  11.  
  12. namespace Neobux_Bot
  13. {
  14.     public partial class Form1 : Form
  15.     {
  16.         int NClick;
  17.        
  18.         public Form1()
  19.         {
  20.             InitializeComponent();
  21.             webBrowser1.Navigate("www.neobux.com/m/l/");
  22.         }
  23.  
  24.        
  25.  
  26.         private void Form1_Load(object sender, EventArgs e)
  27.         {
  28.            
  29.         }
  30.        
  31.         private void buttonAvvia_Click(object sender, EventArgs e)
  32.         {
  33.             timer2.Enabled = true;
  34.             NClick = Convert.ToInt32 (labelClick.Text);
  35.             webBrowser1.Navigate("www.neobux.com/m/v/");
  36.  
  37.             while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
  38.             {
  39.                 Application.DoEvents();
  40.                 Thread.Sleep(1000);
  41.             }
  42.            
  43.             while (webBrowser1.Document.GetElementById("t_conta") != null) // controlla se sono loggato
  44.             {
  45.      
  46.                 while (webBrowser1.Document.GetElementById("tg_4") != null) //controlla se sono sulla pagina giusta
  47.                 {
  48.                
  49.                     webBrowser1.Navigate("www.neobux.com/m/v/");
  50.  
  51.                     while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
  52.                     {
  53.                         Application.DoEvents();
  54.                         Thread.Sleep(1000);
  55.                     }
  56.                
  57.                     for (int var = 1; var <= 30; var = var + 1)
  58.                     {
  59.                    
  60.                         foreach (HtmlElement elemento in webBrowser1.Document.All) //trova tutto
  61.                         {
  62.                             if (elemento.GetAttribute("id") == "tg_" + var.ToString() && elemento.GetAttribute("classname") != "ad0")
  63.                             {
  64.                                 foreach (HtmlElement bottoneRosso in webBrowser1.Document.GetElementsByTagName("a")) //trova tutto
  65.                                 {
  66.                                     if (bottoneRosso.GetAttribute("id") == "l" + var.ToString())
  67.                                     {
  68.                                         string link = bottoneRosso.GetAttribute("href");
  69.                                         webBrowser1.Navigate(link);
  70.                                         while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
  71.                                         {
  72.                                             Application.DoEvents();
  73.                                             Thread.Sleep(1000);
  74.                                         }
  75.                                        
  76.                                         timer1.Enabled = true;
  77.                                         break;  
  78.                                     }
  79.                                 }
  80.                                 break;
  81.                             }
  82.                         }
  83.                     }
  84.                 }
  85.             }
  86.         }
  87.  
  88.         private void timer1_Tick(object sender, EventArgs e)
  89.         {
  90.             foreach (HtmlElement caricamento in webBrowser1.Document.All)
  91.             {
  92.                 string stile = caricamento.Style;
  93.                 //public string Style (stile);
  94.                
  95.                 if (caricamento.GetAttribute("id") == "o1")
  96.                 {
  97.                     if (stile != "DISPLAY: none")
  98.                     {
  99.                         timer1.Enabled = false;
  100.                         NClick = NClick + 1;
  101.                         labelClick.Text = NClick.ToString();
  102.                         //Form1 obj = new Form1();
  103.                         //obj.buttonAvvia_Click();
  104.                         buttonAvvia_Click(null,null);
  105.                         break;
  106.                     }
  107.                 }
  108.                
  109.                 if (caricamento.GetAttribute("id") == "o0_err") // expired
  110.                 {
  111.                     if (stile != "DISPLAY: none")
  112.                     {
  113.                         timer1.Stop();
  114.                         buttonAvvia_Click(null, null);
  115.                         break;
  116.                     }
  117.                 }
  118.  
  119.                 if (caricamento.GetAttribute("id") == "o0") // error
  120.                 {
  121.                     MessageBox.Show(stile);
  122.                     if (stile != "DISPLAY: none")
  123.                     {
  124.                         timer1.Stop();
  125.                         buttonAvvia_Click(null, null);
  126.                         break;
  127.                     }
  128.                 }
  129.             }
  130.         }
  131.  
  132.         private void timer2_Tick(object sender, EventArgs e)
  133.         {
  134.             buttonAvvia_Click(null, null);
  135.             return;
  136.         }
  137.     }
  138. }