__pycache__/metroidgen.cpython-36.pyc | __pycache__/metroidgen.cpython-36.pyc | ||||
__pycache__/metroidgen.cpython-37.pyc | __pycache__/metroidgen.cpython-37.pyc | ||||
metroidgen.log | metroidgen.log | ||||
met-config.cfg | |||||
met-config.cfg | |||||
met-config.cfg | |||||
sprites/1774.png | sprites/1774.png | ||||
sprites/1776.png | sprites/1776.png | ||||
sprites/1777.png | sprites/1777.png | ||||
sprites/122214.png | sprites/122214.png | ||||
pseudo.txt | |||||
__pycache__/metroidgen.cpython-38.pyc | |||||
sprites/bombs.png~ | |||||
sprites/icebeam.png~ | |||||
sprites/longbeam.png~ | |||||
sprites/screwattack.png~ | |||||
sprites/varia.png~ |
admin = noelle@elekk.xyz | admin = noelle@elekk.xyz | ||||
[metroidgen] | [metroidgen] | ||||
class = metroidgen.MetroidState | |||||
client_id = | |||||
client_secret = | |||||
access_token = | |||||
class = metroidgen.MetroidPoster | |||||
client_id = OTICatqOoEmldl_OhEj2QcNsmszBI1xeqy0P30IbqC4 | |||||
client_secret = ClgaGBrDCV3TUOjpbSaGV4_N1Xd6867ux5TNZa08vTQ | |||||
access_token = TGRKjvcbcPeFpPaNSLWwLhm2zdRwZyJaFdcHci2Zad0 | |||||
admin = noelle@elekk.xyz | admin = noelle@elekk.xyz | ||||
domain = elekk.xyz | |||||
domain = elekk.xyz |
post_text = gs.toString() | post_text = gs.toString() | ||||
img = self.createImage(gs.password) | img = self.createImage(gs.password) | ||||
media_id = self.mastodon.media_post(img, description=gs.password) | media_id = self.mastodon.media_post(img, description=gs.password) | ||||
self.mastodon.status_post(post_text, visibility = "unlisted", spoiler_text = "Metroid password: {}".format(gs.password), media_ids = [media_id]) | |||||
tootdct = self.mastodon.status_post(post_text, visibility = "unlisted", spoiler_text = "Metroid password: {}".format(gs.password), media_ids = [media_id]) | |||||
print("Metroidgen scheduled: posted {}".format(gs.password)) | print("Metroidgen scheduled: posted {}".format(gs.password)) | ||||
with open("metroidgen.log", "a") as f: | |||||
f.write("\n") | |||||
f.write(tootdct) | |||||
def createImage(self, pwd): | def createImage(self, pwd): | ||||
pwd_chunks = pwd.split(" ") # This is safe because we'll never generate a password with a space in it | pwd_chunks = pwd.split(" ") # This is safe because we'll never generate a password with a space in it |
fnt = ImageFont.truetype('narpasfw.ttf', size=18) | fnt = ImageFont.truetype('narpasfw.ttf', size=18) | ||||
img = Image.new('RGB', (300, 100)) | img = Image.new('RGB', (300, 100)) | ||||
draw = ImageDraw.Draw(img) | draw = ImageDraw.Draw(img) | ||||
draw.text((50, 35), newpwd, font=fnt, fill=(190, 210, 255)) | |||||
draw.text((50, 5), newpwd, font=fnt, fill=(190, 210, 255)) | |||||
filename = 'images/{}.png'.format("".join(pwd_chunks)) | filename = 'images/{}.png'.format("".join(pwd_chunks)) | ||||
img.save(filename) | img.save(filename) | ||||
return filename | return filename | ||||
gs.createBitfield() | gs.createBitfield() | ||||
gs.generatePassword() | gs.generatePassword() | ||||
post_text = gs.toString() | post_text = gs.toString() | ||||
post_text += "\n\nvalid!" | |||||
img = gs.createImage() | img = gs.createImage() | ||||
media_id = self.mastodon.media_post(img, description=gs.password) | media_id = self.mastodon.media_post(img, description=gs.password) | ||||
self.mastodon.status_post(post_text, visibility = "unlisted", spoiler_text = "Metroid password: {}".format(gs.password), media_ids = [media_id]) | |||||
tootdct = self.mastodon.status_post(post_text, visibility = "unlisted", spoiler_text = "Metroid password: {}".format(gs.password), media_ids = [media_id]) | |||||
print("Metroidgen scheduled: posted {}".format(gs.password)) | print("Metroidgen scheduled: posted {}".format(gs.password)) | ||||
with open("mgen.log", "a") as f: | |||||
f.write("\n") | |||||
f.write(str(tootdct)) | |||||
gs.createBitfield() | gs.createBitfield() | ||||
gs.generatePassword() | gs.generatePassword() | ||||
print(gs.toString()) | print(gs.toString()) | ||||
print(gs.createImage()) | |||||
if __name__ == "__main__": | if __name__ == "__main__": | ||||
if len(sys.argv) == 2: | if len(sys.argv) == 2: |