Beex, Yo.
YOU ARE NOT LOGGED IN!
MafiaScum Tools
Reply
Page 1 of 1 [ 50 posts ]
User avatar
For anyone who wishes to use it, attached to this post is the mafiascum vote counter tool. The compiled exe is in there and should require only .NET 2.0 to run. You may also need a copy of mshtml.dll to run it, which you can grab off the web if you don't have it. The only known compatibility issue is currently with XP64. Or possibly just with Grim...

It's simple to run - just put the thread number in the relevant box and hit 'Scan'. It'll take a minute or so to load up all the pages and generate the vote count. All threads will need to contain the list of players in the following format:

[playerlist]
player1
player2
player3
...
[/playerlist]

All votes will need to be in the format [vote:player1] to be counted.

Thanks to RichardGaywood for adding in the nolynch functionality.

The source code is also included - if anyone wants to make any modifications all I ask is that they provide it back to me afterwards so we keep a converged version of the app in this post. It's in VS2005 format.
User avatar
By thread number, do you just mean I or II or whatever? Or do you mean 1334, for day one of the current game?

I keep getting an error that I think is saying it can't find mshtml.dll, even though I've got it.
Hmm, the exe exceptions on mine with an "Index outside the bounds of the Array" error.

I'd need to install visual basic (seriously, VB? Is it 1995?) to debug :)
Aha, the error was me typoing the thread number.
User avatar
Dudley wrote:
Hmm, the exe exceptions on mine with an "Index outside the bounds of the Array" error.
That means it's running but not happy about the input. Is your thread number valid? Try 1334.
Hah, yeah I'd read it as 1344 :)

That could do with an error trap but I can't really sit here with VS closed whilst I add VB, I'll install later and have a poke at the code :)
User avatar
Dudley wrote:
I'll install later and have a poke at the code :)
Good, go hack some support in for an AsylumList of players who cannot vote can be voted for. I'd do it but Craster's string manipulation makes my head hurt.

Aside: someone buy Craster a copy of Regular Expression for Beginners :D
Oh god, I can't do regexs at all, I may not be your guy.

Maybe I can convince JamesOff to do it.
User avatar
Dudley wrote:
Oh god, I can't do regexs at all, I may not be your guy.
No no. It doesn't use regexps, is what I'm saying, just a lot of substring and indexof. I'd prefer it if it did use regexps :DD
Ah good, then this might be up my street :D
User avatar
I agree with the Gaywood. The sheer bulk of code here makes my head hurt, and not just because it's vb.
User avatar
Mr Dave wrote:
I agree with the Gaywood. The sheer bulk of code here makes my head hurt, and not just because it's vb.
You do badass assembler things! Surely this low level stuff is bread and butter to you? I just assumed it made my head hurt because I am a high level weenie.
VB described as low level.

That's a new one on me.
User avatar
Yeah, me too.
User avatar
Dudley wrote:
VB described as low level.
Hah. Well, quite, good point. Nevertheless I maintain that string parsing a HTML page with indexof and other similar <string.h> concepts is low level compared to regexps and other 20th century inventions.
Well that's going to suit my brain a lot more than the keyboard diarrhoea that is regexps.
User avatar
Quote:
If votes.ContainsKey(tags(count).Substring(tags(count).ToLower.IndexOf("[vote", 0) + 6, iNameEnd - tags(count).ToLower.IndexOf("[vote", 0) - 6).ToLower.Trim) Or tags(count).Substring(tags(count).ToLower.IndexOf("[vote", 0) + 6, iNameEnd -
tags(count).ToLower.IndexOf("[vote", 0) - 6).ToLower.Trim = "unvote" Then


I have been "office regexp guy" in two workplaces running now. Probably because I'm a former professional Perl programmer who keeps taking jobs in Microsoft shops.
Nothing confusing about that snippet.
User avatar
richardgaywood wrote:
Mr Dave wrote:
I agree with the Gaywood. The sheer bulk of code here makes my head hurt, and not just because it's vb.
You do badass assembler things! Surely this low level stuff is bread and butter to you? I just assumed it made my head hurt because I am a high level weenie.


Depends on what I'm doing. A website scraper such as that I'd have done in c# with a certain amount of regex.

Main code for games, I'd use c++ (With assembly if the optimisation in the compiler coughs). The thing about c++ is that the code then is all very information dense and neatly divided, and therefore easy to read. vb code is not dense, nor neatly divided, and so I find it really hard to read. Combine that with anything remotely complicated, and I can't find the willpower to read it. The same stuff in regular expressions would have been easy.

The upshot of this is that if I wanted to do anything to this (and there are a couple of things I would think of doing - a history function would be most handy, for example ), I'd pretty much have to rewrite the entire thing. (in c#)
User avatar
Alternatively, I could hack bits out of the code and chuck them together and make me a lovely history page.
User avatar
Quote:
Could not load file or assembly 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system could not find the file specified.


But I have an mshtml.dll file, version 7.0.6000.16674. I've installed Service Pack 3, run Windows Update and everything and I'm still getting exactly the same error.
A very quick and dirty hack for arkham players would be simply to add a little edit box for "# of confined players".
User avatar
I think I can get it working with an [asylumlist].
Also good.
User avatar
Right, I've uninstalled all the million different .Net framework installs listed on my PC. One wouldn't install, coming up with errors suspiciously similar to the one I was running the vote counter, but it disappeared from the list when I removed one of the other ones.

Um.

So now I'm getting a different error message when trying to run the vote counter (an exciting access violation) and I'm redownloading the .Net framework to see if I clean (or is it?) install will help.

Fun.
User avatar
And with the .Net framework completely reinstalled from scratch, I get the same old error again.

I think I may just have to rely on the kindness of players to do the vote counts during this game.

Sorry, but I can't think of anything else to try. A reformat and reinstall is out, as this is a work machine.
User avatar
The Rev Owen wrote:
By thread number, do you just mean I or II or whatever? Or do you mean 1334, for day one of the current game?

I keep getting an error that I think is saying it can't find mshtml.dll, even though I've got it.

Put the file in the same directory as the executable.

Also ensure you're logged into the forum via IE and select 'Remember Me' when logging in. I had similar issues.
User avatar
I've tried both of those things, I'm afraid.

I'm now downloading the whole .Net SDK, because that seems to have solved the problem for some people.
Weird, I'm quite happy to keep up with it though.
User avatar
Oooh! It seems to be working!

Not sure if it was installing the SDK or changing my setup so IE was the default browser. I should have tried one before the other, really.

Anyway, it now works! Hooray!

Now I have to hope it runs a bit more easily on my PC at home...
I don't have IE as default and it works fine fwiw.
User avatar
Dudley wrote:
I don't have IE as default and it works fine fwiw.


Yeah, I fixed that bug. Basically it was because guests couldn't view the MS forum, so if you didn't have an IE cookie logging you in, the app couldn't access the thread.

Also, If anyone can find a way to strip multiple versions of possibly multiple-layer nested tags from a string that can possibly contain malformed tags using a regex, I will give them a cookie.
User avatar
Getting the same error message that I got at work at home, so am downloading the full SDK again. Hope it works on this machine too.
User avatar
If it's an MSHTML error, try the following:

Drop the dll into both system32 and the directory the counter executable is in, and try again.

Run regsvr32 <path to mshtml.dll>\mshtml.dll and try again.
User avatar
Nope, only SDK install fixed it.
User avatar
Bizarro.
User avatar
.net was supposed to stop theis kind of dll hell.

Bah, I says.
User avatar
Not very tested, but seems okay:
http://www.beexcellenttoeachother.com/counter/?t=3427
t is the topic id, obv.
User avatar
Grim... wrote:
Not very tested, but seems okay:
http://www.beexcellenttoeachother.com/counter/?t=3427
t is the topic id, obv.
Good work. Suggest Curio puts this link in his sig.
User avatar
I think we should wait for this day to end, in case it doesn't tally.
Seems okay with all the older days, though. And you can have a space in your vote :)
User avatar
Grim... wrote:
I think we should wait for this day to end, in case it doesn't tally.
Seems okay with all the older days, though. And you can have a space in your vote :)
I'm running Craster's one here, and it agrees with that as of right now. I will continue to check both.
User avatar
Cheers for that, gents.
User avatar
Grim... wrote:
Not very tested, but seems okay:
http://www.beexcellenttoeachother.com/counter/?t=3427
t is the topic id, obv.


Nice.
User avatar
It's failed to pick up your unvote there Grim...
Good work though, very handy.
User avatar
It did, sir. I stopped voting for Malc, but Malc is still voting for me.
User avatar
The game would get dull fast if you could unvote people from you ;)
User avatar
We should probably lock all these non-game threads...
User avatar
Curiosity wrote:
We should probably lock all these non-game threads...
I've locked the signup thread. This one should probably stay though, if only so people can report bugs with the tools.
User avatar
I locked every thread apart from the game one when I was (Science - SkeptoEd). I am a tyrant, however.
User avatar
For my convenience...

http://www.beexcellenttoeachother.com/counter
Page 1 of 1 [ 50 posts ]
Reply


Active Topics