PDA

View Full Version : [C#] Kad feeder



Josh
07-13-2013, 03:22 AM
public void feeder()
{

while (kadstart == true)
{


//Start Get kad info. Remove ignore items
clearvalues();
lblkadstat.Text = "Refreshing...";
strhtml = g("[Only registered and activated users can see links]");

if(strhtml.Contains("href=\"/login/index.phtml\">Sign up</a>")){

strhtml = strhtml = p("[Only registered and activated users can see links]", "destination=%252Findex.phtml&username=" + neou.Text + "&password=" + neop.Text, "[Only registered and activated users can see links]");
strhtml = w.ResponseBody;
g("[Only registered and activated users can see links]");
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("[Only registered and activated users can see links]", "type=process_wizard&feedset=0&shopwizard=" + lstitems.Items[buyitem].ToString() + "&table=shop&criteria=exact&min_price=0&max_price=" + txtspend.Text, "[Only registered and activated users can see links]");
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("[Only registered and activated users can see links]" + strtemp);
strhtml = w.ResponseBody;

strhtml = g("[Only registered and activated users can see links]" + ExtractString(strhtml, "buy_item.phtml?", "\" onClick="), "[Only registered and activated users can see links]" + strtemp);
strhtml = w.ResponseBody;
strhtml = g("[Only registered and activated users can see links]" + lstids.Items[buyitem].ToString(), "[Only registered and activated users can see links]");
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));

}

}

}

}

Leah
07-13-2013, 11:57 AM
Your Kad feeder is the best thing ever. :)

j03
07-13-2013, 12:28 PM
@Josh21227 ([Only registered and activated users can see links]) you should randomize the kads after you extract them and then search for the items, that way you look like a legitimate feeder

WeepingAngel it could be better ;)

Zachafer
07-13-2013, 01:41 PM
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);
}
}
}


The second if statement is redundant. lsttemp.Items.Count will always be > i since your for loop starts: int i = lsttemp.Items.Count - 1 and decrements from there.

Josh
07-13-2013, 02:19 PM
@Josh21227 ([Only registered and activated users can see links]) you should randomize the kads after you extract them and then search for the items, that way you look like a legitimate feeder


:p Already did.

buyitem = randomnum(0, lstitems.Items.Count - 1);



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);
}
}
}


The second if statement is redundant. lsttemp.Items.Count will always be > i since your for loop starts: int i = lsttemp.Items.Count - 1 and decrements from there.

o.o Oops. Lol.

j03
07-13-2013, 02:50 PM
:p Already did.

buyitem = randomnum(0, lstitems.Items.Count - 1);


You should randomize the array before you get to the buy item part. That way if it fails, it won't have a chance at trying to buy the same failed item again.

Zachafer
07-13-2013, 03:03 PM
.NET 3.5 (LINQ):


string[] randItems = arrItems.OrderBy(x => rnd.Next()).ToArray();Where rnd is a System.Random() object

kandikid
12-28-2013, 03:41 PM
How do you download this kad feeder I wanna try :)

fairydust201
01-08-2014, 10:58 PM
How do you download this kad feeder I wanna try :)


[Only registered and activated users can see links]

:) click on download it's open to the public

the top is just a code . he's making a new one i beleave .