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 (isolation #0) » 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.
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 (isolation #1) » 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
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 (isolation #2) » 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
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 (isolation #3) » 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 (isolation #4) » 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.
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 (isolation #5) » 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
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 (isolation #6) » 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
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 (isolation #7) » 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 (isolation #8) » 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.
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 #33 (isolation #9) » Sun May 31, 2009 4:15 pm

Post by Norinel »

I've definitely got the files lying around on my computer. I don't think I have a good webhost any more though (or at least one that's not tied to my RL name); if someone's cool hosting arbitrary JavaScript, I can e-mail it to them.
Post Reply

Return to “Mafia Discussion”