Modbot to Help You Run Games: Now With A Votecounter Demo!
-
-
Psyche he/theySurvivorhe/they
- Survivor
- Survivor
- Posts: 10751
- Joined: April 28, 2011
- Pronoun: he/they
- Happy Scumday!
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.-
-
Psyche he/theySurvivorhe/they
- Survivor
- Survivor
- Posts: 10751
- Joined: April 28, 2011
- Pronoun: he/they
- Happy Scumday!
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)-
-
schadd_ he/itpandora's pukeboxhe/it
- pandora's pukebox
- pandora's pukebox
- Posts: 7890
- Joined: December 28, 2016
- Pronoun: he/it
- Location: mountain bathroom
yeah, i mean i guessIn post 196, Psyche wrote:Ok, this turned out to be easy thanks to how amazing Google Colab is.we'renot paying you-
-
yessiree heMafia Scumhe
- Mafia Scum
- Mafia Scum
- Posts: 4389
- Joined: June 6, 2013
- Pronoun: he
-
-
Psyche he/theySurvivorhe/they
- Survivor
- Survivor
- Posts: 10751
- Joined: April 28, 2011
- Pronoun: he/they
- Happy Scumday!
-
-
Psyche he/theySurvivorhe/they
- Survivor
- Survivor
- Posts: 10751
- Joined: April 28, 2011
- Pronoun: he/they
- Happy Scumday!
-
-
Psyche he/theySurvivorhe/they
- Survivor
- Survivor
- Posts: 10751
- Joined: April 28, 2011
- Pronoun: he/they
- Happy Scumday!
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-
-
yessiree heMafia Scum
-
-
yessiree heMafia Scumhe
- Mafia Scum
- Mafia Scum
- Posts: 4389
- Joined: June 6, 2013
- Pronoun: he
this is definitely possible thenIn 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...
imo javascript is the best tool to parse HTML-
-
Psyche he/theySurvivorhe/they
- Survivor
- Survivor
- Posts: 10751
- Joined: April 28, 2011
- Pronoun: he/they
- Happy Scumday!
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-
-
Psyche he/theySurvivorhe/they
- Survivor
- Survivor
- Posts: 10751
- Joined: April 28, 2011
- Pronoun: he/they
- Happy Scumday!
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)-
-
callforjudgement Microprocessor
- Microprocessor
- Microprocessor
- Posts: 3972
- Joined: September 1, 2011
-
-
Psyche he/theySurvivorhe/they
- Survivor
- Survivor
- Posts: 10751
- Joined: April 28, 2011
- Pronoun: he/they
- Happy Scumday!
-
-
yessiree heMafia Scumhe
- Mafia Scum
- Mafia Scum
- Posts: 4389
- Joined: June 6, 2013
- Pronoun: he
-
-
Psyche he/theySurvivorhe/they
- Survivor
- Survivor
- Posts: 10751
- Joined: April 28, 2011
- Pronoun: he/they
- Happy Scumday!
-
-
yessiree heMafia Scumhe
- Mafia Scum
- Mafia Scum
- Posts: 4389
- Joined: June 6, 2013
- Pronoun: he
-
-
Psyche he/theySurvivorhe/they
- Survivor
- Survivor
- Posts: 10751
- Joined: April 28, 2011
- Pronoun: he/they
- Happy Scumday!
-
-
yessiree heMafia Scum
-
-
Psyche he/theySurvivorhe/they
- Survivor
- Survivor
- Posts: 10751
- Joined: April 28, 2011
- Pronoun: he/they
- Happy Scumday!
-
-
Psyche he/theySurvivorhe/they
- Survivor
- Survivor
- Posts: 10751
- Joined: April 28, 2011
- Pronoun: he/they
- Happy Scumday!
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.-
-
Psyche he/theySurvivorhe/they
- Survivor
- Survivor
- Posts: 10751
- Joined: April 28, 2011
- Pronoun: he/they
- Happy Scumday!
-
-
yessiree heMafia Scumhe
- Mafia Scum
- Mafia Scum
- Posts: 4389
- Joined: June 6, 2013
- Pronoun: he
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
Copyright © MafiaScum. All rights reserved.