Modbot to Help You Run Games: Now With A Votecounter Demo!
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
Psyche did a really good job at abastracting away the automation of posting to/reading from the thread.In post 24, GreenLiquid wrote: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.
You should just need to use something like:
Code: Select all
mydonbot = Modbot.Donbot("some username", "some password", "thread url") print(mydonbot.getPosts()) mydonbot.makePost("hello world!")
Just be careful when you're running the makePost that you're in the thread you really want to be in.
I would also try to print() any strings you pass to makePost() before actually using the latter method. Especially if you want to put it in a loop.- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
There's a throttling constant in the code, so anyone that would try to flood the site would have to have some coding background, at which point it would be easy enough for them to do so with their own code anyway.
I also don't think there's http calls in the code that aren't linked to a username and password, making Modbot based DDOS extremely transparent on the attacker's end.- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
Okay. I think the best way to implement an auto-prodder is to parse the activity overview page.
My initial thoughts to accomplish this would be to add a 'getActivity' method to the Donbot class, which would return each player's username, and the time since their last post.
An external utility (Prodbot???) would then check the results of getActivity, and use Donbot's sendPM method to prod all the slackers.- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
First attempt at adding the activity parser to donbot was a partial success. I had everything worked out until I realized the V/LA column was being parsed as a column of null strings.
I tried following the nature of how donbot works, which involved XPath, something I had never heard of until I saw this code. My XPath pattern was long and ugly; I need to find the balance between a simple pattern match and a clean algorithm to format the data it gives me.- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
Node.js would probabaly have to replace the entirety of the Modbot code with js or suffer unnecessary complexity. Flask would probabaly handle this better since it's for python.
On second thought, electron may have the same issue as node.js, but I honestly don't know enough about it to say for sure.
Prodbot will probabaly have to wait till next week. I had an issue with my license plates being stolen this weekend.Last edited by Flubbernugget on Sun May 06, 2018 8:22 am, edited 2 times in total.- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
If the python has to expose xhr requests (which is ultimately just http), it would be just as capable of hosting a gui front end?
Psyche, what is your motivation for wanting the gui to be web oriented? I get that you don't want to reinvent the wheel, but there's a lot of batteries included python options in this regard (kivy comes to mind).- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
Looked through the PR's. Cool stuff!
What's the difference between gevent and asyncio? I know what a coroutine is, but don't have much experience with either library.
Also, any naming conventions in mind? I'm used to class names being nouns.
Prodpot PR up sometime before tonight!! Just got the code done. Tested it (only for one post with a prod deadline of zero days). Need to figure out the jupyter doc thing, and actually write docs next.- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
I think i got the PM aspect of the prodbot working. The next step is to generate a sendto list based on how long a player can go without posting before being prod-worthy.
I have a few items of note though.
I had to change this snippet in donbot:
Code: Select all
216 for user in uids: 217 form['address_list[u][{}]'.format(user.value)] = 'to' 218 219 for name in ['lastclick', 'creation_time', 'form_token']: 220 form[name] = compose.xpath(postformpath.format(name))[0]
as such:
Code: Select all
--------------------------------------------------------------------------------------------- FROM: 216 for user in uids: 217 form['address_list[u][{}]'.format(user.value)] = 'to'] --------------------------------------------------------------------------------------------- TO: 216 for user in uids: 217 form['address_list[u][{}]'.format(user)] = 'to'] ---------------------------------------------------------------------------------------------
My conclusion now is that I am getting the uids as strings, whereas someone else seemed to be getting them as some sort of more complex object. I want to hold off on a PR until I can figure out if/how this would break everyone else's stuff (there will be a push to my fork soon though!!).
Also, the prodbot seems to crap out at around 13-15 players in a single prod with a postdelay of 5 (RIP fortune cookie thread). The errors I have gotten with larger prod sets seem to be either lxml parser errors or http connection refusals. This leads me to believe I'm hitting some limit on the MS server. I'm not 100% sure if it's worth digging into this issue any further than I have, since 13+ prods seems like a lot.- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
So, I did a semi-through test of this. I did start sending PM's to a list of 15 people with a post delay of 10. This mostly gave lxml errors. Putting sleeps in sendPM did not mitigate this issue. I got to the point where I just started slicing the sendto variable from [:1] onward, changing postdelay to 5 to speed up testing.
There is definitely something bizarre going on, as there's not enough information in my course of actions to really figure out what's choking up the server. And hell, its code, so there's a good chance I'm wrong in declaring that as the problem anyway
If it's really worth digging into this, I could probably set up a test matrix across a couple of variables (postdelay, number of players, etc...). I don't know what conclusions we'd be able to make from that information, but the results would be comprehensive. The only thing that bothers me about this is spamming users with PM's.
Alternatively, I could try to contact Kison to see if there's any bottlenecks I'm hitting. This might also have the advantage of quickly determining whether or not my looking at server limits is confbias on my end.- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
I should only be sending 1 PM to 13 people.In post 120, GreenLiquid wrote:Does the result change if you push 13 PMs while the application is running, kill the application, then immediately restart it and send 1 additional PM?- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
I don't have much more time tonight to continue working on this, but I am willing to give this a shot at a later date.In post 123, GreenLiquid wrote:Right, sorry, I meant... is it possible to get it out of its state of not sending PMs by exiting and re-launching the application? Just to see if it's something within that session or not. Might help narrow down the cause.
So something like this?
Code: Select all
-> Send pm to 13 users. Fail! -> Send pm to 13 users. Press CTRL+C. Program terminates. -> Send pm to 13 users. Pass!
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
This is a good idea. One of my big concerns with the web gui interface was that it never seemed like it would make for good UX no matter how good the UI could be done. In the scheme of trying to attract more users to what is now a bit of a "clunky" site that was a bit of an issue. Now instead of trying to spin up a server it's literally just clicking an icon.In post 153, yessiree wrote:it occurred to me that we could just write batch scripts that run the python files, then WindowsTM users can download the source code with the .bat files, and simply run the batch scripts
this is much much simpler than the whole web app thing with flask
it's worth serious consideration- Flubbernugget
-
Flubbernugget Survivor
- Flubbernugget
- Survivor
- Survivor
- Posts: 11751
- Joined: June 26, 2014
Was there a resolution on this? I don't see anything on the activity overview as a github issue, but it was a bit of an upper bound anyway.In post 119, Psyche wrote:push the code if you want; i have some ideas for figuring out what's wrong - Flubbernugget
Copyright © MafiaScum. All rights reserved.
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget
- Flubbernugget