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

This forum is for discussion related to the game.
Psyche
mr. personality
 
User avatar
Joined: April 28, 2011
Location: pacing the road to damascus
Pronoun: He

Post Post #0  (ISO)  » Mon Apr 30, 2018 5:32 pm

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.
Last edited by Psyche on Wed May 30, 2018 3:50 am, edited 10 times in total.
"Listen well - to be human is to be an eternal wanderer. It's up to you to discover the new vistas of life. No one else will clear the way!"

Psyche
mr. personality
 
User avatar
Joined: April 28, 2011
Location: pacing the road to damascus
Pronoun: He

Post Post #1  (ISO)  » Mon Apr 30, 2018 5:32 pm

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
Last edited by Psyche on Tue May 15, 2018 2:06 pm, edited 4 times in total.
"Listen well - to be human is to be an eternal wanderer. It's up to you to discover the new vistas of life. No one else will clear the way!"

Alisae
lolbalance
 
User avatar
Joined: October 31, 2016
Location: Cali~ (PST)
Pronoun: E (e/em/eir/eirs/emself)

Post Post #2  (ISO)  » Mon Apr 30, 2018 5:39 pm

If this collected wagon data and recorded how many posts that person made in a day phase that would be neat!
Ali Plays! Pokemon Rejuv, Pokemon Clear Crystal
Feel free to approach me on discord: Alisae#3437
I wanna get to know an Alisae! Part 1 | Part 2

Psyche
mr. personality
 
User avatar
Joined: April 28, 2011
Location: pacing the road to damascus
Pronoun: He

Post Post #3  (ISO)  » Mon Apr 30, 2018 5:44 pm

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.
"Listen well - to be human is to be an eternal wanderer. It's up to you to discover the new vistas of life. No one else will clear the way!"

Mathdino
Survivor
 
User avatar
Joined: February 24, 2013
Location: Right Behind You
Pronoun: He

Post Post #4  (ISO)  » Mon Apr 30, 2018 10:04 pm

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.

Psyche
mr. personality
 
User avatar
Joined: April 28, 2011
Location: pacing the road to damascus
Pronoun: He

Post Post #5  (ISO)  » Mon Apr 30, 2018 10:18 pm

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.
"Listen well - to be human is to be an eternal wanderer. It's up to you to discover the new vistas of life. No one else will clear the way!"

Lycanfire
Mafia Scum
 
User avatar
Joined: June 04, 2016
Pronoun: It

Post Post #6  (ISO)  » Mon Apr 30, 2018 10:34 pm

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

Mathdino
Survivor
 
User avatar
Joined: February 24, 2013
Location: Right Behind You
Pronoun: He

Post Post #7  (ISO)  » Mon Apr 30, 2018 10:53 pm

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

Psyche
mr. personality
 
User avatar
Joined: April 28, 2011
Location: pacing the road to damascus
Pronoun: He

Post Post #8  (ISO)  » Tue May 01, 2018 2:04 am

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
"Listen well - to be human is to be an eternal wanderer. It's up to you to discover the new vistas of life. No one else will clear the way!"

Psyche
mr. personality
 
User avatar
Joined: April 28, 2011
Location: pacing the road to damascus
Pronoun: He

Post Post #9  (ISO)  » Tue May 01, 2018 2:11 am

would be too much to ask people to write json files, right? https://cdn-images-1.medium.com/max/160 ... pyFSkw.png
"Listen well - to be human is to be an eternal wanderer. It's up to you to discover the new vistas of life. No one else will clear the way!"

BBmolla
Open Book
 
User avatar
Joined: May 29, 2011
Pronoun: He

Post Post #10  (ISO)  » Tue May 01, 2018 4:27 am

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.

Korts
Luddite
 
User avatar
Joined: January 01, 2008
Location: On a high horse
Pronoun: He

Post Post #11  (ISO)  » Tue May 01, 2018 5:51 am

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.
Fight me, dumbass.

FlubbernuggetHappy Birthday!
Survivor
 
User avatar
Joined: June 26, 2014
Pronoun: He

Post Post #12  (ISO)  » Tue May 01, 2018 8:27 am

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.

callforjudgement
Microprocessor
 
User avatar
Joined: September 01, 2011

Post Post #13  (ISO)  » Tue May 01, 2018 5:46 pm

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).
scum · scam · seam · team · term · tern · torn · town

MathBlade
Technical Support
 
User avatar
Joined: September 09, 2013
Location: Western US
Pronoun: He

Post Post #14  (ISO)  » Tue May 01, 2018 7:19 pm

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.
ScumBlade's eloquent performance left me utterly disoriented, debased, depraved and sent me spiraling into a horrific murky abyss with emotional turmoil and immense despair as my only companions until slowly I suffocate in my own gloom, surrounded by failure. I will never recover. -- Zachstralkita about Mini 1841
GTKAS -- MathBlade

MathBlade
Technical Support
 
User avatar
Joined: September 09, 2013
Location: Western US
Pronoun: He

Post Post #15  (ISO)  » Tue May 01, 2018 7:20 pm

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.
ScumBlade's eloquent performance left me utterly disoriented, debased, depraved and sent me spiraling into a horrific murky abyss with emotional turmoil and immense despair as my only companions until slowly I suffocate in my own gloom, surrounded by failure. I will never recover. -- Zachstralkita about Mini 1841
GTKAS -- MathBlade

MathBlade
Technical Support
 
User avatar
Joined: September 09, 2013
Location: Western US
Pronoun: He

Post Post #16  (ISO)  » Tue May 01, 2018 7:22 pm

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
ScumBlade's eloquent performance left me utterly disoriented, debased, depraved and sent me spiraling into a horrific murky abyss with emotional turmoil and immense despair as my only companions until slowly I suffocate in my own gloom, surrounded by failure. I will never recover. -- Zachstralkita about Mini 1841
GTKAS -- MathBlade

MathBlade
Technical Support
 
User avatar
Joined: September 09, 2013
Location: Western US
Pronoun: He

Post Post #17  (ISO)  » Tue May 01, 2018 7:23 pm

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
ScumBlade's eloquent performance left me utterly disoriented, debased, depraved and sent me spiraling into a horrific murky abyss with emotional turmoil and immense despair as my only companions until slowly I suffocate in my own gloom, surrounded by failure. I will never recover. -- Zachstralkita about Mini 1841
GTKAS -- MathBlade

GreenLiquid
Mafia Scum
 
User avatar
Joined: July 16, 2005
Pronoun: He

Post Post #18  (ISO)  » Tue May 01, 2018 8:55 pm

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.
Avatar courtesy of Chickadee! | GTKAL

Psyche
mr. personality
 
User avatar
Joined: April 28, 2011
Location: pacing the road to damascus
Pronoun: He

Post Post #19  (ISO)  » Tue May 01, 2018 9:51 pm

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
"Listen well - to be human is to be an eternal wanderer. It's up to you to discover the new vistas of life. No one else will clear the way!"

Psyche
mr. personality
 
User avatar
Joined: April 28, 2011
Location: pacing the road to damascus
Pronoun: He

Post Post #20  (ISO)  » Wed May 02, 2018 8:40 am

http://futurama.wikia.com/wiki/Donbot

what if we name it after this guy
"Listen well - to be human is to be an eternal wanderer. It's up to you to discover the new vistas of life. No one else will clear the way!"

Psyche
mr. personality
 
User avatar
Joined: April 28, 2011
Location: pacing the road to damascus
Pronoun: He

Post Post #21  (ISO)  » Wed May 02, 2018 9:47 am

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
"Listen well - to be human is to be an eternal wanderer. It's up to you to discover the new vistas of life. No one else will clear the way!"

Psyche
mr. personality
 
User avatar
Joined: April 28, 2011
Location: pacing the road to damascus
Pronoun: He

Post Post #22  (ISO)  » Wed May 02, 2018 4:40 pm

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

the repository is started
has module for automating site interactions
votecounter and votecountertester next
"Listen well - to be human is to be an eternal wanderer. It's up to you to discover the new vistas of life. No one else will clear the way!"

vonflare
doot
 
User avatar
Joined: January 01, 2014
Location: The divine realm of the round table, Camelot
Pronoun: He

Post Post #23  (ISO)  » Wed May 02, 2018 8:32 pm

ego to remind me to post here later
wryyy

GreenLiquid
Mafia Scum
 
User avatar
Joined: July 16, 2005
Pronoun: He

Post Post #24  (ISO)  » Wed May 02, 2018 9:51 pm

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.
Avatar courtesy of Chickadee! | GTKAL

Next
[ + ]

Return to Mafia Discussion