Man, I can't believe I started working on this last year and only finished it now.. :v:
[csharp]/// <summary>Refreshes the bot list.</summary>
private void refreshBotList()
{
string list_url = "http://www.pandorabots.com/botmaster/en/mostactive";
ClearList();
HtmlAgilityPack.HtmlWeb web = new HtmlAgilityPack.HtmlWeb();
HtmlAgilityPack.HtmlDocument doc = null;
string error = null;
do {
try { doc = web.Load(list_url); }
catch (HtmlWebException ex) {
error = String.Format("Could not connect to Pandora Bots{0}\n{1}",
(String.IsNullOrEmpty(error) ? "." : ":"), ex.Message);
}
} while (doc == null &&
MessageBox.Show(error, "Network error",
MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning) == DialogResult.Retry);
int nbots = 0;
if (doc != null)
{
HtmlNodeCollection links = doc.DocumentNode.SelectNodes("//td/a[@href]");
if (links != null) foreach (HtmlNode link in links)
{
HtmlAttribute att = link.Attributes["href"];
Match match = Regex.Match(att.Value, @"\?botid=(?<id>[\d\w]+)$");
if (!match.Success)
continue;
nbots++;
string botId = match.Groups["id"].Value;
string botName = link.InnerText.Trim();
string interactions = link.SelectNodes("following::text()")
.First(x => Regex.IsMatch(x.InnerText, "^[\\d\\w]+$")).InnerText;
AddBot("popular", botName, botId, interactions);
}
}
if (nbots == 0)
AddBot("popular", "List not available.");
if (CustomBots != null)
foreach (PandoraBotRecord bot in CustomBots)
AddBot("custom", bot.Name, bot.Id);
else
AddBot("custom", "None added.");
}[/csharp]
Now it works using XPath, not much of a difference for the end result though.
Happy new year everyone.
It's not even the new year for me yet. Will be in six hours :v:
Nine hours :v: :v:
VVVVVV Map Renderer, using a crude regex hack to read the (XML) level files.
[URL="http://willkirkby.me/uploads/misc/vvvvvv_maps/4kvvvv.vvvvvv.png"]"VVVV 4k" (by Notch)[/URL]
I've been making a roguelike in Java for a few days, though it does not have anything directly related to roguelikes at the moment.
[IMG]http://www.1337upload.net/files/s_2012-01-01_02.12.07.png[/IMG]
Staying home on new years. Feels good man.
[QUOTE=bobthe2lol;33987490]Staying home on new years. Feels good man.[/QUOTE]
Like a true nerd I saw in the new year by playing Audiosurf to get a Steam gift pile objective :v:
Instead of porting my Java app to C# because Visual C# Express, I shall post screens of it!
[IMG]http://i.imgur.com/GKPxb.png[/IMG]
[I]inb4 hate because i suck at design and programming[/I]
What was that formula that, given a time variable would cycle through all (or most) of the colors?
[QUOTE=iffamies;33987552]Instead of porting my Java app to C# because Visual C# Express, I shall post screens of it!
[IMG]http://i.imgur.com/GKPxb.png[/IMG]
[I]inb4 hate because i suck at design and programming[/I][/QUOTE]
It looks just fine.
[I]but it would look better in C#[/I]
Cycling through all the colours could be done by incrementing a 32-bit integer
[QUOTE=esalaka;33987970]Cycling through all the colours could be done by incrementing a 32-bit integer[/QUOTE]
How? I mean the colors at the edge of the color wheel, as if it were spinning. I just want a trippy color change effect.
[QUOTE=bobthe2lol;33987815]What was that formula that, given a time variable would cycle through all (or most) of the colors?[/QUOTE]
I don't know what formula you may have seen in the past, but I would personally just use a HSV function with (max_time / time) as hue.
Well, if RGBA would be 0xRRGGBBAA, you'd simply multiply time by 0x100 and add 0xff
That is, [cpp]rgba = 0x100 * time + 0xff[/cpp]
And then you would take the RGB components separately or draw pixels with this colour or whatever
[editline]1st January 2012[/editline]
HSV would be the better idea though
Happy new year, now release Love v0.8
Oh, and the January 2012 Editions
[QUOTE=bobthe2lol;33987815]What was that formula that, given a time variable would cycle through all (or most) of the colors?[/QUOTE]
I consider this is an ugly hack, but it's simple and it works:
[csharp]float h = (float)(gameTime.TotalGameTime.Milliseconds % 360) / 60.0f;
float c = 1.0f;
float x = c * (1 - Math.Abs((h % 2) - 1));
if (h < 1.0f) rainbow = new Color(c, x, 0.0f);
else if (h < 2.0f) rainbow = new Color(x, c, 0.0f);
else if (h < 3.0f) rainbow = new Color(0.0f, c, x);
else if (h < 4.0f) rainbow = new Color(0.0f, x, c);
else if (h < 5.0f) rainbow = new Color(x, 0.0f, c);
else if (h < 6.0f) rainbow = new Color(c, 0.0f, x);[/csharp]
Copy/pasta'd from the Nyan Cat game I made :v:
[editline]1st January 2012[/editline]
I'm aware that a lot of that code is redundant, I left it like that for modification later on.
[QUOTE=Chris220;33988258]I consider this is an ugly hack, but it's simple and it works:
[csharp]float h = (float)(gameTime.TotalGameTime.Milliseconds % 360) / 60.0f;
float c = 1.0f;
float x = c * (1 - Math.Abs((h % 2) - 1));
if (h < 1.0f) rainbow = new Color(c, x, 0.0f);
else if (h < 2.0f) rainbow = new Color(x, c, 0.0f);
else if (h < 3.0f) rainbow = new Color(0.0f, c, x);
else if (h < 4.0f) rainbow = new Color(0.0f, x, c);
else if (h < 5.0f) rainbow = new Color(x, 0.0f, c);
else if (h < 6.0f) rainbow = new Color(c, 0.0f, x);[/csharp]
Copy/pasta'd from the Nyan Cat game I made :v:
[editline]1st January 2012[/editline]
I'm aware that a lot of that code is redundant, I left it like that for modification later on.[/QUOTE]
Are we thinking about the same game? The one where something chases you and you shit rainbow, with awful controls?
[QUOTE=iffamies;33988324]Are we thinking about the same game? The one where something chases you and you shit rainbow, with awful controls?[/QUOTE]
The one I posted on page 2 or 3 or whatever it was of this thread.
Sounds like what you describe, but how are the controls awful? It's just arrow keys :v:
[QUOTE=iffamies;33988324]Are we thinking about the same game? The one where something chases you and you shit rainbow, with awful controls?[/QUOTE]
Nyan Cat: The Game?
[QUOTE=Darkwater124;33988411]Nyan Cat: The Game?[/QUOTE]
Not Nyan Cat.
[IMG]http://img.44paths.com/images/32517614865544502544.png[/IMG]
Just adding a few new features and making a few changes to my rtmpdump GUI.
[QUOTE=Lexic;33988627]Nyot Cat[/QUOTE]
NyetCat
[QUOTE=supersnail11;33989185]NyetCat[/QUOTE]
некошка
(Edit: не кошка translates to no cat)
[QUOTE=voodooattack;33990144]NEIN CAT[/QUOTE]
Had to YouTube it.
[video=youtube;S1-rqpCL1Ss]http://www.youtube.com/watch?v=S1-rqpCL1Ss[/video]
Too bad its completely monotoned...
Btw, this should stop now. Epic derailing.
Also, I have a feeling this is a banpost, but its 4 AM and Im on a fucking 4-day Lan party so I cant fucking think straight.
Happy new year, everyone. New thread is [url=http://www.facepunch.com/threads/1151723]here.[/url]
Sorry, you need to Log In to post a reply to this thread.