using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace Neobux_Bot
{
public partial class Form1 : Form
{
int NClick;
public Form1()
{
InitializeComponent();
webBrowser1.Navigate("www.neobux.com/m/l/");
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void buttonAvvia_Click(object sender, EventArgs e)
{
timer2.Enabled = true;
NClick = Convert.ToInt32 (labelClick.Text);
webBrowser1.Navigate("www.neobux.com/m/v/");
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
Thread.Sleep(1000);
}
while (webBrowser1.Document.GetElementById("t_conta") != null) // controlla se sono loggato
{
while (webBrowser1.Document.GetElementById("tg_4") != null) //controlla se sono sulla pagina giusta
{
webBrowser1.Navigate("www.neobux.com/m/v/");
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
Thread.Sleep(1000);
}
for (int var = 1; var <= 30; var = var + 1)
{
foreach (HtmlElement elemento in webBrowser1.Document.All) //trova tutto
{
if (elemento.GetAttribute("id") == "tg_" + var.ToString() && elemento.GetAttribute("classname") != "ad0")
{
foreach (HtmlElement bottoneRosso in webBrowser1.Document.GetElementsByTagName("a")) //trova tutto
{
if (bottoneRosso.GetAttribute("id") == "l" + var.ToString())
{
string link = bottoneRosso.GetAttribute("href");
webBrowser1.Navigate(link);
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
Thread.Sleep(1000);
}
timer1.Enabled = true;
break;
}
}
break;
}
}
}
}
}
}
private void timer1_Tick(object sender, EventArgs e)
{
foreach (HtmlElement caricamento in webBrowser1.Document.All)
{
string stile = caricamento.Style;
//public string Style (stile);
if (caricamento.GetAttribute("id") == "o1")
{
if (stile != "DISPLAY: none")
{
timer1.Enabled = false;
NClick = NClick + 1;
labelClick.Text = NClick.ToString();
//Form1 obj = new Form1();
//obj.buttonAvvia_Click();
buttonAvvia_Click(null,null);
break;
}
}
if (caricamento.GetAttribute("id") == "o0_err") // expired
{
if (stile != "DISPLAY: none")
{
timer1.Stop();
buttonAvvia_Click(null, null);
break;
}
}
if (caricamento.GetAttribute("id") == "o0") // error
{
MessageBox.Show(stile);
if (stile != "DISPLAY: none")
{
timer1.Stop();
buttonAvvia_Click(null, null);
break;
}
}
}
}
private void timer2_Tick(object sender, EventArgs e)
{
buttonAvvia_Click(null, null);
return;
}
}
}