The Count-Counter 2000

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

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

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 12:34 pm, edited 1 time in total.

Corsato
Goon
 
Joined: April 02, 2002
Location: Spijkenisse
Pronoun: He

Post Post #1  (ISO)  » Wed Jul 14, 2004 3:43 pm

The page cannot be found
:(

Norinel
Not Voting (3)
 
User avatar
Joined: March 02, 2003
Location: My computer
Pronoun: He

Post Post #2  (ISO)  » Wed Jul 14, 2004 4:06 pm

Works for me... try this, (Editted to fix link) if you still have problems.
Last edited by Norinel on Thu Mar 30, 2006 12:35 pm, edited 1 time in total.

mathcam
Captain Observant
 
User avatar
Joined: November 22, 2002
Pronoun: He

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

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

Cam

mathcam
Captain Observant
 
User avatar
Joined: November 22, 2002
Pronoun: He

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

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

Cam

Norinel
Not Voting (3)
 
User avatar
Joined: March 02, 2003
Location: My computer
Pronoun: He

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

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.

Flying Dutchman
I never think
 
User avatar
Joined: November 21, 2003
Location: The land of clogs, tulips, mills, and cheese!
Pronoun: He

Post Post #6  (ISO)  » Fri Jul 16, 2004 2:00 pm

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
Goon
 
Joined: April 02, 2002
Location: Spijkenisse
Pronoun: He

Post Post #7  (ISO)  » Mon Jul 19, 2004 1:00 am

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.

Wacky
Goon
 
User avatar
Joined: July 16, 2003
Location: Sydney, Australia

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

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.

Malaprop
Goon
 
User avatar
Joined: September 30, 2003
Location: Chi-town

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

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.
gim sumun.bi shà-thir-ma u ba-rì

Norinel
Not Voting (3)
 
User avatar
Joined: March 02, 2003
Location: My computer
Pronoun: He

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

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.

Norinel
Not Voting (3)
 
User avatar
Joined: March 02, 2003
Location: My computer
Pronoun: He

Post Post #11  (ISO)  » Sat Jul 31, 2004 4:20 pm

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
Unique
 
Joined: December 29, 2003
Location: Zion
Pronoun: He

Post Post #12  (ISO)  » Sun Aug 01, 2004 3:28 am

nice tool man. :D :D
Why people always find me suspicous?

Wacky
Goon
 
User avatar
Joined: July 16, 2003
Location: Sydney, Australia

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

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.

Fletcher
Eligible for a Title
 
User avatar
Joined: July 15, 2003
Location: Missouri
Pronoun: He

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

Awesome!
"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

Norinel
Not Voting (3)
 
User avatar
Joined: March 02, 2003
Location: My computer
Pronoun: He

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

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.

Seol
Logical Rampage
 
User avatar
Joined: November 26, 2004
Location: In the wrong
Pronoun: He

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

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
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

Commodore Amazing
Out-booyahed
 
User avatar
Joined: March 08, 2005
Location: Chicago, IL
Pronoun: He

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

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.

Thok
Disgrace to SKs everywhere
 
User avatar
Joined: March 29, 2005
Pronoun: He

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

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.

Phoebus
Hall Monitor
 
User avatar
Joined: October 19, 2003
Pronoun: He

Post Post #19  (ISO)  » Fri Mar 24, 2006 1:06 am

How 'bout you ask Nori?
Your happiness is intertwined with your outlook on life.

Norinel
Not Voting (3)
 
User avatar
Joined: March 02, 2003
Location: My computer
Pronoun: He

Post Post #20  (ISO)  » Fri Mar 24, 2006 12:50 pm

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.

Mr. Flay
Metatron
 
User avatar
Joined: March 12, 2004
Location: Gormenghast
Pronoun: He

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

I'd like that, actually...
Retired as of October 2014.

LoudmouthLee
Mafia Scum
 
User avatar
Joined: February 15, 2005
Location: New York City
Pronoun: He

Post Post #22  (ISO)  » Sat Mar 25, 2006 3:14 pm

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

Norinel
Not Voting (3)
 
User avatar
Joined: March 02, 2003
Location: My computer
Pronoun: He

Post Post #23  (ISO)  » Sun Mar 26, 2006 12:50 pm

Ditto. Do you have 0.2.1?

Norinel
Not Voting (3)
 
User avatar
Joined: March 02, 2003
Location: My computer
Pronoun: He

Post Post #24  (ISO)  » Thu Mar 30, 2006 12:33 pm

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

Next
[ + ]

Return to Mafia Discussion