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 #200  (ISO)  » Wed May 30, 2018 11:21 am

In google colab’s code snippets section i see javascript variables somehow being passed to python variables using a specialized python module created just for colab
If I can just find a way to get that to work for javascript code enmeshed in HTML it might work
I’ll let you know when I give up or pull it off.
sufjan's gonna write a song about me

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

Post Post #201  (ISO)  » Wed May 30, 2018 11:28 am

One less amazing thing we can do that seems like a more surefire option is use colab’s support for passing Python functions to javascript to essentially do everything my flask server does within the notebook, but that would be akin to giving up my “blur the line between documentation and computation” or whatever idea if we can’t also pass javascript variables the way I’d like to.

Also one thing I did find capability for even if we can’t automatically edit notebooks in realtime is that we can definitely “read” the notebook in realtime. What this means is that we can have mods complete forms within clean markdown cells instead of python code cells, an experience a lot cleaner UIwise (more equivalent to editting a feature-lite word document than to writing code)
sufjan's gonna write a song about me

schadd_
Smooth Operator
Smooth Operator
 
User avatar
Joined: December 28, 2016
Location: out front
Pronoun: He

Post Post #202  (ISO)  » Wed May 30, 2018 11:46 am

In post 196, Psyche wrote:Ok, this turned out to be easy thanks to how amazing Google Colab is.

yeah, i mean i guess we're not paying you
mbos6. day 4.
todays featured user: Papa Zito

what love got to do with it when you don't love yourself?

yessiree
Mafia Scum
 
User avatar
Joined: June 06, 2013
Pronoun: He

Post Post #203  (ISO)  » Wed May 30, 2018 11:54 am

why don't we just read/write history in a google spreadsheet instead? seems like there is support for that

i mean we don't have to do it all within one notebook

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

Post Post #204  (ISO)  » Wed May 30, 2018 12:10 pm

We may need sheets for something, but not this part, I don’t think.
Anyway, I’ll send you a demo of how we can pass form data in html to python variables quite soon
sufjan's gonna write a song about me

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

Post Post #205  (ISO)  » Wed May 30, 2018 1:41 pm

sufjan's gonna write a song about me

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

Post Post #206  (ISO)  » Wed May 30, 2018 2:14 pm

With this module that enables this conversation between Javascript and Python, I'm really excited about Google Colab now; it seems amazing.

Anyway, like I said before, this opens the door for loads of agency on our part over how we solicit input from users, as well as over what happens next. What we basically have thanks to Google Colab is a really neat mesh between frontend and backend I don't think we could find anywhere else. Only hitch is that users will have to connect to their runtime and initiate cells themselves. And, of course, authenticate through Google Drive.

I imagine we can set up a situation where they just run all cells at once after they connect their kernel (Ctrl + F9 is the hotkey for this by default), and checkbox forms overlayed over code cells (kind of like how I overlayed a MS Login form over code in my first demo of this) deciding which code actually gets executed when Run All gets called. Or something like that, we'll feel it out. The result of something like this is that relevant HTML/JavaScript forms will be rendered in combo with the Python functions supporting them and that there'll be some sort of stopgap helping prevent mods from running code that they don't want to.

I totally agree that sensitive information would ideally be stored in some structured spreadsheet in the user's Google Drive folder, but there are some downsides to this approach. First, the process of authenticating a notebook to access a user's Google Drive is somewhat onerous. You have to click a link, click another button, copy a string opened in a new tab, and then paste it back into your notebook and press Enter. It would in most cases actually be easier for users to upload a file every time they use the notebook - which is another way of saying it's too much.

Another option I like is to feel okay making users submit their mafiascum login info (this time more securely than what I offered in my initial demo) every time they use the notebook and discarding that info when they're done using the notebook. It is, after all, what happens every time one of us uses the site (and it's possible we can structure our html/javascript such that our password managers make this even easier). If there's other information we don't want saved in the notebook besides this login info, we can have the user save it somewhere private to their mafiascum account - as a draft of a post or a PM they send themselves and then scrape it. But honestly at this specific moment I can't think of anything besides their mafiascum info we'd need beyond what the notebook is specifically supposed to record.

***

EDIT:
confirmed that the password manager build into chrome will detect and offer to save your login info for a game notebook, making logging in not at all difficult
sufjan's gonna write a song about me

yessiree
Mafia Scum
 
User avatar
Joined: June 06, 2013
Pronoun: He

Post Post #207  (ISO)  » Wed May 30, 2018 3:27 pm

very cool

yessiree
Mafia Scum
 
User avatar
Joined: June 06, 2013
Pronoun: He

Post Post #208  (ISO)  » Wed May 30, 2018 3:30 pm

In post 189, yessiree wrote:I'm completely new to this but I think python-javascript resource sharing is possible, so you can do stuff like: getting web resources with python, then letting javascript handle any html parsing work, storing the result texts, then accessing those results from the python side again, etc...


this is definitely possible then

imo javascript is the best tool to parse HTML

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

Post Post #209  (ISO)  » Wed May 30, 2018 4:02 pm

yeah, totally
i just pmed you a draft i'm working on of an interface we can do
i'm trying to think big - imagining where functionality might fit, even if we don't have it yet
i think you might be in a better spot to think about actual UI though given your JS experience
it would be pretty easy for us tow ork on it concurrently
sufjan's gonna write a song about me

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

Post Post #210  (ISO)  » Wed May 30, 2018 9:30 pm

am thinking we can use the user's PM Inbox as our place to store variables (besides their username/password, which shouldn't be stored anywhere) that we want to persist beyond runtime, as well as for soliciting input that the user has already generated outside of modbot (eg if they've already written a set of role pms and just want help distributing them)

ok, am thinking ill take another break from this, but here's the sort of interface i'm going for:
https://colab.research.google.com/drive ... dZkaT02HVF

there're a lot of details left to handle, and i'll try to focus on the key stuff, but this'll be fun, and i imagine i'll be more motivated to work through it once i start modding my game (when I'll probably have to keep my work a bit more private)
sufjan's gonna write a song about me

callforjudgement
Microprocessor
 
User avatar
Joined: September 01, 2011

Post Post #211  (ISO)  » Wed May 30, 2018 10:27 pm

Why not use a private topic? Most human mods keep a mod topic, and I don't see why a bot mod would need a different method. (A bonus is that you can open it up after the game's over to show what the modbot was thinking.)
scum · scam · seam · team · term · tern · torn · town

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

Post Post #212  (ISO)  » Wed May 30, 2018 10:47 pm

yeah ok
sufjan's gonna write a song about me

yessiree
Mafia Scum
 
User avatar
Joined: June 06, 2013
Pronoun: He

Post Post #213  (ISO)  » Thu May 31, 2018 2:48 pm

im just gonna jot down a list of things im doing so we dont have duplicated efforts
1. Make a more efficient version of pagetopper that leverages the google colab vm
2. Integrates it with ur version of votecounter
3. UI mocks

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

Post Post #214  (ISO)  » Thu May 31, 2018 2:59 pm

oh ok, you wanna work in separate docs then, eh?
maybe we can at least have a shared folder? or do you want to be careful not to accidentally expose user info, etc?
sufjan's gonna write a song about me

yessiree
Mafia Scum
 
User avatar
Joined: June 06, 2013
Pronoun: He

Post Post #215  (ISO)  » Thu May 31, 2018 3:17 pm

I dont think I have edit permission in the doc you linked me so I thought you were gonna abandon it

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

Post Post #216  (ISO)  » Thu May 31, 2018 3:25 pm

oh right i might have accidentally editted permissions so i could share it with testers
seems we'll want to maintain a dev and a demo version separately, which is sort is sort of obvious a thing to say now that i think of it
sufjan's gonna write a song about me

yessiree
Mafia Scum
 
User avatar
Joined: June 06, 2013
Pronoun: He

Post Post #217  (ISO)  » Thu May 31, 2018 3:27 pm

yea that works

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

Post Post #218  (ISO)  » Thu May 31, 2018 3:33 pm

Think it might be worthwhile to move our chat to the MS slack server so we can talk in realtime about a few things
Ill send you an invite soon
sufjan's gonna write a song about me

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

Post Post #219  (ISO)  » Mon Jun 11, 2018 4:25 am

Hi guys.

So, some updates. I've been trying out the google colab-based votecounter and while it's better and easier to use than the flask app I previously made, it remains a relatively clunky experience that I don't think manages to be ideal. There's still too much navigation and clicking involved for something that we'd rather be a mostly one-off affair.

Consequently, I'm now going to try implementing modbot as a browser extension - probably chrome to start off with since that browser's the most popular. As I said before, the biggest barrier to this approach has always been the problem of finding a good substitute for the pyenchant library, a spellchecker I use to test whether substrings of player usernames are legal english words. I don't know why I thought it would be so hard to find such a thing, there are tons of javascript-based options for spell-checking, and I can make them work pretty quickly if they're installed to the user's as part of a browser extension.

So action items are...
1. Study what goes into making a browser extension,
2. <ake sure they have the capabilities that I think they / need them to have
3. Use a tool like Brython to translate our codebase into the needed language
4. Testing
4. Write another interface
5. ???

Think big milestone will be a chrome extension that makes posts.
sufjan's gonna write a song about me

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

Post Post #220  (ISO)  » Sun Jun 17, 2018 8:51 pm

have nearly finished adding function to donbot for editting posts (necessary for keeping SUPP feedback thread updated)
a bit colder on the javascript idea atm, but maybe im just lazy
sufjan's gonna write a song about me

yessiree
Mafia Scum
 
User avatar
Joined: June 06, 2013
Pronoun: He

Post Post #221  (ISO)  » Thu Jun 21, 2018 2:57 pm

Hey, haven't spent nearly as much time as I'd have liked, but I have the bootstrapping part done for converting the codebase to JS.

https://github.com/blookvoodow/modbotjs

It's a NodeJS app. So you would need to install Node to run this.

I've finished authentication. Fortunately NPM's request package is similar to the requests package we used in python, so we get persisting cookies between requests (authenticate once and done). This means everything that was done in python is possible in NodeJs, so converting the codebase to Js should only be a matter of time.

contributors welcome :)

Previous
[ + ]

Return to Mafia Discussion