Page 1 of 9

Modbot to Help You Run Games: Now With A Votecounter Demo!

Posted: Mon Apr 30, 2018 11:32 am
by Psyche
tl;drA web-based demo of the votecounter can be found here: [LINK DEAD FOR NOW] - you'll need a Google Account to use it.

If you want to go ahead and start using Modbot, a Windows pre-release is available here. Right now it supports Automatic Pagetopping (for reserving pagetops in your threads!) and a demo of a super-accurate votecounter (aimed at counting votes in any existing thread just like mods do), and we could use feedback on how well it works. Much developing is still left to do!


This project is called "Modbot".
The goal is base of tools automating the more trivial activities a game moderator does.
I started this project long ago here and got tons of useful feedback; now, I'm ready to start releasing useful products.
These include some useful modules likely to be useful to other developers doing similar things,
But the main milestone being pursued right now is an automated pagetopping votecounter that works really well and is easy to use
As far as that goes, I'm on the last lap

The code for this last lap are trivial to implement, computationally speaking. However, there are a lots of ways I can finish this very last lap.
For this reason, I want your help making decisions about the way I'll actually do this. So that when it's all done you'll actually want to use it.
If you're interested in this effort, I hope you'll provide said help.

Some things I want to know...

1.
What would you want a 'ModBot' to do for you?
Can you sort these in order of priorities? How do existing resources for these activities currently fail you? For example, maybe you really want a Bot to do votecounting for you, or maybe you'd appreciate having an easier time assigning and sending out role pms. There's not much that game moderators do that a modbot can't do (besides, like, creating Scummie-winning flavor or setups or stuff like that - though generic flavor and setups are of course possible).
Right now
, I'm going for the pagetopping votecounter.

2.
How do you want to
interact
with 'ModBot'?
For example, do you want it to be an app in your desktop? Maybe a Google Form you fill out and edit? Something that controls your account to complete accounts, or a bot account you "co-mod" games with? A unitary resource, or a set of tools? There are many more possibilities besides these.
Right now
, I'm thinking between a client-side application or browser extension.

3.
More broadly, how should Modbot's tools be designed?
For example, how would you like to dictate how the formatting of votecounts?

Please consult the link near the start of this post to understand what's already been said about these topics already.

Posted: Mon Apr 30, 2018 11:32 am
by Psyche
I hope to make this thread an organized place for both discussion and release of everything useful done related to this project.

Project Repository: https://github.com/MafiaScum-Unofficial/modbot

What's Done
  • A Votecounter And Votecounter Tester
    . Over ~300 games drawn from the Mini Normal Archive where D1 ends in a lynch, it gets the final D1 votecount right 98.65% of the time without using any aliasing (as long as what decides who dies D1 is who gets a majority of votes first after post 0). Currently written in python, and to be publicly released on GitHub this week.

  • A Module of Functions Automating Most Interactions With the Site
    . Logging in, collecting posts in a thread, making posts in a thread, sending PMs, and more (and more on the way, too). Just import the module, set your username and password, and go, without ever thinking about how it happens. In donbot section of the repo above.


Near Term Release Plans
  • [
    *]Configure GitHub repository/repositories to host modules finished so far and files to finish in the future.
  • A votecounter demo to convince the community of its effectiveness at detecting even the most lazily formatted votes, to allow other developers to test their own
  • votecounters, and to facilitate detection of potential improvements to it.

  • An easy, text-based framework to provide moderators full control over how votecounts output by modbot are structured and formatted.
  • A client-side tool anyone will be able to use to automatically pagetop game threads with an up-to-date votecount following formatting of the client's choosing.
  • From there, I incrementally add functionality to the client-side tool depending on site demand and personal interest. A fully autonomous modbot
    could
    happen, but the goal here is more conservatively just to produce an assistant.
  • I'm going for these five phases of release over the next several days and weeks. They build off of one another in neat but substantial steps.

    On RadarAutomated Night Action Resolution
    Simultaneous/templated role PMs
    Auto-prodder
    Thread lock/unlocker

    Posted: Mon Apr 30, 2018 11:39 am
    by Alisae
    If this collected wagon data and recorded how many posts that person made in a day phase that would be neat!

    Posted: Mon Apr 30, 2018 11:44 am
    by Psyche
    The main thing I want to talk about *right now* is the part where the data structure of voting data my votecounter makes is converted into a formatted votecount post for game mods to post. It doesn't seem very straightforward given the variety of ways mods like to format their votecounts.

    Posted: Mon Apr 30, 2018 4:04 pm
    by Mathdino
    1. Simultaneous/templated role PMs > Votecount Pagetopper > Auto-prodder > Thread lock/unlocker > Action Resolution

    2. I'd prefer if it controlled my account.

    3. I like Mathblade's VCs.

    Posted: Mon Apr 30, 2018 4:18 pm
    by Psyche
    Oh, well role pms would be even easier, maybe 5 lines of code from what I have now.
    I'll release it with the votecounter / bot module as a demo of how to use the latter and way to test out different interfaces for the client-side application/extension.

    Posted: Mon Apr 30, 2018 4:34 pm
    by Lycanfire
    i was a pretty heavy user of mathblade's wagon data tool in team mafia white flag

    it's useful but i don't think the mod should be doing vca for people

    Posted: Mon Apr 30, 2018 4:53 pm
    by Mathdino
    i mean i personally think it should just be the players' job whether or not to call the wagon data tool

    it's (i think) open source, it's literally a couple buttons away in order to get it

    Posted: Mon Apr 30, 2018 8:04 pm
    by Psyche
    could initially require a setup.txt file like

    Code: Select all

    Players:
    Psyche
    Alisae
    ...
    Mathdino
    Lycanfire
    
    Roles:
    Role Name: (text)
    Alignment: (text)
    Custom: """multiline
    text"""
    Win Condition 1: (text)
    Win Condition 2: (text)
    Ability 1:
    Ability 2:
    
    ...
    
    Role PM Template:
    Welcome, {Player Name}! You are a [b]{Role Name}[/b]. 
    
    {Custom}
    
    [b]Abilities:[/b]
    [list]
    [*]{Ability }
    [/list]
    [b]Win Conditions:[/b]
    [list]
    [*]{Win Condition }
    [/list]


    Basically, you start with a player list under "Players:". Then you have a roles list under "Roles:" where you associate each role with role-specific information that will then populate a role pm template. Under "Role PM Template" you specify said template. The result is a document that can be straightforwardly read and shared with others for pre- or post-game review on the one hand, and passed to a bot for automated activity on the other. Eventually, I can add headers for votecount templating and so on.

    Let me elaborate how I think the roles section could interface with the Role PM Template section. In the roles section, you define content specific to each role by associating a set of tags with role-specific content. You have total freedom over defining exactly what these tags are. Instead of having any "Ability" tag like above, for example, you could have a "Power" tag, or "Custom" could instead be "Flavor". Later, in your role pm template, you reference these tags with "{<tag>}" to indicate that you want the tag placed here in your template.

    What's important is that every role in the roles section have the same set of tags, with some exceptions. These exceptions are as follows:
    - If you don't specify a tag for a role but the tag is referenced in the template, the bot will just ignore the line associated with that tag when generating a pm for that role. In the example setup.txt above, for instance, if "Custom" isn't specified for a role, then the entire line associated with {Custom} will just be ignored, and there'll be a two line gap between the "Welcome" line and the "Abilities" line.
    - For tags that you want there to be a variable number of in between roles (ex a variable number of abilities or win conditions), just use the same name for each tag except with the tag's indexing appended to the end of the name ("Ability 1, Ability 2"). If your template ever refers just to {Ability } (the space would be important to include here), then a processed pm for a role with multiple "Ability " tags will produce a line for each one of those with the formatting you specify in the template and order them according to your included index. In the example above, for instance, the result would be a list of 2 abilities and a list of 2 win conditions. If you need any formatting to occur uniquely to one of the instances in a set of tags, just include that formatting when you initially specify the instance of that set in the roles section.

    Finally, if you want the content associated with a tag to span more than one line, you need to wrap that in triple quotation marks, as is demonstrated in the "Custom" tag for one role in the example above.

    I know I just typed a lot, but if you look at the example above, it seems like all this is pretty intuitive? idk

    Posted: Mon Apr 30, 2018 8:11 pm
    by Psyche
    would be too much to ask people to write json files, right? https://cdn-images-1.medium.com/max/160 ... pyFSkw.png

    Posted: Mon Apr 30, 2018 10:27 pm
    by BBmolla
    Everything listed sounds great.

    This is sort of separate probably, but is there a possible way someone could code a simple "auto night action resolver?" I know I fuck up NAR all the time and the existence of one would make large role madness games plausible.

    If this already exists, link me.

    Posted: Mon Apr 30, 2018 11:51 pm
    by Korts
    In post 9, Psyche wrote:would be too much to ask people to write json files, right? https://cdn-images-1.medium.com/max/160 ... pyFSkw.png
    JSON takes like five minutes to learn, I think that would be a cool setup configuration tool actually. All it needs is a template and a manual.

    Posted: Tue May 01, 2018 2:27 am
    by Flubbernugget
    This is all python right? I could whip up a gui for whatever json syntax you specify with tkinter or something similar.

    If it's a web gui I have less experience but would still be more than willing to give it a shot.

    Posted: Tue May 01, 2018 11:46 am
    by callforjudgement
    Back when I used a browser extension to do votecounts (which has since broken, maybe I should try to get it working again some time), it was much more convenient UI-wise for the mod than any other interface I've used.

    However, things like web-based vote counters are more convenient for players doing the counting themselves (as they won't have access to state stored in the moderator's browser).

    Posted: Tue May 01, 2018 1:19 pm
    by MathBlade
    In post 6, Lycanfire wrote:i was a pretty heavy user of mathblade's wagon data tool in team mafia white flag

    it's useful but i don't think the mod should be doing vca for people
    It doesn’t do VCA

    It just aligns the votes in a different way.

    It doesn’t and cannot take in the alignment of players.

    It only spits out the wagons that existed.

    It is still up to the players to do the analysis.

    All it does is take 100% accessible information and then spit it out in a different way.

    Posted: Tue May 01, 2018 1:20 pm
    by MathBlade
    In post 10, BBmolla wrote:Everything listed sounds great.

    This is sort of separate probably, but is there a possible way someone could code a simple "auto night action resolver?" I know I fuck up NAR all the time and the existence of one would make large role madness games plausible.

    If this already exists, link me.
    NAR is getting started on my mafia bot

    The main problem is a lot of people already have their stuff and so when I have mine it feels awkward.

    Right now I have manual entry til I can finish the skeleton for basic roles.

    Posted: Tue May 01, 2018 1:22 pm
    by MathBlade
    In post 8, Psyche wrote:could initially require a setup.txt file like

    Code: Select all

    Players:
    Psyche
    Alisae
    ...
    Mathdino
    Lycanfire
    
    Roles:
    Role Name: (text)
    Alignment: (text)
    Custom: """multiline
    text"""
    Win Condition 1: (text)
    Win Condition 2: (text)
    Ability 1:
    Ability 2:
    
    ...
    
    Role PM Template:
    Welcome, {Player Name}! You are a [b]{Role Name}[/b]. 
    
    {Custom}
    
    [b]Abilities:[/b]
    [list]
    [*]{Ability }
    [/list]
    [b]Win Conditions:[/b]
    [list]
    [*]{Win Condition }
    [/list]


    Basically, you start with a player list under "Players:". Then you have a roles list under "Roles:" where you associate each role with role-specific information that will then populate a role pm template. Under "Role PM Template" you specify said template. The result is a document that can be straightforwardly read and shared with others for pre- or post-game review on the one hand, and passed to a bot for automated activity on the other. Eventually, I can add headers for votecount templating and so on.

    Let me elaborate how I think the roles section could interface with the Role PM Template section. In the roles section, you define content specific to each role by associating a set of tags with role-specific content. You have total freedom over defining exactly what these tags are. Instead of having any "Ability" tag like above, for example, you could have a "Power" tag, or "Custom" could instead be "Flavor". Later, in your role pm template, you reference these tags with "{<tag>}" to indicate that you want the tag placed here in your template.

    What's important is that every role in the roles section have the same set of tags, with some exceptions. These exceptions are as follows:
    - If you don't specify a tag for a role but the tag is referenced in the template, the bot will just ignore the line associated with that tag when generating a pm for that role. In the example setup.txt above, for instance, if "Custom" isn't specified for a role, then the entire line associated with {Custom} will just be ignored, and there'll be a two line gap between the "Welcome" line and the "Abilities" line.
    - For tags that you want there to be a variable number of in between roles (ex a variable number of abilities or win conditions), just use the same name for each tag except with the tag's indexing appended to the end of the name ("Ability 1, Ability 2"). If your template ever refers just to {Ability } (the space would be important to include here), then a processed pm for a role with multiple "Ability " tags will produce a line for each one of those with the formatting you specify in the template and order them according to your included index. In the example above, for instance, the result would be a list of 2 abilities and a list of 2 win conditions. If you need any formatting to occur uniquely to one of the instances in a set of tags, just include that formatting when you initially specify the instance of that set in the roles section.

    Finally, if you want the content associated with a tag to span more than one line, you need to wrap that in triple quotation marks, as is demonstrated in the "Custom" tag for one role in the example above.

    I know I just typed a lot, but if you look at the example above, it seems like all this is pretty intuitive? idk
    I would caution against a setup.txt and do a full UI

    Players already have trouble with my simpler one.
    JSON or that format may be a bit too much

    Posted: Tue May 01, 2018 1:23 pm
    by MathBlade
    The other last warning I would recommend is DDOS defense

    I have a troll that bombs the shit out of mine to the point where I had to make a DB for it :/ just can’t find said troll

    Posted: Tue May 01, 2018 2:55 pm
    by GreenLiquid
    First off, I wanted to say I'm really excited to see this, and I also want to thank you, Psyche, for encouraging me to start learning Python. I really enjoy the language and I probably wouldn't have tried it if you hadn't suggested it to me like 6 months ago.
    In post 9, Psyche wrote:would be too much to ask people to write json files, right? https://cdn-images-1.medium.com/max/160 ... pyFSkw.png
    I think JSON is the way to go, not only because it's not terribly difficult to encode data in that format, but also because it'll make life easier if anyone ever wants to hook this module into other modules. And also because mine specifically uses JSON :P
    But I think Math is right that a UI is going to be valuable. I imagine it's not too hard to set up a UI that takes in setup inputs and spits out the JSON the vote counter needs.

    A couple of things I'd suggest for the setup file, based on what I've set up in my own module:
    - It would be a good idea for the setup to have a "mods" list, that way you can account for having co-mods and backup mods and the like. This could help the scraper avoid counting things that look like votes from any mod players.
    - For players as well, to deal with hydrae it would be a good idea to have "aliases" or something of the sort.

    Posted: Tue May 01, 2018 3:51 pm
    by Psyche
    i didn't really consider that there might be much interest from others to contribute to the project, and that's great
    eventually we'll agree on a framework for modularizing/interfacing our separate contributions in a way that doesn't step on any toes
    the idea is to make it so no matter when any one person steps in or out of this project, their contributions can be easily appropriated by someone else who wants to build off their work or even take it in an entirely different direction, and vice versa - or on the other hand completely abandoned and not be necessary in order to benefit from some other part of the code base
    right now we're trying to make something that serves a specific end (automated votecount preparation and so on), but the stuff we're coding could easily be marshalled to design tools for scumhunting, behavioral research, and who knows what else
    i'm not very experienced with collaborative coding and may be a little jealous or embarassed of my work, but i think that if we stick to this broad vision, we can collaborate without giving up our independence and feel confident that something useful will come out of our work

    sry i typed this because i thought separating the representation of setup information from the interface specifying it was such a great idea

    Posted: Wed May 02, 2018 2:40 am
    by Psyche
    http://futurama.wikia.com/wiki/Donbot

    what if we name it after this guy

    Posted: Wed May 02, 2018 3:47 am
    by Psyche
    now maintaining in the op a list of efforts on radar aside from the the votecount pagetopper; feel free to suggest new things as interested
    i've always been interested in developing tools for analyzing games, but for the moment i'll do what i can to stay focused

    of those listed atm, Simultaneous/templated role PMs, Auto-prodding, and Thread (Un)Locking are the ones most easily extensible from the current focus of Automated Votecounting
    i believe that one of these might be a good start for someone interested in contributing to the project once i set up the initial modules on github

    Posted: Wed May 02, 2018 10:40 am
    by Psyche
    https://github.com/MafiaScum-Unofficial/modbot

    the repository is started
    has module for automating site interactions
    votecounter and votecountertester next

    Posted: Wed May 02, 2018 2:32 pm
    by vonflare
    ego to remind me to post here later

    Posted: Wed May 02, 2018 3:51 pm
    by GreenLiquid
    This is already looking pretty cool!
    I don't have any knowledge about how to automate operations to the forum, such as posting and whatnot, but the bit I've been working on is intended to be able to store a "game state" which can be modified by passing events to it, like "Player A votes for Player B" and stuff like that. I also have a thing for automatically generating vote counts, the player list, the list of events in the first/second post, and the alive/dead/modkilled lists. I'm in the middle of rewriting stuff so it's not really in a suitable state to use at the moment but I would be happy to share what I have when I'm done in like a week or so. You might be able to scavenge some useful code out of it for the project.