Automated vote counting
- callforjudgement
-
callforjudgement Microprocessor
- callforjudgement
- Microprocessor
- Microprocessor
- Posts: 3972
- Joined: September 1, 2011
Automated vote counting
So, some people have been noticing my vote counts (in my recently concluded Mini Normal, and in mykonian's 50-player game). I had something of an ulterior motive in offering to help mykonian with the vote counts; I wanted to test a semi-automated vote counting script I've been working on. (I use it in Firefox with the Greasemonkey extension; I haven't tested it in Chrome, but theoretically it should work there too.)
Writing a vote counter for mafiascum.net is awkward in some ways. People don't use a consistent format for voting, and frequently abbreviate or misspell player names. As such, this script just looks for comments that look like they contain a vote (the word "vote", possibly as part of another vote, bolded), and draws the mod's attention to them; it's up to the mod to decide which player it's a vote for, or whether it's a false alarm, or an unvote or vote for No Lynch. (There's also an option to reset all the vote counts at a post, which is typically useful on the last vote before a lynch because lynches reset votes in most games, or on the vote count after a lynch if it's incorrectly detected as a vote.)
After installing it, every thread in the Mafia forums will have a new option, "Vote counter settings", to the right of the search box. You can enable the vote counter for a thread by putting the player list into the text box that appears when you click on it; note that the spelling and capitalisation of players' names has to be exactly right for it to work (this was responsible for most of my early mistakes in mykonian's game). When a player is replaced or died, you can use the settings box to inform the vote counter of the fact (it's explained above the settings box), but must not reorder the list. (If a player is replaced, any votes by or for them get shifted onto the replacing player; if a player dies, their votes no longer count and votes for them count as not voting.) If you empty the settings box entirely, the vote counter will completely forget everything it ever knew about the game and free up the disk space and memory it was using to store the information.
Once the vote counter's been enabled, every post that it thinks contains a vote will gain a dropdown box so that you can explain who the post is voting for (and a cyan background around the vote to make it easier to spot). Additionally, every post will gain a "(count votes to here)" link next to the post number; if you've missed any posts (either because you've never opened them in your browser – which is easier to do than it sounds – or because you didn't tell the vote counter who the post was voting for), it'll tell you, and otherwise it'll give you the BBcode for a votecount (in a popup you can copy-and-paste it from), complete with links to the posts that contained each vote. (I may be able to extend it with a "vote count history" or something like that if people are interested.) The vote count will only contain the actual vote-related information; I edited deadline information into the posts in my game by hand, but that's typically just a matter of copy-and-paste except for the first votecount of a day.
Anyway, now that I've tested it, I'm opening it up for everyone to use. Feedback/comments/suggestions would be welcome, as usual. Let me know what you think!scum· scam · seam · team · term · tern · torn ·town- DCLXVI
-
DCLXVI Mafia Scum
- DCLXVI
- Mafia Scum
- Mafia Scum
- Posts: 3461
- Joined: March 8, 2012
- Location: Somewhere in the central timezone
- maxwell
-
maxwell Mafia Scum
- maxwell
- Mafia Scum
- Mafia Scum
- Posts: 1009
- Joined: August 22, 2011
- Timeater
-
Timeater Mafia Scum
- Timeater
- Mafia Scum
- Mafia Scum
- Posts: 4334
- Joined: July 10, 2008
- Location: Tucson
- Contact:
- mykonian
-
mykonian Frisian Shoulder-Demon
- mykonian
- Frisian Shoulder-Demon
- Frisian Shoulder-Demon
- Posts: 11963
- Joined: August 27, 2008
- Hoopla
-
Hoopla
- Hoopla
- Posts: 10788
- Joined: October 12, 2008
In post 0, callforjudgement wrote:As such, this script just looks for comments that look like they contain a vote (the word "vote", possibly as part of another vote, bolded), and draws the mod's attention to them; it's up to the mod to decide which player it's a vote for, or whether it's a false alarm, or an unvote or vote for No Lynch.
How is that saving time on looking through your game thread to find anything bolded and determine it's a vote? You still need to scan every post manually anyway (for players requesting prods/replacement or asking a question), so presumably if you're reading your game, you shouldn't miss a vote.
How does it handle double voters?- Psyche
-
Psyche he/theySurvivor
- Psyche
he/they- Survivor
- Survivor
- Posts: 10559
- Joined: April 28, 2011
- Pronoun: he/they
- Captain Haddock
-
Captain Haddock Goon
- Captain Haddock
- Goon
- Goon
- Posts: 107
- Joined: January 31, 2012
This sounds great.
Once the vote counter's been enabled, every post that it thinks contains a vote will gain a dropdown box so thatyoucan explain who the post is voting for (and a cyan background around the vote to make it easier to spot).
By 'you' do you mean the person making the post? If so that's awesome, but would being able to tell the vote counter you've voted the wrong person be a problem?
I'm interested in what fake voting will be possible with this. I don't like the idea of tricking someone with formatting but I think fakehammering someone you've already voted is legit and that won't work anymore if people use the vote counter to see if someone's been hammered. I suppose that will be a neccessary sacrifice.
I think a thread demonstrating how this works is a good idea."If you don't want a doubled chance of being vanillarised lynch me or Deasvail"- Me. Who knew powering up scum was a valid tactic?- chamber
-
chamber Cases are scummy
- chamber
- Cases are scummy
- Cases are scummy
- Posts: 10703
- Joined: November 20, 2005
In post 7, Captain Haddock wrote:This sounds great.
Once the vote counter's been enabled, every post that it thinks contains a vote will gain a dropdown box so thatyoucan explain who the post is voting for (and a cyan background around the vote to make it easier to spot).
By 'you' do you mean the person making the post? If so that's awesome, but would being able to tell the vote counter you've voted the wrong person be a problem?
I'm interested in what fake voting will be possible with this. I don't like the idea of tricking someone with formatting but I think fakehammering someone you've already voted is legit and that won't work anymore if people use the vote counter to see if someone's been hammered. I suppose that will be a neccessary sacrifice.
I think a thread demonstrating how this works is a good idea.
He means the person running the script.Taking a break from the site.- callforjudgement
-
callforjudgement Microprocessor
- callforjudgement
- Microprocessor
- Microprocessor
- Posts: 3972
- Joined: September 1, 2011
In post 5, Hoopla wrote:How is that saving time on looking through your game thread to find anything bolded and determine it's a vote? You still need to scan every post manually anyway (for players requesting prods/replacement or asking a question), so presumably if you're reading your game, you shouldn't miss a vote.
At least in mykonian's game, it was surprisingly common for me to miss a post with a vote in. (Questions are easier to notice.) Perhaps I'm just a particularly inattentive mod, but if so, this will still be useful for people like me. (Also, in my game, someone tried to vote in a spoiler tag; I didn't notice, the script did. Then I marked it as "not a vote" and publicly mocked them for doing that.)
It also avoids all the common problems along the lines of adding a vote but failing to remove the old vote, or putting two entries for the same person on the vote count.
How does it handle double voters?
At the moment, it doesn't, but nothing prevents you editing the votecount by hand to change the counts. I could implement a double-vote thing if there's enough demand.scum· scam · seam · team · term · tern · torn ·town- gorckat
-
gorckat Mafia Scum
- gorckat
- Mafia Scum
- Mafia Scum
- Posts: 2830
- Joined: January 17, 2007
- Location: Bawlmer, Hon!
- callforjudgement
-
callforjudgement Microprocessor
- callforjudgement
- Microprocessor
- Microprocessor
- Posts: 3972
- Joined: September 1, 2011
It definitely could be modified into a fully automated counter, but it would seem very unfair on the players to say "your vote wasn't counted because you didn't spell the name of the person you were voting for quite right", or whatever. And it'd bring the whole trick-votes debate all over again. I tend to be quite flexible as a mod in terms of what I accept, and so the vote counter reflects that.
(And the "#vote" format should be obsolete nowadays, now that we have VOTE: tags, which would be a much more sensible thing to require the use of if you're going to require anything.)scum· scam · seam · team · term · tern · torn ·town- Magister Ludi
-
Magister Ludi Mafia Scum
- Magister Ludi
- Mafia Scum
- Mafia Scum
- Posts: 3258
- Joined: April 7, 2011
- Location: San Francisco
- saulres
-
saulres Mafia Scum
- saulres
- Mafia Scum
- Mafia Scum
- Posts: 4173
- Joined: July 25, 2011
Request: Could you modify the code so it doesn't flag every one of the mod's posts that has "Vote Count" in it?
And holy crap that is cool!"SAULRES you are THE man! Fav mod eva, no contest!" - Bert; "Saulres is a fantastic mod, if he is running a game everyone needs to join it." - FuDuzn
Nominated for Paperback Writer Scummie 2013 and 2014!
On permanentV/LAFriday afternoons through Saturday nights.- callforjudgement
-
callforjudgement Microprocessor
- callforjudgement
- Microprocessor
- Microprocessor
- Posts: 3972
- Joined: September 1, 2011
In post 13, saulres wrote:Request: Could you modify the code so it doesn't flag every one of the mod's posts that has "Vote Count" in it?
And holy crap that is cool!
It'll only trigger on "vote count" if it's bolded; there's no trivial fix to avoid mod posts, although I guess I could avoid triggering on bolded text that only contained "vote" immediately before "count".scum· scam · seam · team · term · tern · torn ·town- Mr. Flay
-
Mr. Flay Metatron
- Mr. Flay
- Metatron
- Metatron
- Posts: 24969
- Joined: March 12, 2004
- Location: Gormenghast
- Contact:
- saulres
-
saulres Mafia Scum
- saulres
- Mafia Scum
- Mafia Scum
- Posts: 4173
- Joined: July 25, 2011
In post 14, callforjudgement wrote:there's no trivial fix to avoid mod posts
It should be, though, shouldn't it? If I had more time I'd do it for you. Maybe tomorrow. But the gist would be:
Add a <MOD option similar to the <DEAD one to the "player" list
Then wrap anif uNames[ui] == "MOD"around the "// Look for votes in the post." logic."SAULRES you are THE man! Fav mod eva, no contest!" - Bert; "Saulres is a fantastic mod, if he is running a game everyone needs to join it." - FuDuzn
Nominated for Paperback Writer Scummie 2013 and 2014!
On permanentV/LAFriday afternoons through Saturday nights.- Junpei
-
Junpei Jack of All Trades
- Junpei
- Jack of All Trades
- Jack of All Trades
- Posts: 5226
- Joined: June 24, 2011
I'd be willing to use this in my up comign mininormal as well if you put in a doublevoter and voteblocking mechanics to offer completeness.
Super cool though man nice work.- GreyICE
-
GreyICE Fifty Shades
- GreyICE
- Fifty Shades
- Fifty Shades
- Posts: 15455
- Joined: December 15, 2010
Well it's impossible to use in existing games, and it should give you an option with a checkbox to ignore unprocessed votes (with a warning that this might make vote counts inaccurate).ShowThat which is done out of love always takes place beyond good and evil
Official Visigoth
Read Mother Jones- saulres
-
saulres Mafia Scum
- saulres
- Mafia Scum
- Mafia Scum
- Posts: 4173
- Joined: July 25, 2011
In post 16, saulres wrote:Then wrap an if uNames[ui] == "MOD" around the "// Look for votes in the post." logic.
Oh I see now why that won't work.
Working on it."SAULRES you are THE man! Fav mod eva, no contest!" - Bert; "Saulres is a fantastic mod, if he is running a game everyone needs to join it." - FuDuzn
Nominated for Paperback Writer Scummie 2013 and 2014!
On permanentV/LAFriday afternoons through Saturday nights.- saulres
-
saulres Mafia Scum
- saulres
- Mafia Scum
- Mafia Scum
- Posts: 4173
- Joined: July 25, 2011
Okay, got it working. Except one line isn't making sense to me. I'll PM you the code and the line question."SAULRES you are THE man! Fav mod eva, no contest!" - Bert; "Saulres is a fantastic mod, if he is running a game everyone needs to join it." - FuDuzn
Nominated for Paperback Writer Scummie 2013 and 2014!
On permanentV/LAFriday afternoons through Saturday nights.- saulres
-
saulres Mafia Scum
- saulres
- Mafia Scum
- Mafia Scum
- Posts: 4173
- Joined: July 25, 2011
Oh whoops. Didn't fully test.
I got as far as restricting the dropdowns from appearing on the mod's posts, but that seems to have broken the count. I don't have more time for this now.
But I've sent you the code so you can see what I did, and hopefully your familiarity with the original source will help you troubleshoot that."SAULRES you are THE man! Fav mod eva, no contest!" - Bert; "Saulres is a fantastic mod, if he is running a game everyone needs to join it." - FuDuzn
Nominated for Paperback Writer Scummie 2013 and 2014!
On permanentV/LAFriday afternoons through Saturday nights.- saulres
-
saulres Mafia Scum
- saulres
- Mafia Scum
- Mafia Scum
- Posts: 4173
- Joined: July 25, 2011
I don't know why I keep updating this thread when all that's necessary is to make sure the PM to CFJ is right.
I think I've got it fully functional, will hold further conversation to PMs."SAULRES you are THE man! Fav mod eva, no contest!" - Bert; "Saulres is a fantastic mod, if he is running a game everyone needs to join it." - FuDuzn
Nominated for Paperback Writer Scummie 2013 and 2014!
On permanentV/LAFriday afternoons through Saturday nights.- callforjudgement
-
callforjudgement Microprocessor
- callforjudgement
- Microprocessor
- Microprocessor
- Posts: 3972
- Joined: September 1, 2011
OK, I've updated the script (same URL).
New features include:
- You can add the moderator to the list of players, marked as a mod ("<MOD"); this causes any of their posts to be assumed to not contain votes by default, although you can override this (say, to "reset vote count") if you want to (this is based on saulres' code, but with several bugs fixed, including one very serious one);
- You can mark players as doublevoters or nonvoters using "<2" or "<0" respectively; this will make no visible change except to the total number of votes at the start of each line;
- If the script is very sure that a particular comment is for a particular vote or unvote, it will automatically default to that (the player name needs to be spelled exactly right, although case doesn't matter, and be in a standard format like vote: callforjudgement,unvote, vote callforjudgementor VOTE: callforjudgement), so that in the obvious cases, the mod won't have to do the quality check (the quality check is still required in the case that the player misspells or abbreviates the name, though, or uses an unusual format).
scum· scam · seam · team · term · tern · torn ·town- saulres
-
saulres Mafia Scum
- saulres
- Mafia Scum
- Mafia Scum
- Posts: 4173
- Joined: July 25, 2011
In post 23, callforjudgement wrote:one very serious one
Ouch
PM me with what it was?
(Told'ja I didn't fully test it.)"SAULRES you are THE man! Fav mod eva, no contest!" - Bert; "Saulres is a fantastic mod, if he is running a game everyone needs to join it." - FuDuzn
Nominated for Paperback Writer Scummie 2013 and 2014!
On permanentV/LAFriday afternoons through Saturday nights. - saulres
Copyright © MafiaScum. All rights reserved.
- callforjudgement
- saulres
- saulres
- saulres
- saulres
- GreyICE
- Junpei
- saulres
- Mr. Flay
- callforjudgement
- saulres
- Magister Ludi
- callforjudgement
- gorckat
- callforjudgement
- chamber
- Captain Haddock
- Psyche
- Hoopla
- mykonian
- Timeater
- maxwell
- DCLXVI
- callforjudgement