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

This forum is for discussion related to the game.
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10049
Joined: April 28, 2011
Pronoun: he/they

Post Post #200 (ISO) » Wed May 30, 2018 5:21 am

Post by Psyche »

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.
youtube playlist extracter | donbot | game scraper | vca | setupsim | strategist | llm
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10049
Joined: April 28, 2011
Pronoun: he/they

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

Post by Psyche »

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)
youtube playlist extracter | donbot | game scraper | vca | setupsim | strategist | llm
User avatar
schadd_
schadd_
he/it
pandora's pukebox
User avatar
User avatar
schadd_
he/it
pandora's pukebox
pandora's pukebox
Posts: 7852
Joined: December 28, 2016
Pronoun: he/it
Location: mountain bathroom

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

Post by schadd_ »

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
free darius mccollum
todays featured user: shaft.ed

User avatar
yessiree
yessiree
he
Mafia Scum
User avatar
User avatar
yessiree
he
Mafia Scum
Mafia Scum
Posts: 4349
Joined: June 6, 2013
Pronoun: he

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

Post by yessiree »

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
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10049
Joined: April 28, 2011
Pronoun: he/they

Post Post #204 (ISO) » Wed May 30, 2018 6:10 am

Post by Psyche »

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
youtube playlist extracter | donbot | game scraper | vca | setupsim | strategist | llm
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10049
Joined: April 28, 2011
Pronoun: he/they

Post Post #205 (ISO) » Wed May 30, 2018 7:41 am

Post by Psyche »

youtube playlist extracter | donbot | game scraper | vca | setupsim | strategist | llm
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10049
Joined: April 28, 2011
Pronoun: he/they

Post Post #206 (ISO) » Wed May 30, 2018 8:14 am

Post by Psyche »

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
youtube playlist extracter | donbot | game scraper | vca | setupsim | strategist | llm
User avatar
yessiree
yessiree
he
Mafia Scum
User avatar
User avatar
yessiree
he
Mafia Scum
Mafia Scum
Posts: 4349
Joined: June 6, 2013
Pronoun: he

Post Post #207 (ISO) » Wed May 30, 2018 9:27 am

Post by yessiree »

very cool
User avatar
yessiree
yessiree
he
Mafia Scum
User avatar
User avatar
yessiree
he
Mafia Scum
Mafia Scum
Posts: 4349
Joined: June 6, 2013
Pronoun: he

Post Post #208 (ISO) » Wed May 30, 2018 9:30 am

Post by yessiree »

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
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10049
Joined: April 28, 2011
Pronoun: he/they

Post Post #209 (ISO) » Wed May 30, 2018 10:02 am

Post by Psyche »

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
youtube playlist extracter | donbot | game scraper | vca | setupsim | strategist | llm
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10049
Joined: April 28, 2011
Pronoun: he/they

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

Post by Psyche »

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)
youtube playlist extracter | donbot | game scraper | vca | setupsim | strategist | llm
User avatar
callforjudgement
callforjudgement
Microprocessor
User avatar
User avatar
callforjudgement
Microprocessor
Microprocessor
Posts: 3972
Joined: September 1, 2011

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

Post by callforjudgement »

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
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10049
Joined: April 28, 2011
Pronoun: he/they

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

Post by Psyche »

yeah ok
youtube playlist extracter | donbot | game scraper | vca | setupsim | strategist | llm
User avatar
yessiree
yessiree
he
Mafia Scum
User avatar
User avatar
yessiree
he
Mafia Scum
Mafia Scum
Posts: 4349
Joined: June 6, 2013
Pronoun: he

Post Post #213 (ISO) » Thu May 31, 2018 8:48 am

Post by yessiree »

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
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10049
Joined: April 28, 2011
Pronoun: he/they

Post Post #214 (ISO) » Thu May 31, 2018 8:59 am

Post by Psyche »

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?
youtube playlist extracter | donbot | game scraper | vca | setupsim | strategist | llm
User avatar
yessiree
yessiree
he
Mafia Scum
User avatar
User avatar
yessiree
he
Mafia Scum
Mafia Scum
Posts: 4349
Joined: June 6, 2013
Pronoun: he

Post Post #215 (ISO) » Thu May 31, 2018 9:17 am

Post by yessiree »

I dont think I have edit permission in the doc you linked me so I thought you were gonna abandon it
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10049
Joined: April 28, 2011
Pronoun: he/they

Post Post #216 (ISO) » Thu May 31, 2018 9:25 am

Post by Psyche »

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
youtube playlist extracter | donbot | game scraper | vca | setupsim | strategist | llm
User avatar
yessiree
yessiree
he
Mafia Scum
User avatar
User avatar
yessiree
he
Mafia Scum
Mafia Scum
Posts: 4349
Joined: June 6, 2013
Pronoun: he

Post Post #217 (ISO) » Thu May 31, 2018 9:27 am

Post by yessiree »

yea that works
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10049
Joined: April 28, 2011
Pronoun: he/they

Post Post #218 (ISO) » Thu May 31, 2018 9:33 am

Post by Psyche »

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
youtube playlist extracter | donbot | game scraper | vca | setupsim | strategist | llm
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10049
Joined: April 28, 2011
Pronoun: he/they

Post Post #219 (ISO) » Sun Jun 10, 2018 10:25 pm

Post by Psyche »

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.
youtube playlist extracter | donbot | game scraper | vca | setupsim | strategist | llm
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10049
Joined: April 28, 2011
Pronoun: he/they

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

Post by Psyche »

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
youtube playlist extracter | donbot | game scraper | vca | setupsim | strategist | llm
User avatar
yessiree
yessiree
he
Mafia Scum
User avatar
User avatar
yessiree
he
Mafia Scum
Mafia Scum
Posts: 4349
Joined: June 6, 2013
Pronoun: he

Post Post #221 (ISO) » Thu Jun 21, 2018 8:57 am

Post by yessiree »

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 :)
Post Reply

Return to “Mafia Discussion”