Be Excellent To Each Other

And, you know, party on. Dude.

All times are UTC [ DST ]




This topic is locked, you cannot edit posts or make further replies.  [ 50 posts ] 
Author Message
 Post subject: MafiaScum Tools
PostPosted: Tue Jul 15, 2008 13:11 
SupaMod
User avatar
Commander-in-Cheese

Joined: 30th Mar, 2008
Posts: 49244
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.


You do not have the required permissions to view the files attached to this post.

_________________
GoddessJasmine wrote:
Drunk, pulled Craster's pork, waiting for brdyime story,reading nuts. Xz


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 10:16 
User avatar
That Rev Chap

Joined: 31st Mar, 2008
Posts: 4924
Location: Kent
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.

_________________
InvertY


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 11:00 

Joined: 30th Mar, 2008
Posts: 8679
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 :)


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 11:01 

Joined: 30th Mar, 2008
Posts: 8679
Aha, the error was me typoing the thread number.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 11:01 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
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.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 11:04 

Joined: 30th Mar, 2008
Posts: 8679
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 :)


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 11:17 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
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


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 11:24 

Joined: 30th Mar, 2008
Posts: 8679
Oh god, I can't do regexs at all, I may not be your guy.

Maybe I can convince JamesOff to do it.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 11:26 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
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


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 11:28 

Joined: 30th Mar, 2008
Posts: 8679
Ah good, then this might be up my street :D


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 11:28 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17161
Location: Just Outside That London, England, Europe
I agree with the Gaywood. The sheer bulk of code here makes my head hurt, and not just because it's vb.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 11:35 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
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.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 11:41 

Joined: 30th Mar, 2008
Posts: 8679
VB described as low level.

That's a new one on me.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 11:43 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69720
Location: Your Mum
Yeah, me too.

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 11:45 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
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.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 11:48 

Joined: 30th Mar, 2008
Posts: 8679
Well that's going to suit my brain a lot more than the keyboard diarrhoea that is regexps.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 11:51 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
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.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 11:53 

Joined: 30th Mar, 2008
Posts: 8679
Nothing confusing about that snippet.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 12:14 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17161
Location: Just Outside That London, England, Europe
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#)


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 12:40 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17161
Location: Just Outside That London, England, Europe
Alternatively, I could hack bits out of the code and chuck them together and make me a lovely history page.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 12:41 
User avatar
That Rev Chap

Joined: 31st Mar, 2008
Posts: 4924
Location: Kent
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.

_________________
InvertY


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 12:44 

Joined: 30th Mar, 2008
Posts: 8679
A very quick and dirty hack for arkham players would be simply to add a little edit box for "# of confined players".


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 12:48 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
I think I can get it working with an [asylumlist].


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 12:48 

Joined: 30th Mar, 2008
Posts: 8679
Also good.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 13:35 
User avatar
That Rev Chap

Joined: 31st Mar, 2008
Posts: 4924
Location: Kent
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.

_________________
InvertY


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 14:03 
User avatar
That Rev Chap

Joined: 31st Mar, 2008
Posts: 4924
Location: Kent
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.

_________________
InvertY


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 15:35 
User avatar
Legendary Boogeyman

Joined: 22nd Dec, 2010
Posts: 8175
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.

_________________
Mr Kissyfur wrote:
Pretty much everyone agrees with Gnomes, really, it's just some are too right on to admit it. :)


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 15:38 
User avatar
That Rev Chap

Joined: 31st Mar, 2008
Posts: 4924
Location: Kent
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.

_________________
InvertY


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 15:43 

Joined: 30th Mar, 2008
Posts: 8679
Weird, I'm quite happy to keep up with it though.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 15:49 
User avatar
That Rev Chap

Joined: 31st Mar, 2008
Posts: 4924
Location: Kent
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...

_________________
InvertY


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 15:59 

Joined: 30th Mar, 2008
Posts: 8679
I don't have IE as default and it works fine fwiw.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 17:30 
SupaMod
User avatar
Commander-in-Cheese

Joined: 30th Mar, 2008
Posts: 49244
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.

_________________
GoddessJasmine wrote:
Drunk, pulled Craster's pork, waiting for brdyime story,reading nuts. Xz


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 18:05 
User avatar
That Rev Chap

Joined: 31st Mar, 2008
Posts: 4924
Location: Kent
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.

_________________
InvertY


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 18:44 
SupaMod
User avatar
Commander-in-Cheese

Joined: 30th Mar, 2008
Posts: 49244
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.

_________________
GoddessJasmine wrote:
Drunk, pulled Craster's pork, waiting for brdyime story,reading nuts. Xz


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 19:29 
User avatar
That Rev Chap

Joined: 31st Mar, 2008
Posts: 4924
Location: Kent
Nope, only SDK install fixed it.

_________________
InvertY


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 19:36 
SupaMod
User avatar
Commander-in-Cheese

Joined: 30th Mar, 2008
Posts: 49244
Bizarro.

_________________
GoddessJasmine wrote:
Drunk, pulled Craster's pork, waiting for brdyime story,reading nuts. Xz


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Jul 16, 2008 19:38 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17161
Location: Just Outside That London, England, Europe
.net was supposed to stop theis kind of dll hell.

Bah, I says.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Mon Mar 09, 2009 12:20 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69720
Location: Your Mum
Not very tested, but seems okay:
http://www.beexcellenttoeachother.com/counter/?t=3427
t is the topic id, obv.

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Mon Mar 09, 2009 12:22 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
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.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Mon Mar 09, 2009 12:24 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69720
Location: Your Mum
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 :)

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Mon Mar 09, 2009 12:24 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
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.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Mon Mar 09, 2009 12:30 
User avatar
Sleepyhead

Joined: 30th Mar, 2008
Posts: 27354
Location: Kidbrooke
Cheers for that, gents.

_________________
We are young despite the years
We are concern
We are hope, despite the times


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Mon Mar 09, 2009 12:38 
SupaMod
User avatar
Commander-in-Cheese

Joined: 30th Mar, 2008
Posts: 49244
Grim... wrote:
Not very tested, but seems okay:
http://www.beexcellenttoeachother.com/counter/?t=3427
t is the topic id, obv.


Nice.

_________________
GoddessJasmine wrote:
Drunk, pulled Craster's pork, waiting for brdyime story,reading nuts. Xz


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Mon Mar 09, 2009 12:39 
User avatar
baron of techno

Joined: 30th Mar, 2008
Posts: 24136
Location: fife
It's failed to pick up your unvote there Grim...
Good work though, very handy.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Mon Mar 09, 2009 12:42 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69720
Location: Your Mum
It did, sir. I stopped voting for Malc, but Malc is still voting for me.

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Mon Mar 09, 2009 12:43 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69720
Location: Your Mum
The game would get dull fast if you could unvote people from you ;)

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Mon Mar 09, 2009 12:43 
User avatar
Sleepyhead

Joined: 30th Mar, 2008
Posts: 27354
Location: Kidbrooke
We should probably lock all these non-game threads...

_________________
We are young despite the years
We are concern
We are hope, despite the times


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Mon Mar 09, 2009 12:45 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
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.


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Mon Mar 09, 2009 12:47 
User avatar
UltraMod

Joined: 27th Mar, 2008
Posts: 55719
Location: California
I locked every thread apart from the game one when I was (Science - SkeptoEd). I am a tyrant, however.

_________________
I am currently under construction.
Thank you for your patience.


Image


Top
 Profile  
 
 Post subject: Re: MafiaScum Tools
PostPosted: Wed Mar 11, 2009 8:58 
User avatar
Sleepyhead

Joined: 30th Mar, 2008
Posts: 27354
Location: Kidbrooke
For my convenience...

http://www.beexcellenttoeachother.com/counter

_________________
We are young despite the years
We are concern
We are hope, despite the times


Top
 Profile  
 
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.  [ 50 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search within this thread:
You are using the 'Ted' forum. Bill doesn't really exist any more. Bogus!
Want to help out with the hosting / advertising costs? That's very nice of you.
Are you on a mobile phone? Try http://beex.co.uk/m/
RIP, Owen. RIP, MrC. RIP, Dimmers.

Powered by a very Grim... version of phpBB © 2000, 2002, 2005, 2007 phpBB Group.