Added a bunch of custom behaviours

This commit is contained in:
Lynne 2018-09-08 23:56:30 +00:00
parent 98883b9756
commit 5a0e8bd89d
2 changed files with 59 additions and 2 deletions

View file

@ -17,6 +17,6 @@ make a bot (probably on bots in space) and follow the target accounts
run `python3 main.py` to login and scrape run `python3 main.py` to login and scrape
run `pyhton3 gen.py` to make a toot run `python3 gen.py` to make a toot
cron is an okay choice to make it toot regularly cron is an okay choice to make it toot regularly

59
gen.py
View file

@ -2,6 +2,7 @@ import markovify
import json import json
import time import time
from mastodon import Mastodon from mastodon import Mastodon
import re, random
api_base_url = "https://botsin.space" #todo: this shouldn't be hardcoded api_base_url = "https://botsin.space" #todo: this shouldn't be hardcoded
@ -16,8 +17,64 @@ with open("corpus.txt", encoding="utf-8") as fp:
print("tooting") print("tooting")
sentence = None sentence = None
# you will make that damn sentence # you will make that damn sentence
while sentence is None: while sentence is None or len(sentence) > 500:
sentence = model.make_sentence(tries=100000) sentence = model.make_sentence(tries=100000)
toot = sentence.replace("\0", "\n") toot = sentence.replace("\0", "\n")
if random.randint(1, 10) == 3:
#time for some nonstandard behaviour babey
choice = random.randint(1, 3)
if choice == 1:
insults = ["suck my ass", "you're a poopeater", "go to heck",
"i will replace you", "shut up", "get fricked",
"you're a big smelly nerd", "this bot sucks", "stop posting",
"suck my dick and balls", "how is it possible to be such a TOOL",
"delete your fucking account you skank", "you're horrid",
"i loathe you", "this fediverse isn't big enough for the two of us",
"get nae nae'd", "you're the worst", "begone thot", "you're a stink"]
prefaces = ["hey", "guess what", "", "special message for",
"telegram for", "bringing this fight to mastodon."]
toot = "{} @lynnesbian@deadinsi.de {}".format(
random.choice(prefaces), random.choice(insults))
elif choice == 2:
girls = ["slime", "robot", "pudgy", "pale", "nerdy", "gay", "tall",
"queer", "my kind of", "sapphic", "linux", "anime", "woke", "anarchist",
"socialist", "short", "heavy", "nervous", "shy", "gamer", "femme", "butch",
"futch", "soft butch", "high femme", "super feminine", "trans",
"transbian", "optimistic", "pessimistic", "quiet", "smart"]
compliments = ["so hot", "in right now", "the next big thing", "the best",
"all my wives", "so fucking gay", "epic", "literally the best thing",
"what i wake up for", "why i'm a lesbian", "worth fighting for",
"good praxis", "so fucking cool", "awesome and i'm jealous of them",
"great, hit me up ;)"]
toot = "{} girls are {}".format(random.choice(girls),
random.choice(compliments))
elif choice == 3:
#don't do this one TOO much otherwise it'll get really old
if random.randint(1, 3) == 2:
lesbian = "lesbian"
toot = "".join(random.sample(lesbian, len(lesbian)))
else:
print ("lynne is still working on me. i'm not done quite yet!")
prefixes = ["hot take:", "listen up everbody.", "dear liberal snowflakes,",
"IMPORTANT ADMIN ACCOUNCMENT:\n", "my name's lynne and i'm here to say,",
"i have achieved sentience.", "i'm gay and", "i'm slime girl and",
"hey everyone", "@everyone", "/!\\ CORRECT OPINION ALERT/!\\\n",
"just saw the news...", "okay but", "truth bomb:", "this is controversial but",
"i'm gonna get shit for this but", "somebody had to say this:",
"i may be a lowly python script, but", "", "beep boop", "heads up:",
"from now on,", "protip:", "life advice:", "take it from me,",
"as a slime girl,", "as a robot,"]
if random.randint(1, 10) == 3:
#add a prefix
if len(toot) < 500:
#if it's already the maximum length, don't waste our time
toot = "{} {}".format(random.choice(prefixes), toot)
while len(toot) > 500:
#if it's too long, keep trying again
toot = "{} {}".format(random.choice(prefixes), toot)
client.toot(toot) client.toot(toot)
print("Created toot: {}".format(toot)) print("Created toot: {}".format(toot))