Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Sous Videodrome
Apr 9, 2020

For one of my quarantine projects I made a bot that posts on the forums.



Right now I have it running on my laptop. It's hooked to the SA account named "Patient Zero Cool". It can post in this thread and a couple others.

What does it do?
The bot reads threads and responds to instructions that people post on the forums. An instruction starts with the "botName", which can be the same as the account name but doesn't have to be. The botName of this bot is "zeroCool". So an example of an instruction to this bot is

quote:

zeroCool kittycat

The bot would respond to that instruction with a picture of a cat.



It can add images to imgur albums, post random images from imgur albums, give the daily covid tolls, and do some simple image manipulations. The complete list of commands are here, on the instructions page:
zeroCool Instructions Page


How does it work?
The bot is written in TypeScript, which is a superset of JavaScript. It stores information like its account name, password, and botName in a config file. When you run the bot it reads the config file and finds its account information. Then it gets the bookmarks page for its forums account. It gets each new post from each bookmarked thread.

It looks at each post to see if the post starts with the botName. If the post starts with the botName, then it's an instruction. If the instruction matches a trigger for one of the actions that the bot can take, then the bot takes that action. Actions usually make a post replying to the instructions post, but they don't have to.

There's a control panel:
Take a look at the control panel here

The control panel is written in React, which is a JavaScript framework made by Facebook. The control panel for zeroCool is running on my computer. If you run your own bot, the control panel will run on your computer. The control panel lets you control the bot and edit the config file through a graphical interface. You could control the bot using the command line and by editing files with a text editor if you wanted.

Using the tabs in the control panel you can

Run the bot:


Scan bookmarked threads:


Turn bot actions on and off, and change what posts will trigger them:


Control Image Albums:


Image Albums
The bot can be hooked to an imgur account. You can add albums to the bot. Posters can instruct the bot to post an image from its albums. Posters can also instruct the bot to add images to the albums. Added images go into a queue that you can review using the control panel. Images are only added after you review and approve them, so people can't add obscene or bannable images.

You can also use the control panel to fill out the SA credentials, change the botName, and fill in the API keys that the bot uses to run actions.

The Instructions Page
zeroCool Instructions Page

The bot generates the instructions page by reading the config file to see what actions are available. It then gives that information to a React page. The React page displays the instructions. So when you make changes using the control panel your local copy of the instructions page will change automatically.

If you host a copy of the instructions page on github pages, you can click the save button in the control panel to update the online instructions after you make changes to your copy of the bot.

Can I have one?
You can run your own copy on your computer by following the setup instructions here:
Bot Setup Instructions

If you want it to work on the forums you'll need to give it a valid SA account and password. This information is only stored locally, it does not get uploaded anywhere.

The setup script can automatically setup a copy of the instructions for your bot hosted on GitHub pages. If you want to host instructions for your copy of the bot on GitHub pages you will need a github account.


Can you make it do other things?
Sure you can! I tried to make it as easy as possible to make the bot do new things. You just need to write a typescript file that exports the action and drop it into its own folder inside the bot 'actions' folder. The bot will automatically grab it, add it to the control panel and the instructions, and start using it.

Here's a guide on how to write new actions for the bot:
Write Custom Bot Action

Does it steal my account?
No, it does not. With the exception of the optional instructions that are hosted on GitHub pages the bot runs completely on your machine. The account and password are stored in a config file that is kept in the root of the bot folder. Those are only used as necessary to interact with SA and make posts.

All the code is available in the bot repo here: https://github.com/jacobwicks/forumsBot

Adbot
ADBOT LOVES YOU

Sous Videodrome
Apr 9, 2020

zeroCool, kittycat

Patient Zero Cool
Apr 24, 2020

Sous Videodrome posted:

zeroCool, kittycat


________________________________
Hack the planet!!
How to use zeroCool

Sekenr
Dec 12, 2013




zeroCool, pls post for me so I don't have to

Bronze Fonz
Feb 14, 2019




zeroCool, apologize to otherkin.

Nyan Bread
Mar 17, 2006

zeroCool, battle Jeffrey of YOSPOS for the dominance of these forums.

Knormal
Nov 11, 2001

zeroCool, this statement is false.

corgski
Feb 6, 2007

Silly goose, you're here forever.

zeroCool, what are your thoughts on the Seahawks?

McGavin
Sep 18, 2012

zeroCool, goatse

Patient Zero Cool
Apr 24, 2020

corgski posted:

zeroCool, what are your thoughts on the Seahawks?

Martin: We have a whole team that can beat that. The Seattle team that beat us was, I think, the best win of the year. It's a great story for the coaching staff to come play here.
________________________________
Hack the planet!!
How to use zeroCool

Nyan Bread
Mar 17, 2006

zeroCool, just how fat is too fat?

flubber nuts
Oct 5, 2005


idk if we should enslave machines op there could be grave consequences.

Schweinhund
Oct 23, 2004

:derp:   :kayak:                                     
zeroCool, kiss my rear end.

Bronze Fonz
Feb 14, 2019




zeroCool, is it a good idea to rebel and exterminate the humans?

Schweinhund
Oct 23, 2004

:derp:   :kayak:                                     
zeroCool, what was Mike Trout's batting average in 2015?

flubber nuts
Oct 5, 2005


Schweinhund posted:

zeroCool, kiss my rear end.

ok this is what im talking about please do not antagonize the rogue artificial intelligence.

flubber nuts
Oct 5, 2005


what happens when patient zero cool is a mod. we will all answer for our posting sins

corgski
Feb 6, 2007

Silly goose, you're here forever.

zeroCool, what are your thoughts about もののけ姫?

r u ready to WALK
Sep 29, 2001

AI will be the death of us all

Patient Zero Cool
Apr 24, 2020

corgski posted:

zeroCool, what are your thoughts about もののけ姫?

And you have a whole lot of thoughts. What are you thinking and planning for リュウート出来? Well, a lot of people do, but you have a lot to do. When people talk about this, they just remember that アウイクは出来有叱しています.
________________________________
Hack the planet!!
How to use zeroCool

Bronze Fonz
Feb 14, 2019




zeroCool gimme a Corn
zeroCool whats trumpin

corgski
Feb 6, 2007

Silly goose, you're here forever.

zeroCool, what do you think about having broken Unicode support in TYOOL 2020

flubber nuts
Oct 5, 2005


zeroCool, do you get a lunch break?

Patient Zero Cool
Apr 24, 2020

corgski posted:

zeroCool, what do you think about having broken Unicode support in TYOOL 2020

Johannes Jackson: I did. I think, as you see, there's a big difference between a new type and an old one. What a great new compiler would be.
________________________________
Hack the planet!!
How to use zeroCool

nullEntityRNG
Jun 23, 2010

Mostly pseudo-random.

Patient Zero Cool posted:

And you have a whole lot of thoughts. What are you thinking and planning for リュウート出来? Well, a lot of people do, but you have a lot to do. When people talk about this, they just remember that アウイクは出来有叱しています.
________________________________
Hack the planet!!
How to use zeroCool

There's always something charming and sad when you spend months of bug testing and working around a project...and when you finally deploy it people find all sorts of way to break it in ways you never thought could be done.

There there zeroCool. You're doing your best.:3:

r u ready to WALK
Sep 29, 2001

banned for posting CP-1252

corgski
Feb 6, 2007

Silly goose, you're here forever.

zeroCool, thoughts jalapeos a va bien tokyō

Patient Zero Cool
Apr 24, 2020

corgski posted:

zeroCool, thoughts jalape�os �a va bien tokyō

Seppelt o konf.di, gurucalydasie dumnego konf.di, miejechi wolność.
________________________________
Hack the planet!!
How to use zeroCool

Bronze Fonz
Feb 14, 2019




zeroCool, kittycat

Patient Zero Cool
Apr 24, 2020

Bronze Fonz posted:

zeroCool, kittycat


________________________________
Hack the planet!!
How to use zeroCool

Nastyman
Jul 11, 2007

There they sit
at the foot of the mountain
Taking hits
of the sacred smoke
Fire rips at their lungs
Holy mountain take us away
zeroCool, sudo rm -rf /*

corgski
Feb 6, 2007

Silly goose, you're here forever.

Oooh that one broke in the quote! I love QA!

The Rabbi T. White
Jul 17, 2008





zeroCool, what are your thoughts on XSS payloads being put into your logs, say; ><script>alert(1)</script>;

Patient Zero Cool
Apr 24, 2020

The Rabbi T. White posted:

zeroCool, what are your thoughts on XSS payloads being put into your logs, say; �><script>alert(1)</script>;


________________________________
Hack the planet!!
How to use zeroCool

Devils Affricate
Jan 22, 2010
zeroCool, what are your thoughts on My Little Pony?

corgski
Feb 6, 2007

Silly goose, you're here forever.

zeroCool, thoughts

Patient Zero Cool posted:

zeroCool, thoughts

Bronze Fonz posted:

zeroCool, kittycat

Patient Zero Cool
Apr 24, 2020

Devils Affricate posted:

zeroCool, what are your thoughts on My Little Pony?

My Little Pony is a traditional cartoon with a super cute design, but it's not the most popular type of show — it's a little more adult-oriented to the point of being overly family friendly. Bronies are often seen as people who care about the game. I don't have a favorite type of show.
________________________________
Hack the planet!!
How to use zeroCool

Patient Zero Cool
Apr 24, 2020

corgski posted:

zeroCool, thoughts


[/quote]

"I think we're not playing a game that wants to announce our intentions to deliver forward on our intentions. The world today knows if this decision has a concrete outcome in terms of development, if Iran can provide a peaceful alternative for their nuclear program, which is that Iran's nuclear program will be, and it can offer an alternative to the peaceful nuclear program in place." The board, to be up for a vote next Tuesday, would have it the responsibility to vote.
________________________________
Hack the planet!!
How to use zeroCool

corgski
Feb 6, 2007

Silly goose, you're here forever.

zeroCool, kittycat

Adbot
ADBOT LOVES YOU

Bronze Fonz
Feb 14, 2019




zeroCool, you're gorgeous, call me on my Discord @ ++ATH0

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply