• What are you working on? December 2011 Edition
    3,353 replies, posted
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]
[IMG]http://dl.dropbox.com/u/27714141/CleverOmegle_owned.png[/IMG]
Happy new year, WAYWO
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.
[QUOTE=Chris220;33988510]Not Nyan Cat.[/QUOTE] Nyot 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] &#1085;&#1077;&#1082;&#1086;&#1096;&#1082;&#1072; (Edit: &#1085;&#1077; &#1082;&#1086;&#1096;&#1082;&#1072; translates to no cat)
[QUOTE=supersnail11;33989185]NyetCat[/QUOTE] NEIN CAT
Updated parse upon request and preparation for the new thread: [code]Programming King: 1 (x27): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33540826&viewfull=1#post33540826 2 (x27): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33952345&viewfull=1#post33952345 3 (x26): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33653065&viewfull=1#post33653065 4 (x26): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33948461&viewfull=1#post33948461 5 (x25): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33879227&viewfull=1#post33879227 6 (x16): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33931914&viewfull=1#post33931914 7 (x16): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33935197&viewfull=1#post33935197 8 (x14): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33581811&viewfull=1#post33581811 9 (x12): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33944822&viewfull=1#post33944822 10 (x12): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33944455&viewfull=1#post33944455 11 (x10): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33677469&viewfull=1#post33677469 12 (x10): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33683218&viewfull=1#post33683218 13 (x10): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33937786&viewfull=1#post33937786 14 (x9): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33953233&viewfull=1#post33953233 15 (x9): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33606364&viewfull=1#post33606364 16 (x9): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33980127&viewfull=1#post33980127 17 (x8): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33595807&viewfull=1#post33595807 18 (x8): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33924863&viewfull=1#post33924863 19 (x8): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33904441&viewfull=1#post33904441 20 (x8): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33836595&viewfull=1#post33836595 21 (x7): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33934132&viewfull=1#post33934132 22 (x7): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33965065&viewfull=1#post33965065 23 (x7): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33972604&viewfull=1#post33972604 24 (x7): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33658685&viewfull=1#post33658685 25 (x7): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33617641&viewfull=1#post33617641 Artistic: 1 (x39): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33684144&viewfull=1#post33684144 2 (x32): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33685077&viewfull=1#post33685077 3 (x28): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33807940&viewfull=1#post33807940 4 (x26): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33668214&viewfull=1#post33668214 5 (x26): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33569527&viewfull=1#post33569527 6 (x24): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33951408&viewfull=1#post33951408 7 (x22): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33607223&viewfull=1#post33607223 8 (x21): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33823064&viewfull=1#post33823064 9 (x20): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33551436&viewfull=1#post33551436 10 (x18): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33754997&viewfull=1#post33754997 11 (x16): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33546416&viewfull=1#post33546416 12 (x16): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33817161&viewfull=1#post33817161 13 (x15): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33539467&viewfull=1#post33539467 14 (x15): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33778044&viewfull=1#post33778044 15 (x15): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33878574&viewfull=1#post33878574 16 (x14): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33634327&viewfull=1#post33634327 17 (x14): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33961061&viewfull=1#post33961061 18 (x14): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33876605&viewfull=1#post33876605 19 (x13): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33840299&viewfull=1#post33840299 20 (x12): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33982256&viewfull=1#post33982256 21 (x12): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33739192&viewfull=1#post33739192 22 (x12): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33620950&viewfull=1#post33620950 23 (x12): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33686864&viewfull=1#post33686864 24 (x11): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33710323&viewfull=1#post33710323 25 (x11): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33895231&viewfull=1#post33895231 Winner: 1 (x74): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33694632&viewfull=1#post33694632 2 (x72): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33700775&viewfull=1#post33700775 3 (x47): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33551096&viewfull=1#post33551096 4 (x35): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33660292&viewfull=1#post33660292 5 (x34): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33614737&viewfull=1#post33614737 6 (x30): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33847598&viewfull=1#post33847598 7 (x28): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33704320&viewfull=1#post33704320 8 (x24): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33694595&viewfull=1#post33694595 9 (x23): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc407 4fe2&p=33919085&viewfull=1#post33919085 10 (x23): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33772731&viewfull=1#post33772731 11 (x22): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33598803&viewfull=1#post33598803 12 (x22): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33584500&viewfull=1#post33584500 13 (x21): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33681512&viewfull=1#post33681512 14 (x20): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33802640&viewfull=1#post33802640 15 (x20): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33928275&viewfull=1#post33928275 16 (x18): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33966505&viewfull=1#post33966505 17 (x16): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33692408&viewfull=1#post33692408 18 (x16): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33688632&viewfull=1#post33688632 19 (x15): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33694450&viewfull=1#post33694450 20 (x15): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33964539&viewfull=1#post33964539 21 (x15): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33975131&viewfull=1#post33975131 22 (x15): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33751010&viewfull=1#post33751010 23 (x15): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33867125&viewfull=1#post33867125 24 (x14): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33977983&viewfull=1#post33977983 25 (x14): http://www.facepunch.com/threads/1144771?s=490a6871c62e32159c1d8a1cc40 74fe2&p=33619368&viewfull=1#post33619368 [/code]
[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.