The Count-Counter 2000

This forum is for discussion related to the game.
User avatar
Norinel
Norinel
Not Voting (3)
User avatar
User avatar
Norinel
Not Voting (3)
Not Voting (3)
Posts: 1684
Joined: March 2, 2003
Location: My computer

The Count-Counter 2000

Post Post #0 (ISO) » Wed Jul 14, 2004 5:37 am

Post by Norinel »

A discussion on chat long ago about modhelpers inspired me to make something that'd do vote counts, since they seem to be quite confusing in chat games and can take a little while in large forum games. So I made this (Editted to correct link), showed it around a little, forgot about it, went away for a week, and got reminded again by the bumping of the role distributor thread.

I might change the name, but it'll always be cooler than "Mafia Scum Tools". Feel free to give names, designs, bugs, features, accolades, etc.
Last edited by Norinel on Thu Mar 30, 2006 6:34 am, edited 1 time in total.
Corsato
Corsato
Goon
Corsato
Goon
Goon
Posts: 856
Joined: April 1, 2002
Location: Spijkenisse

Post Post #1 (ISO) » Wed Jul 14, 2004 9:43 am

Post by Corsato »

The page cannot be found
:(
User avatar
Norinel
Norinel
Not Voting (3)
User avatar
User avatar
Norinel
Not Voting (3)
Not Voting (3)
Posts: 1684
Joined: March 2, 2003
Location: My computer

Post Post #2 (ISO) » Wed Jul 14, 2004 10:06 am

Post by Norinel »

Works for me... try this, (Editted to fix link) if you still have problems.
Last edited by Norinel on Thu Mar 30, 2006 6:35 am, edited 1 time in total.
User avatar
mathcam
mathcam
Captain Observant
User avatar
User avatar
mathcam
Captain Observant
Captain Observant
Posts: 6116
Joined: November 22, 2002

Post Post #3 (ISO) » Thu Jul 15, 2004 3:35 am

Post by mathcam »

Hey, cool. That's exactly how I format my vote counts.

Cam
User avatar
mathcam
mathcam
Captain Observant
User avatar
User avatar
mathcam
Captain Observant
Captain Observant
Posts: 6116
Joined: November 22, 2002

Post Post #4 (ISO) » Thu Jul 15, 2004 3:35 am

Post by mathcam »

Oh, that's not true. I leave off the dash after the votee's name. But it's close.

Cam
User avatar
Norinel
Norinel
Not Voting (3)
User avatar
User avatar
Norinel
Not Voting (3)
Not Voting (3)
Posts: 1684
Joined: March 2, 2003
Location: My computer

Post Post #5 (ISO) » Thu Jul 15, 2004 3:53 am

Post by Norinel »

I modelled it after an exhaustive study of common vote count styles and reactions to them to determine the style appealing to both players and mods alike, which happens to be what I already use.
User avatar
Flying Dutchman
Flying Dutchman
I never think
User avatar
User avatar
Flying Dutchman
I never think
I never think
Posts: 1941
Joined: November 21, 2003
Location: The land of clogs, tulips, mills, and cheese!

Post Post #6 (ISO) » Fri Jul 16, 2004 8:00 am

Post by Flying Dutchman »

It rocks!! :D

Improvement suggestion: Get drop down boxes for formatting:
Voted person name in: bold/italic/italic bold/normal
Voting persons names in: italic/normal
Person with the most votes: red/underlined/voted person
Corsato
Corsato
Goon
Corsato
Goon
Goon
Posts: 856
Joined: April 1, 2002
Location: Spijkenisse

Post Post #7 (ISO) » Sun Jul 18, 2004 7:00 pm

Post by Corsato »

Your second link worked....somehow I cannot get to the "/stuff/cc2k" part on the first link.

I like your tool, it makes counting votes easy.
User avatar
Wacky
Wacky
Goon
User avatar
User avatar
Wacky
Goon
Goon
Posts: 866
Joined: July 16, 2003
Location: Sydney, Australia

Post Post #8 (ISO) » Fri Jul 30, 2004 1:03 am

Post by Wacky »

I've been thinking about whether a script can be written so that you could insert a vote count by just pressing a button and it will count it for you (probably will have to be displayed all for htat to work)

The problem is, does a javascript thingy that goes through the page [looking for instances of <b>vote: </b> that aren't also in quotes ] have to be part of the code itself? I think it doesn't have to be but I'm not sure how that would work easily. Does anyone know what the javascript console in firefox does exactly? It seems to be able to run java code but when I tell it to do stuff to the document (document.writeln("hello world"); or something) it doesn't seem to work. Or maybe I just missed it, I dunno.
...whatever remains, however improbable, must be the truth.
User avatar
Malaprop
Malaprop
Goon
User avatar
User avatar
Malaprop
Goon
Goon
Posts: 231
Joined: September 30, 2003
Location: Chi-town
Contact:

Post Post #9 (ISO) » Fri Jul 30, 2004 3:25 am

Post by Malaprop »

Yeah, you could have Javascript that counts votes. See Jesse Ruderman's Bookmarklets for an extreme example of some of the cool stuff you can do. Some of the web-development ones have saved me a significant amount of time at work, and it's probably the best format for this sort of thing. Either define a standard tag to start/end days, or write the js so that it goes through all the selected text for votes, and you select a day at a time when using it. Would not be too bad to write.
[size=84]gim sumun.bi shà-thir-ma u ba-rì[/size]
User avatar
Norinel
Norinel
Not Voting (3)
User avatar
User avatar
Norinel
Not Voting (3)
Not Voting (3)
Posts: 1684
Joined: March 2, 2003
Location: My computer

Post Post #10 (ISO) » Fri Jul 30, 2004 12:41 pm

Post by Norinel »

True. It wouldn't take that much effort to pull the interface-specific stuff out of what I've got. I was thinking the CC2K as it is now would be more useful for chat, which I suppose means I should work on the style stuff at some point.
User avatar
Norinel
Norinel
Not Voting (3)
User avatar
User avatar
Norinel
Not Voting (3)
Not Voting (3)
Posts: 1684
Joined: March 2, 2003
Location: My computer

Post Post #11 (ISO) » Sat Jul 31, 2004 10:20 am

Post by Norinel »

Updated, with the code sorted to make adapting it for something like what Wacky and/or Malaprop said and added a minor customization feature.
BlueSin
BlueSin
Unique
BlueSin
Unique
Unique
Posts: 677
Joined: December 29, 2003
Location: Zion
Contact:

Post Post #12 (ISO) » Sat Jul 31, 2004 9:28 pm

Post by BlueSin »

nice tool man. :D :D
Why people always find me suspicous?
User avatar
Wacky
Wacky
Goon
User avatar
User avatar
Wacky
Goon
Goon
Posts: 866
Joined: July 16, 2003
Location: Sydney, Australia

Post Post #13 (ISO) » Mon Aug 02, 2004 4:18 am

Post by Wacky »

Okay, I've begun thinking about how exactly I would go about this, and I think I have all the pieces of the puzzle.

The major impediment so far has been that I don't know javascript, so I'm just using bits of code I have encountered so far. Plus I'm lazy. So I'll just post my algorithm and if there's an easier way of going about this (e.g. with this DOM thingy) someone could possibly let me know.

0. Program would have to be formatted as a bookmarklet (or it could be incorporated into the page itself, but that's really unlikely to happen) From what I can tell, all that needs is to put javascript:function( - code here with no spaces - ) [or something along those lines, just copy exact syntax and paste]

1. Do interface thingy -> somehow get **:
The text for the day "tag" (so it could be customised to either something like "It's Day" or a post number)
get list of alive players
---> more on this later

2. Take the thread's text, put it to lowercase

2a) take out all the stuff up to the day tag. If no day tag, don't take anything out, but add error message ##

3. Repeat the following:

Get next vote location:
i) find the location of the next substring containing "vote"
ii) AND bolded
iii) AND not between quote tags

I think there's specific html code fragments that would work, can't remember what they are exactly right now (it's late).

Get votee:
i) search it for substrings that match any on player list
ii) otherwise, skip any ":" or " " and just append it on the error messages

Get voter:

i) Go back until you hit the relevant html code fragments
ii) Search back (or forward, I forget) until you hit a player or the other end of that code.

Then get their player numbers and chuck it into Norinel's changeVote function

Then I think you need to feed some of the results back into Norinel's code some more

Then make it output onto this quick reply thing instead of voteform.

and append the error message at the end of it

## too many people are going to do stuff like
Vote: IS
. which won't match with Internet Stranger.

** I'm thinking either an interface like norinel's that you can save (and somehow keep the player names as well, just with an Alive checkbox or something), which would just generate an appropriate bookmarklet, or a series of prompts (typing in a bazillion names whenever someone dies is going to be annoying), or getting the player list off the page itself (which would be hard to do, I think).

P.S. Norinel - there's still a reference to "voteform" in the non-interface part of the code.
...whatever remains, however improbable, must be the truth.
User avatar
Fletcher
Fletcher
Eligible for a Title
User avatar
User avatar
Fletcher
Eligible for a Title
Eligible for a Title
Posts: 1069
Joined: July 15, 2003
Location: Missouri

Post Post #14 (ISO) » Mon Aug 02, 2004 5:03 am

Post by Fletcher »

Awesome!
[size=75]"But you know what they say. 'Too much of a good thing is an awesome thing. But too much of an awesome thing is... umm... really, really dumb and bad.'"- Strong Bad[/size]
User avatar
Norinel
Norinel
Not Voting (3)
User avatar
User avatar
Norinel
Not Voting (3)
Not Voting (3)
Posts: 1684
Joined: March 2, 2003
Location: My computer

Post Post #15 (ISO) » Mon Aug 02, 2004 5:20 am

Post by Norinel »

Wacky wrote:Okay, I've begun thinking about how exactly I would go about this, and I think I have all the pieces of the puzzle.
Okay.
The major impediment so far has been that I don't know javascript, so I'm just using bits of code I have encountered so far. Plus I'm lazy.
I'm just the second part, though my JS knowledge is far from perfect.
0. Program would have to be formatted as a bookmarklet (or it could be incorporated into the page itself, but that's really unlikely to happen) From what I can tell, all that needs is to put javascript:function( - code here with no spaces - ) [or something along those lines, just copy exact syntax and paste]
The one of these I have lying around doesn't have any spaces either, which I believe is a browser thing. Can you escape the spaces that have to be in strings?

It might also work if you had a frameset with the code in the top frame and the thread in the bottom one.
1. Do interface thingy -> somehow get **:
The text for the day "tag" (so it could be customised to either something like "It's Day" or a post number)
The post number's not that bad; search for <span class="gen"> </span> Post subject: $NUM </span>. (At least on viewtopic.php; it might work better to do this from the Print This Page, which has less junk.)
2. Take the thread's text, put it to lowercase

2a) take out all the stuff up to the day tag. If no day tag, don't take anything out, but add error message ##
These may not be necessary.
3. Repeat the following:

Get next vote location:
i) find the location of the next substring containing "vote"
ii) AND bolded
iii) AND not between quote tags

I think there's specific html code fragments that would work, can't remember what they are exactly right now (it's late).
Quotes are in a <td class="quote"> tag, bolding is in a <span style="font-weight: bold"> tag.
Get votee:
i) search it for substrings that match any on player list
ii) otherwise, skip any ":" or " " and just append it on the error messages
And check if it's an unvote, in which case the votee needs to be set to 0 and you need to start as close after the unvote for people who do "unvote: whomever, vote: IS".
Get voter:

i) Go back until you hit the relevant html code fragments
ii) Search back (or forward, I forget) until you hit a player or the other end of that code.
<span class="name"><a name="(some number)"></a><b>$NAME</a></b></span>.
Then get their player numbers and chuck it into Norinel's changeVote function
For this, you'd probably want to modify changeVote so it doesn't call updateCount at the end. The checking to see if someone's lynched will only do it for the person who the vote is changing to, which will cause problems if there's post-twilight changes.
Then I think you need to feed some of the results back into Norinel's code some more
I think the only thing that'd need to be done is to call updateCount, if you took it out of changeVote.
Then make it output onto this quick reply thing instead of voteform.

and append the error message at the end of it
Both trivial.
## too many people are going to do stuff like
Vote: IS
. which won't match with Internet Stranger.
It'd probably need to store abbreviations with the names, or be smart enough to come up with them on its own. All the capital letters in a nick, the first letter in all the words in a nick, or the nick without any numbers covers most of the common ones.
** I'm thinking either an interface like norinel's that you can save (and somehow keep the player names as well, just with an Alive checkbox or something), which would just generate an appropriate bookmarklet, or a series of prompts (typing in a bazillion names whenever someone dies is going to be annoying), or getting the player list off the page itself (which would be hard to do, I think).
With the frame method, it'd be possible to have a text box to paste the playerlist into. Getting the playerlist off the front post would require knowing something about the mod's individual format or being smart.
P.S. Norinel - there's still a reference to "voteform" in the non-interface part of the code.
That line's redundant; it'll be gone in the next update.
User avatar
Seol
Seol
Logical Rampage
User avatar
User avatar
Seol
Logical Rampage
Logical Rampage
Posts: 1563
Joined: November 26, 2004
Location: In the wrong

Post Post #16 (ISO) » Thu Mar 23, 2006 2:08 pm

Post by Seol »

OK, so, like, major necro, I know.

None of the links are working for me and I'm highly intrigued by this tool.

Does anyone have a link to it that works, or a copy they could e-mail me?

TIA
[i]The hungry maw of Twilight snaps, but shall not have its fill,
Until one man hangs by his neck, by half this curs'd town's will[/i]
User avatar
Commodore Amazing
Commodore Amazing
Out-booyahed
User avatar
User avatar
Commodore Amazing
Out-booyahed
Out-booyahed
Posts: 1912
Joined: March 8, 2005
Location: Chicago, IL

Post Post #17 (ISO) » Thu Mar 23, 2006 4:59 pm

Post by Commodore Amazing »

Someone used it in one of my first games here. Let me go through my old games and try to find out who it was.

EDIT: Apparently, this post is a lie.
User avatar
Thok
Thok
Disgrace to SKs everywhere
User avatar
User avatar
Thok
Disgrace to SKs everywhere
Disgrace to SKs everywhere
Posts: 7013
Joined: March 28, 2005

Post Post #18 (ISO) » Thu Mar 23, 2006 5:17 pm

Post by Thok »

I believe LML downloaded a copy of the Count-Counter; you might try asking him for a copy.
I replaced into Chess Mafia for 6 months, and all I got was a win and this lousy sig.
User avatar
Phoebus
Phoebus
Hall Monitor
User avatar
User avatar
Phoebus
Hall Monitor
Hall Monitor
Posts: 3743
Joined: October 19, 2003

Post Post #19 (ISO) » Thu Mar 23, 2006 7:06 pm

Post by Phoebus »

How 'bout you ask Nori?
Your happiness is intertwined with your outlook on life.
User avatar
Norinel
Norinel
Not Voting (3)
User avatar
User avatar
Norinel
Not Voting (3)
Not Voting (3)
Posts: 1684
Joined: March 2, 2003
Location: My computer

Post Post #20 (ISO) » Fri Mar 24, 2006 6:50 am

Post by Norinel »

The server it was on went down a while back. I poked the guy to give me an account on the replacement. I could e-mail it to people in the meantime, or something.
User avatar
Mr. Flay
Mr. Flay
Metatron
User avatar
User avatar
Mr. Flay
Metatron
Metatron
Posts: 24969
Joined: March 12, 2004
Location: Gormenghast
Contact:

Post Post #21 (ISO) » Sat Mar 25, 2006 4:54 am

Post by Mr. Flay »

I'd like that, actually...
Retired as of October 2014.
User avatar
LoudmouthLee
LoudmouthLee
Mafia Scum
User avatar
User avatar
LoudmouthLee
Mafia Scum
Mafia Scum
Posts: 2653
Joined: February 15, 2005
Location: New York City
Contact:

Post Post #22 (ISO) » Sat Mar 25, 2006 9:14 am

Post by LoudmouthLee »

LML has it.

PM him your e-mail address for a copy.
"LML = Mafia God" - Pie Is Good
"LML returns, plays one game, wins a Scummie, then leaves again!" - Primate
User avatar
Norinel
Norinel
Not Voting (3)
User avatar
User avatar
Norinel
Not Voting (3)
Not Voting (3)
Posts: 1684
Joined: March 2, 2003
Location: My computer

Post Post #23 (ISO) » Sun Mar 26, 2006 6:50 am

Post by Norinel »

Ditto. Do you have 0.2.1?
User avatar
Norinel
Norinel
Not Voting (3)
User avatar
User avatar
Norinel
Not Voting (3)
Not Voting (3)
Posts: 1684
Joined: March 2, 2003
Location: My computer

Post Post #24 (ISO) » Thu Mar 30, 2006 6:33 am

Post by Norinel »

The CC2K is back online at http://cy.aftran.com/~norinel/stuff/cc2k Note the address change.
Post Reply

Return to “Mafia Discussion”