Page 1 of 2 12 LastLast
Results 1 to 30 of 35

Thread: Mafia Phase Timer

  1. #1
    Bureaucratically Efficient Senior Member TinCow's Avatar
    Join Date
    Mar 2004
    Location
    Washington, DC
    Posts
    13,729

    Default Mafia Phase Timer

    I have added a new feature to the forums to make it easier for players to know when mafia game phases are over. It is a bbcode timer which counts down to any date and time specified. The bbcode format is [timer] and you can enter it manually, or click the timer icon on the advanced editor ().

    The bbcode must be formatted in the following manner:

    [TIMER=M/D/YYYY H:MM AM/PM ZONE; TIMEUP PHRASE][/ TIMER]

    Where

    • M = The Month number, with or without a 0. So, for August, either 8 or 08.
    • D = The Day number, with or without a 0. So, for the fifth day, either 5 or 05.
    • YYYY = The Year in full four digit number format
    • H: The Hour, with or without a 0. So, for the seventh hour, either 7 or 07.
    • MM = The Minute, so quarter past the hour would be 15, half past would be 30, and on the hour would be 00.
    • AM/PM = AM or PM
    • ZONE = Time Zone of the deadline. It is very important that you put this in. If you do not, the timer will display the local time for each person viewing it, which means people in different parts of the world will see different (and incorrect) times. The time zone codes accept all of the usual zone abbreviations, such as UTC, GMT, EST, EDT, PST, PDT, etc. You can also use UTC referential times, such as UTC-1, UTC-2, UTC+7, etc.
    • TIMEUP PHRASE = Whatever text you want it to display when the timer is finished, such as "Day Phase Over" or "Night Phase Over".

    So, to create a timer counting down to a Night Phase which ends on August 24, 2015 at 5pm, GMT, I would create the following bbcode:

    [TIMER=8/24/2015 5:00 PM GMT; Night Phase Over][/ TIMER]

    and it looks like this once I removed that extra space from the bbcode:



  2. #2
    Peerless Senior Member johnhughthom's Avatar
    Join Date
    Sep 2007
    Location
    Looking for the red blob of nothingness
    Posts
    6,344

    Default Re: Mafia Phase Timer

    That is awesome TC, great work.

  3. #3
    ridiculously suspicious Member TheLastDays's Avatar
    Join Date
    Apr 2011
    Location
    Right behind you.
    Posts
    2,116

    Default Re: Mafia Phase Timer

    That's cool. Going to try that right away with the next phase. Great work!
    I hear the voice of the watchmen!

    New Mafia Game: Hunt for The Fox

  4. #4
    Illuminated Moderator Pogo Panic Champion, Graveyard Champion, Missle Attack Champion, Ninja Kid Champion, Pop-Up Killer Champion, Ratman Ralph Champion GeneralHankerchief's Avatar
    Join Date
    Mar 2006
    Location
    On a pirate ship
    Posts
    12,545
    Blog Entries
    1

    Default Re: Mafia Phase Timer

    I love having Tech Admins interested in the Gameroom.
    "I'm going to die anyway, and therefore have nothing more to do except deliberately annoy Lemur." -Orb, in the chat
    "Lemur. Even if he's innocent, he's a pain; so kill him." -Ignoramus
    "I'm going to need to collect all of the rants about the guilty lemur, and put them in a pretty box with ponies and pink bows. Then I'm going to sprinkle sparkly magic dust on the box, and kiss it." -Lemur
    Mafia: Promoting peace and love since June 2006

    Quote Originally Posted by TosaInu
    At times I read back my own posts [...]. It's not always clear at first glance.


  5. #5
    Member Member Tratorix's Avatar
    Join Date
    Jun 2007
    Location
    Nova Scotia, Canada
    Posts
    1,784

    Default Re: Mafia Phase Timer

    Wow this rules. Now if you can make one that automatically keeps a vote tally we'll be set.

  6. #6
    Bureaucratically Efficient Senior Member TinCow's Avatar
    Join Date
    Mar 2004
    Location
    Washington, DC
    Posts
    13,729

    Default Re: Mafia Phase Timer

    Quote Originally Posted by Tratorix View Post
    Now if you can make one that automatically keeps a vote tally we'll be set.
    I've actually thought about that, but it would be impossible to have it take into account things like misspellings, name abbreviations (i.e. ATPG), nicknames (i.e. Strawberry), etc. The only way it could work is if everyone used the exact same format to vote and if they all spelled out every name precisely and in full. That seems like trying to enforce that would cause more problems than it would solve.


  7. #7
    Member Member Tratorix's Avatar
    Join Date
    Jun 2007
    Location
    Nova Scotia, Canada
    Posts
    1,784

    Default Re: Mafia Phase Timer

    Quote Originally Posted by TinCow View Post
    I've actually thought about that, but it would be impossible to have it take into account things like misspellings, name abbreviations (i.e. ATPG), nicknames (i.e. Strawberry), etc. The only way it could work is if everyone used the exact same format to vote and if they all spelled out every name precisely and in full. That seems like trying to enforce that would cause more problems than it would solve.
    Oh, screw that noise then. Warman would survive every game since no one would want to take the 5 minutes necessary to spell his name.

  8. #8
    Knight of Flowers Member Diamondeye's Avatar
    Join Date
    Nov 2009
    Posts
    2,288
    Blog Entries
    12

    Default Re: Mafia Phase Timer

    Awesome TinCow!

    About Vote tags...
    Would it be possible if you used [Vote=ExactUserName][/Vote]? How would it recognize phase shifts (if you make a tag for that, people who aren't the host could post the tag to mechanically end the round, although it would of course be unsportsmanslike and disruptive). That way you could also implement [VoteEnd][/VoteEnd] and [Tally][/Tally]. It would be great!

    Also, remember to buy me birthday presents!
    Last edited by Diamondeye; 08-04-2011 at 22:39.
    If God is great, and if God is good, why can't he change the hearts of men?"
    -Tom Waits, "The Road to Peace"

  9. #9
    Knight of Flowers Member Diamondeye's Avatar
    Join Date
    Nov 2009
    Posts
    2,288
    Blog Entries
    12

    Default Re: Mafia Phase Timer

    ... Your timer seems to be actively ticking, while mine does not..?
    If God is great, and if God is good, why can't he change the hearts of men?"
    -Tom Waits, "The Road to Peace"

  10. #10
    ridiculously suspicious Member TheLastDays's Avatar
    Join Date
    Apr 2011
    Location
    Right behind you.
    Posts
    2,116

    Default Re: Mafia Phase Timer

    Quote Originally Posted by Diamondeye View Post
    Awesome TinCow!

    About Vote tags...
    Would it be possible if you used [Vote=ExactUserName][/Vote]? How would it recognize phase shifts (if you make a tag for that, people who aren't the host could post the tag to mechanically end the round, although it would of course be unsportsmanslike and disruptive). That way you could also implement [VoteEnd][/VoteEnd] and [Tally][/Tally]. It would be great!

    Also, remember to buy me birthday presents!
    Fiyed that for ya
    Seems like the Time Up Message cannot contain punctuation

    EDIT: Also, cann I use bbcode like [b] in my time up message?
    Last edited by TheLastDays; 08-04-2011 at 23:13.
    I hear the voice of the watchmen!

    New Mafia Game: Hunt for The Fox

  11. #11
    Bureaucratically Efficient Senior Member TinCow's Avatar
    Join Date
    Mar 2004
    Location
    Washington, DC
    Posts
    13,729

    Default Re: Mafia Phase Timer

    Quote Originally Posted by TheLastDays View Post
    Fiyed that for ya
    Seems like the Time Up Message cannot contain punctuation

    EDIT: Also, cann I use bbcode like [b] in my time up message?
    Unfortunately, no you can't, at least not as it's currently written. Any bbcode inside the message will break it. The timer interface is bbcode, but the animated timer itself runs on javascript. I don't know javascript well enough to be able to figure out how to insulate the time up message from the rest of the code. If anyone knows javascript and wants to tweak it to make it better, I'll happily post the code.
    Last edited by TinCow; 08-04-2011 at 23:49.


  12. #12
    ridiculously suspicious Member TheLastDays's Avatar
    Join Date
    Apr 2011
    Location
    Right behind you.
    Posts
    2,116

    Default Re: Mafia Phase Timer

    Then how about adding a bolding in the HTML? I think most of the timeup messages should be bolded anyway.
    I hear the voice of the watchmen!

    New Mafia Game: Hunt for The Fox

  13. #13
    Bureaucratically Efficient Senior Member TinCow's Avatar
    Join Date
    Mar 2004
    Location
    Washington, DC
    Posts
    13,729

    Default Re: Mafia Phase Timer

    Quote Originally Posted by TheLastDays View Post
    Then how about adding a bolding in the HTML? I think most of the timeup messages should be bolded anyway.
    As per my edit above, it's not HTML, it's javascript. I know enough HTML to tweak that, but I haven't done any javascript coding in about 13 years.


  14. #14
    Illuminated Moderator Pogo Panic Champion, Graveyard Champion, Missle Attack Champion, Ninja Kid Champion, Pop-Up Killer Champion, Ratman Ralph Champion GeneralHankerchief's Avatar
    Join Date
    Mar 2006
    Location
    On a pirate ship
    Posts
    12,545
    Blog Entries
    1

    Default Re: Mafia Phase Timer

    Quote Originally Posted by Diamondeye View Post
    Also, remember to buy me birthday presents!
    I am going to eternally go by this timer when determining your birthday.
    "I'm going to die anyway, and therefore have nothing more to do except deliberately annoy Lemur." -Orb, in the chat
    "Lemur. Even if he's innocent, he's a pain; so kill him." -Ignoramus
    "I'm going to need to collect all of the rants about the guilty lemur, and put them in a pretty box with ponies and pink bows. Then I'm going to sprinkle sparkly magic dust on the box, and kiss it." -Lemur
    Mafia: Promoting peace and love since June 2006

    Quote Originally Posted by TosaInu
    At times I read back my own posts [...]. It's not always clear at first glance.


  15. #15
    Bureaucratically Efficient Senior Member TinCow's Avatar
    Join Date
    Mar 2004
    Location
    Washington, DC
    Posts
    13,729

    Default Re: Mafia Phase Timer

    Quote Originally Posted by GeneralHankerchief View Post
    I am going to eternally go by this timer when determining your birthday.
    That timer actually works, it's just that his formatting broke the animation. If you refresh, you'll see it's actually still counting.


  16. #16
    Bureaucratically Efficient Senior Member TinCow's Avatar
    Join Date
    Mar 2004
    Location
    Washington, DC
    Posts
    13,729

    Default Re: Mafia Phase Timer

    Ok, I've figured out how to modify the text as a whole. I've bolded the entire counter to make it easier to view. This makes it a bit more visible and will also bold whatever 'time up' text you put in.


  17. #17
    ridiculously suspicious Member TheLastDays's Avatar
    Join Date
    Apr 2011
    Location
    Right behind you.
    Posts
    2,116

    Default Re: Mafia Phase Timer

    Quote Originally Posted by TinCow View Post
    Ok, I've figured out how to modify the text as a whole. I've bolded the entire counter to make it easier to view. This makes it a bit more visible and will also bold whatever 'time up' text you put in.
    I hear the voice of the watchmen!

    New Mafia Game: Hunt for The Fox

  18. #18
    mostly harmless Member B-Wing's Avatar
    Join Date
    May 2006
    Location
    on the Streets of Rage!
    Posts
    1,070

    Default Re: Mafia Phase Timer

    I like it!! Yay!

  19. #19
    Spirit King Senior Member seireikhaan's Avatar
    Join Date
    Feb 2007
    Location
    Iowa, USA.
    Posts
    7,065
    Blog Entries
    1

    Default Re: Mafia Phase Timer

    Oh yes. Excellent piece of tech. Muchos gracias, TinCow.
    It is better to conquer yourself than to win a thousand battles. Then, the victory is yours. It cannot be taken from you, not by angels or by demons, heaven or hell.

  20. #20
    Bureaucratically Efficient Senior Member TinCow's Avatar
    Join Date
    Mar 2004
    Location
    Washington, DC
    Posts
    13,729

    Default Re: Mafia Phase Timer

    Made it red and made it use proper singular versions of the words when the count is 1. We must always be grammatically correct.

    [edit]I've also made it completely drop the "Days" entry when Days hits 0, as most mafia timers are 24 hours, so we'd be staring at a lot of "0 Days" entries. I will not have it drop Hours and Minutes in the same way, as I think 0 Hours and 0 Minutes helps emphasize that the time limit is close in a manner that 0 Days does not.
    Last edited by TinCow; 08-05-2011 at 01:49.


  21. #21
    Know the dark side Member Askthepizzaguy's Avatar
    Join Date
    Apr 2007
    Location
    Norway
    Posts
    25,829

    Default Re: Mafia Phase Timer

    I do believe TinCow is presently the MVP of the entire .org.

    There aren't enough awards, dude.

    Maybe now you'll make darn sure my idea of more awards happens.
    #Winstontoostrong
    #Montytoostronger

  22. #22
    Member Member classical_hero's Avatar
    Join Date
    Oct 2010
    Location
    Perth, Western Australia. GMT+8
    Posts
    945

    Default Re: Mafia Phase Timer

    I am going to presume that EST and EDT will only work on American timezones and not Australian one, or would AEST and AWST work or not? Anyway I would use GMT setting since I know that will work.

  23. #23
    ridiculously suspicious Member TheLastDays's Avatar
    Join Date
    Apr 2011
    Location
    Right behind you.
    Posts
    2,116

    Default Re: Mafia Phase Timer

    The referencial time setting works well, at least with GMT, so going GMT+8 for you should do the trick.
    I hear the voice of the watchmen!

    New Mafia Game: Hunt for The Fox

  24. #24
    Bureaucratically Efficient Senior Member TinCow's Avatar
    Join Date
    Mar 2004
    Location
    Washington, DC
    Posts
    13,729

    Default Re: Mafia Phase Timer

    Quote Originally Posted by classical_hero View Post
    I am going to presume that EST and EDT will only work on American timezones and not Australian one, or would AEST and AWST work or not? Anyway I would use GMT setting since I know that will work.
    Hmmm... yeah, EST/EDT key to those US zones, and AEST/AEDT aren't recognized by the code. You'll have to use UTC/GMT referential codes. Both UTC and GMT work in the code, so pick whichever you prefer and than add +X, where X is the appropriate hour adjustment listed here:

    http://www.timeanddate.com/library/a.../timezones/au/

    So, for Aussie EST, it might look like this:
    [TIMER=8/7/2011 12:00 AM GMT+10; Down Under][/ TIMER]


  25. #25
    winston 4 champs Member Zack's Avatar
    Join Date
    Apr 2010
    Posts
    5,081

    Default Re: Mafia Phase Timer

    Would CDT work, or would GMT-5 have to be used instead?

    (first is using "CDT", second is using "GMT-5")



    Last edited by Zack; 08-05-2011 at 17:57. Reason: Thanks, TinCow.

  26. #26
    Bureaucratically Efficient Senior Member TinCow's Avatar
    Join Date
    Mar 2004
    Location
    Washington, DC
    Posts
    13,729

    Default Re: Mafia Phase Timer

    That's because were currently in daylight savings time. Use CDT.


  27. #27
    ridiculously suspicious Member TheLastDays's Avatar
    Join Date
    Apr 2011
    Location
    Right behind you.
    Posts
    2,116

    Default Re: Mafia Phase Timer

    What is CST? GMT-5 would be EST, wouldn't it?
    I hear the voice of the watchmen!

    New Mafia Game: Hunt for The Fox

  28. #28
    winston 4 champs Member Zack's Avatar
    Join Date
    Apr 2010
    Posts
    5,081

    Default Re: Mafia Phase Timer

    Quote Originally Posted by TinCow View Post
    That's because were currently in daylight savings time. Use CDT.
    Oh, duh.

  29. #29
    Bureaucratically Efficient Senior Member TinCow's Avatar
    Join Date
    Mar 2004
    Location
    Washington, DC
    Posts
    13,729

    Default Re: Mafia Phase Timer

    CST is GMT-6, CDT is GMT-5
    EST is GMT-5, EDT is GMT-4


  30. #30
    Knight of Flowers Member Diamondeye's Avatar
    Join Date
    Nov 2009
    Posts
    2,288
    Blog Entries
    12

    Default Re: Mafia Phase Timer

    Quote Originally Posted by TinCow View Post
    We must always be grammatically correct.
    I concur! Civilization is not my only fanaticism .
    If God is great, and if God is good, why can't he change the hearts of men?"
    -Tom Waits, "The Road to Peace"

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO