Mafia Theme Checker

Discussion in 'Review' started by IceKirby, Jul 4, 2012.

  1. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Yes, that's something I need to add to the Checker. I actually had that same error myself with Medieval.
    I'll add that to the checker whenever I get some time.
     
  2. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    Best way to contact you I suppose: If you hide an action from priority, it will still show in the Theme Checker.

    Is there a way you can either make it so you can toggle hidden on and off, or formatting hidden things with a lighter color (like a grey instead of black)
     
  3. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    I made hidden actions appear in grey. Too much trouble making a toggle :x
     
  4. ThePiggy

    ThePiggy New Member

    Joined:
    Mar 6, 2013
    Messages:
    21
    Likes Received:
    0
    PO Trainer Name:
    ThePiggy
    help :x

    So I put my theme into the checker and it said everything was alright. No fatal or minor errors. Yet, when I test the theme out, I get this:

    (17:17:00) Times Up! :
    (17:17:00) ±Game: Your target (Roild) has been converted and is now a Pirate's Hostage!
    (17:17:00) Error occurred in mafia while handling the end of 'night' phase: TypeError: Result of expression 'player.role.actions.night' [undefined] is not an object.

    I'm not sure what to do from here...

    Theme pastebin:
     
  5. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    A full game log + readlog would help. I can't tell what's wrong only by that.
    In any case, I think that's actually a Mafia Script bug, but I can't find the error without further information.
     
  6. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    I assume it has to do with the lines of code:

    "convertmsg": "~Old~ has become the ~New~!",
    "silent": true,

    In the Pirate Crewman's "capture" command.
     
  7. ThePiggy

    ThePiggy New Member

    Joined:
    Mar 6, 2013
    Messages:
    21
    Likes Received:
    0
    PO Trainer Name:
    ThePiggy
    Thank you for the reply, but I figured it out. My capture and rescue were conflicting when two people tried to capture/rescue the same person on the same night. :)

    Fuzzysqurl helped. :D
     
  8. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    I'm planning to add a function to check for bad commands (as in, commands that shouldn't be used in a mafia theme, such as "slay" or "kick") that can conflict with server/channel commands, but I'll need some help making that list.

    What I have so far (will try to keep this list up-to-date):
    commands
    start
    votetheme
    starttheme
    help
    roles
    sides
    myrole
    mafiarules
    themes
    themeinfo
    changelog
    details
    priority
    flashme
    playedgames
    update
    join
    unjoin
    mafiaadmins
    mafiaban
    mafiaunban
    passma
    mafiaadmin
    mafiaadminoff
    mafiasadmin
    mafiasuperadmin
    mafiasadminoff
    mafiasuperadminoff
    push
    slay
    shove
    end
    readlog
    add
    remove
    disable
    enable
    updateafter
    importold
    mafiaban
    mafiaunban
    mafiabans
    detained
    detainlist

    Some of those commands would probably not disrupt the game if used in the proper phase, and some other would hardly make it to a mafia theme, but list them anyway :x
    If you remember any command I missed, just post here.
     
  9. Slowkii

    Slowkii Banned

    Joined:
    Jan 28, 2013
    Messages:
    603
    Likes Received:
    0
    ^ /me
     
  10. Roild

    Roild Member

    Joined:
    Jul 21, 2012
    Messages:
    861
    Likes Received:
    11
    PO Trainer Name:
    Roild
    You missed /ban, in case of admins+. Other than that, no one will ever /importold [name]. xD
     
  11. ZZZX

    ZZZX The Ghost Of The Past

    Joined:
    May 28, 2013
    Messages:
    103
    Likes Received:
    10
    http://pastebin.com/raw.php?i=2HTXpDWg[/HIDE]

    When i first tested my theme it worked perfectly in both JSOLint and your checker

    Now JSOLint is fine but your checker says i got misformed JSOL.. WHICH ISNT TRUE :D
     
  12. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    I just tested it and it came out perfectly fine.
     
  13. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
  14. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
  15. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    Requesting whitelist on optional messages:

    role.actions.daykillmissmsg

    role.actions.daykill.mode.evasionmsg

    role.actions.standby.expose.exposedtargetmsg


    I think only the first 2 actually trigger a minor error, but adding all 3 never hurts.
    http://pokemon-online.eu/forums/sho...-Documentation&p=298863&viewfull=1#post298863



    ~~~~~~

    Under role.actions:
    expose: Can be "evade", "revealexposer", "revenge"

    revealexposermsg
    exposerevengemsg
    exposeevademsg

    exposemissmsg

    startup: team-revealif-with-roles

    Under roles.actions.expose:
    exposedtargetmsgUnder roles.actions.daykill.mode:
    ignore (then array of roles)
    msg


    Under roles.actions.expose.mode:evadeChance
    evasionmsg

    ignore (then array of roles)
    msg




    That should be all. Most of them are just optional messages.
    Essentially, take daykill and copy it for expose... minus the "bomb" mode. That was the only thing I didn't code because I couldnt find a logical reason for an exposee to die after getting exposed, causing the exposer to die too...
    http://pokemon-online.eu/forums/sho...-Themes-(v2-0)&p=299752&viewfull=1#post299752
     
    Last edited: Jul 24, 2013
  16. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    I think I added everything, but I don't have a theme to test the new stuff, so please report any error :x

    Also, maybe I should remake the checker code, as it's getting harder to update :x
     
  17. Sky Sentinel

    Sky Sentinel You see?

    Joined:
    Oct 21, 2012
    Messages:
    814
    Likes Received:
    24
    PO Trainer Name:
    Sky Sentinel
    I'll check the daykill evade right now, lol.


    Soren (soren)
    Help Text: You're the expert tactician of the Greil Mercenaries. You're very loyal to Ike and serve him with your life but are a bit...cold to other people. Regardless, its in your best interests to help the heroes and end this war. To this end, you have the ability to /inspect one unit at nighttime, showing their identity. You're also good at predicting traps and danger, giving you a 10% chance to not die to killers. You're always next to Ike so you know his identity.
    Abilities:
    Night Actions:
    Inspect:
    Has a 10% chance of evading kill.
    Knows Ike.

    Doesn't show that he evades Ike there...

    Minor errors found in your script:
    Role soren's "daykill" action has an extra attribute "targetmsg".

    "targetmsg" is the thing that gets sent to Soren, so yeah.
     
  18. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    I only updated the Errors tab. The Roles Info are not updated yet.

    And there's no thing like targetmsg for daykill mode. You are probably thinking of evasionmsg.
     
  19. Sky Sentinel

    Sky Sentinel You see?

    Joined:
    Oct 21, 2012
    Messages:
    814
    Likes Received:
    24
    PO Trainer Name:
    Sky Sentinel
    It's for the daykill evade:
    Code (text):
    1.                 "daykill": {
    2.                     "mode": {
    3.                         "ignore": [
    4.                             "ike"
    5.                         ]
    6.                     },
    7.                     "targetmsg": "±Tactician: A giant, golden sword is seen high in the sky. You quickly moved out of the way to avoid being hit.",
    8.                     "msg": "±Tactician: Soren sidestepped the swing of your sword. 'Is there something you wanted to talk about, Ike?'"
    9.                 }
    10.             }
    and trust me, it's right-- fuzzy and i spent hours trying to fix it...
     
  20. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    There's no mention to any targetmsg anywhere near the daykill code. You are definitely mistaking the attribute name, or the code Fuzzy submitted is different from the one you tested.
     
  21. Sky Sentinel

    Sky Sentinel You see?

    Joined:
    Oct 21, 2012
    Messages:
    814
    Likes Received:
    24
    PO Trainer Name:
    Sky Sentinel
    I think since he's still working on it he didn't submit it yet... I'll get back to you later on that then, lol
     
  22. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    targetmsg will go under mode for both daykill and expose.

    Also, whitelist "nonPeak" in the global theme area

    EDIT: Also add "onslay" to "onDeath" stuff.

    Its a boolean... if you want to update the Roles tab:
    Undefined or true = "When this user is slain, onDeath activates"
    False = "When this user is slain, nothing happens" (The way it is now)
     
    Last edited: Jul 25, 2013
  23. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    It would be better ifonslay defaults to how it works currently. Besides, I added a note to the commit about how that won't work yet.

    And updated checker with a slightly revamped code. Most of the stuff is to make it easier to update later, but what users will notice is that lots of messages are different now, there are some extra checks and 2 new features: Check for bad command (commands like slay, ban, help, etc) and Case Check for some stuff (so the checker will warn when you have 'initialRecharge' instead of 'initialrecharge', for example).
     
  24. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    Whitelist global attrtibutes:
    themelink
    altname

    Whitelist actions.lynch
    (Copied from onDeath, but there are situations where you want Lynch but cannot use onDeath. Like Vengeful.)
    exposeroles
    killroles
    curseroles
    convertroles
    poisonroles

    Also, the onslay thing was updated to work properly and such. Same placement though.
     
  25. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Everything added (I hope). Report if anything is missing/wrong.

    And again, only Errors tab updated for now. Will update the Roles tab later.
     
  26. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    Ah, I meant to post awhile ago:


    Add Detox/Dispel to valid commands

    Both actions use 4 messages, ones that throw errors:
    failmsg
    targetmsg
    detoxmsg
    dispelmsg


    Add resistance to valid modes

    Related values: (They go in [action].mode, same place a msg would. If you could also note they need to be a valid integer/number)
    Rate
    Constant

    Default value if neither is defined is "Takes 1 additional night to die/get converted", for the Roles output

    Hide needs to accept values of "side", "role", "both", or be a valid boolean



    If you're up for it while you're adding, Curseattacker[evenifprotected] should be ready soon, its pretty much a clone of the night action Curse, with all the same options. If you don't get it added, I'll make a full list of what needs to be whitelisted once i get it working and added.
     
  27. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Oh right, I need to update the checker, but lazy ┐( ̄ー ̄)┌
    Checking for errors is easy, the annoying part is to add stuff to the Roles tab

    Edit: Added stuff to Error check tab, including the Revenge Specific Standby action that you forgot to mention.
    Roles tab will be updated whenever I feel not lazy :x Roles Tab updated too.
     
    Last edited: Aug 18, 2013
  28. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
  29. Scatterbrain

    Scatterbrain You only live once*

    Joined:
    Jul 5, 2012
    Messages:
    865
    Likes Received:
    4
    Hey, can you whitelist "tips" (sort of like "changelog")? It's nothing special, meaning I'm not expecting a command like /help or /myrole, but it could act as an incentive for people who've read the themes. Since it's a minor error, it gets discarded anyways, so it's pretty much hassle free, right?
    Code would go like this
    Code (text):
    1.  
    2. "tips": {
    3. "Inspector": "Always claim if BG is alive!",
    4. "Bodyguard": "Always BG Inspector!"
    5. }
    6.  
     
  30. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Sure. Already done.
     
  31. Scatterbrain

    Scatterbrain You only live once*

    Joined:
    Jul 5, 2012
    Messages:
    865
    Likes Received:
    4
    Thanks Rice!
     
  32. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    Jumping the gun here, this is for the pull request currently awaiting merging:

    https://github.com/Fuzzysqurl/Mafia/blob/master/Themes/Development/Test


    Fatal errors found in your script:


    • No fatal errors found. Good job.
    Minor errors found in your script:


    • Your role "villager" has an extra attribute "startupmsg".
    • Role soren.actions.daykill has an extra attribute "expend".
    • Role sophia.actions.expose has an extra attribute "expend".
    • Role goon.actions.inspect has an extra attribute "seenSide".


    Daykill mode needs property "expend", which is a boolean
    Expose mode needs property "expend", which is a boolean
    Role needs "startupmsg"
    Actions.inspect needs "seenSide" (same place as "mode" is)
     
  33. Fate Testarossa

    Fate Testarossa Unbreakable Bond

    Joined:
    Jul 7, 2012
    Messages:
    527
    Likes Received:
    563
    PO Trainer Name:
    Fate Testarossa
    I tried to put a theme I created in the theme checker, but I believe it's bugged. It still says "checking your theme" after 45 minutes. Stocke also did a check for himself using the Vengeful theme, and he had the same problem. (You can ask him to confirm it.)
     
  34. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Try to clear the cache and reload the page (or use the full refresh, or private browsing). I made a structural change recently, so it's possible you are only loading the old script version.
     
  35. Roild

    Roild Member

    Joined:
    Jul 21, 2012
    Messages:
    861
    Likes Received:
    11
    PO Trainer Name:
    Roild
    I've been trying to use it as well. Cleared my cache and all saved things. It isn't working for me on Chrome. It keeps saying "Checking your theme, please wait".

    It is working on Firefox although I never use Firefox.
     
  36. Hopkirk

    Hopkirk +C

    Joined:
    Jan 30, 2013
    Messages:
    132
    Likes Received:
    18
    PO Trainer Name:
    Hopkirk
    I use firefox and it was working for me. What browser were you using Espeon?
     
  37. JhenMohran

    JhenMohran Random Art Guy

    Joined:
    Jun 2, 2013
    Messages:
    181
    Likes Received:
    0
    PO Trainer Name:
    JhenMohran
    I use Chrome
    Same Problem
    Just adding to the stuff and things and yeah
     
  38. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    [​IMG]
    This is from a page breaking change in Chrome 27[?] - see https://code.google.com/p/chromium/issues/detail?id=180007
    GitHub doesn't want you to include scripts from raw links by setting X-Content-Type-Options: nosniff

    This header is parsed in IE 8-10, so those are broken too. Gecko might implement it as well. Opera 15+ will/has the same 'problem' as Chrome.

    You can try serving from https://rawgithub.com/po-devs/po-server-goodies/master/scripts/mafiachecker.js instead (no rawgithub instead of raw.github), or using GitHub pages (recommended).

    tl;dr to users: Use Firefox for now.
     
  39. Stocke

    Stocke Wat is dis I don't even

    Joined:
    Mar 27, 2013
    Messages:
    128
    Likes Received:
    77
    Yeah, yet another disgruntled Chrome user here. I tried Vengeful as Espeon says, which is the simplest theme I could think of. No result. I don't want to download a whole new browser only for checking themes. It doesn't sound fair to me when it worked perfectly not so long ago. As in, last week tops. Hoping it gets fixed soon.
     
  40. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    It seems that rawgithub could block you if you abuse that as a host. They are only meant to be used for samples and simpler stuff :x
    The thing is that the plan was to make the Theme Checker page share the script that's now used to check themes when you upload/update them in the server. Hosting it somewhere else would solve, but it would make it so they need to be updated separately.