Code:
public void feeder()
{
while (kadstart == true)
{
//Start Get kad info. Remove ignore items
clearvalues();
lblkadstat.Text = "Refreshing...";
strhtml = g("http://www.neopets.com/games/kadoatery/");
if(strhtml.Contains("href=\"/login/index.phtml\">Sign up</a>")){
strhtml = strhtml = p("http://www.neopets.com/login.phtml", "destination=%252Findex.phtml&username=" + neou.Text + "&password=" + neop.Text, "http://www.neopets.com/index.phtml");
strhtml = w.ResponseBody;
g("http://www.neopets.com/games/kadoatery/");
strhtml = w.ResponseBody;
}
if (strhtml.Contains("is very sad."))
{
gba(strhtml, "is very sad.", "/strong>", lsttemp);
for (int b = lstignore.Items.Count - 1; b >= 0; --b)
{
string removelistitem = lstignore.Items[b].ToString();
for (int i = lsttemp.Items.Count - 1; i >= 0; --i)
{
if (lsttemp.Items[i].ToString().Contains(removelistitem))
{
if (lsttemp.Items.Count > i) {
lsttemp.Items.RemoveAt(i);
}
}
}
}
for (int i = lsttemp.Items.Count - 1; i >= 0; --i)
{
lstitems.Items.Add(ExtractString(lsttemp.Items[i].ToString() + "meep", "<strong>", "<meep"));
lstids.Items.Add(ExtractString(lsttemp.Items[i].ToString(), "kad_id=", "\"><img"));
}
//End get kad info.
//Start Buy item
if (lstids.Items.Count > 0) {
lblkadstat.Text = "Found kad. Buying item";
buyitem = randomnum(0, lstitems.Items.Count - 1);
strhtml = strhtml = p("http://www.neopets.com/market.phtml", "type=process_wizard&feedset=0&shopwizard=" + lstitems.Items[buyitem].ToString() + "&table=shop&criteria=exact&min_price=0&max_price=" + txtspend.Text, "http://www.neopets.com/market.phtml?type=wizard");
strhtml = w.ResponseBody;
if (!strhtml.Contains("I did not find anything. :( Please try again and I will search elsewhere!"))
{
strtemp = ExtractString(strhtml, "bgcolor=\"#F6F6F6\"><a href=\"", "\"><b>");
strhtml = g("http://www.neopets.com" + strtemp);
strhtml = w.ResponseBody;
strhtml = g("http://www.neopets.com/buy_item.phtml?" + ExtractString(strhtml, "buy_item.phtml?", "\" onClick="), "http://www.neopets.com" + strtemp);
strhtml = w.ResponseBody;
strhtml = g("http://www.neopets.com/games/kadoatery/feed_kadoatie.phtml?kad_id=" + lstids.Items[buyitem].ToString(), "http://www.neopets.com/games/kadoatery/");
strhtml = w.ResponseBody;
//End Buy item
//Feed kad
if (strhtml.Contains("a very happy Kadoatie"))
{
lstlog.Items.Add("Fed kad " + lstitems.Items[buyitem].ToString());
lstlog.Items.Add("Waiting " +txtpause.Text + " minutes");
Thread.Sleep(Convert.ToInt32(txtpause.Text) * 60000);
}
}
else
{
lstignore.Items.Add(lstitems.Items[buyitem].ToString());
lstlog.Items.Add("Added " + lstitems.Items[buyitem].ToString() + " to ignore list");
}
lblkadstat.Text = "Pausing...";
Thread.Sleep(randomnum(Convert.ToInt32(txtmin.Text) * 1000, Convert.ToInt32(txtmax.Text) * 1000));
}
}
}
}