Thought i'd release the main function for my auction sniper program Full program: (you need an account to see links)
It's very basic and only does the min increment but feel free to add any other features you want and upload it as your own, enjoy
Code:
public static void display()
{
string strhtml;
bool auctionClosed=false;
string currentText="a";
string postData;
Console.WriteLine("at auctions page");
strhtml = Account.Get("http://www.neopets.com/auctions.phtml?type=bids&auction_id=" + id, "http://www.neopets.com/auctions.phtml");
postData = GetBetween(strhtml, "name=\"_ref_ck\" value=\"", "\"><INPUT type=\"text\" na");
while (auctionClosed == false)
{
strhtml = Account.Get("http://www.neopets.com/auctions.phtml?type=bids&auction_id=" + id, "http://www.neopets.com/auctions.phtml?type=bids&auction_id=" + id);
currentText = GetBetween(strhtml, "name=\"amount\" value=\"", "\" si");
Console.WriteLine("Pausing for " + timeDelay + " seconds");
Thread.Sleep(timeDelay*1000);
Console.WriteLine("current bid = " + currentText);
strhtml = Account.Post("http://www.neopets.com/auctions.phtml?type=placebid", "auction_id=" + id + "&_ref_ck=" + postData + "&amount=" + currentText, "http://www.neopets.com/auctions.phtml?type=bids&auction_id=" + id);
Account.Get("http://www.neopets.com/auctions.phtml?type=bids&auction_id=" + id, "http://www.neopets.com/auctions.phtml?type=placebid");
if (strhtml.Contains("BID SUCCESSFUL"))
{
Console.WriteLine("Sucessful bid, refreshing bid list!");
auctionClosed = false;
}
else if (strhtml.Contains("are safe"))
{
Console.WriteLine("Items are safe message, refreshing!");
auctionClosed = false;
}
else if (strhtml.Contains("Sorry, you are not allowed to"))
{
Console.WriteLine("You are top bid, refreshing");
auctionClosed = false;
}
else if (strhtml.Contains("You must wait a few more seconds"))
{
Console.WriteLine("Need to wait, trying again!");
auctionClosed = false;
}
else if (strhtml.Contains("The current asking price for this item"))
{
Console.WriteLine("Bid unsuccesful, trying again!");
auctionClosed = false;
}
else if (strhtml.Contains("You don't have enough money"))
{
Console.WriteLine("You don't have enough on hand to bid on this auction, ending bidding!");
Console.ReadKey();
auctionClosed = true;
}
else if (strhtml.Contains("losed"))
{
Console.WriteLine("Auction closed");
strhtml = Account.Get("http://www.neopets.com/auctions.phtml?type=bids&auction_id=" + id, "http://www.neopets.com/auctions.phtml?type=placebid");
if (strhtml.Contains("<B>When?</B></TD></TR><TR><TD align=\"center\"><A href=\"randomfriend.phtml?user=" + user))
{
Console.WriteLine("Auction won!");
Console.ReadKey();
auctionClosed = true;
}
else
{
Console.WriteLine("Sorry, you didn't win this time!");
Console.ReadKey();
auctionClosed = true;
}
}
else
{
Console.WriteLine("Unknown error, please restart the program!");
Console.ReadKey();
auctionClosed = true;
}
}
}