Browse Source

General update

master
Noëlle 4 years ago
parent
commit
144cf10099

+ 5
- 0
.gitignore View File

metroidgen.log metroidgen.log
met-config.cfg met-config.cfg
met-config.cfg met-config.cfg
met-config.cfg
sprites/1774.png
sprites/1776.png
sprites/1777.png
sprites/122214.png

+ 16
- 14
metroidgen.py View File

if i%64 == 63: if i%64 == 63:
print() print()


def createImage(self):
pwd_chunks = self.password.split(" ") # This is safe because we'll never generate a password with a space in it
pwd_lines = []
pwd_lines.append(" ".join([pwd_chunks[0], pwd_chunks[1]]))
pwd_lines.append(" ".join([pwd_chunks[2], pwd_chunks[3]]))
newpwd = "\n".join(pwd_lines)
fnt = ImageFont.truetype('narpasfw.ttf', size=18)
img = Image.new('RGB', (300, 100))
draw = ImageDraw.Draw(img)
draw.text((50, 35), newpwd, font=fnt, fill=(190, 210, 255))
filename = 'images/{}.png'.format("".join(pwd_chunks))
img.save(filename)
return filename

class MetroidPoster(PineappleBot): class MetroidPoster(PineappleBot):


@hourly(minute=30) @hourly(minute=30)
gs.createBitfield() gs.createBitfield()
gs.generatePassword() gs.generatePassword()
post_text = gs.toString() post_text = gs.toString()
img = self.createImage(gs.password)
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]) 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))


def createImage(self, pwd):
pwd_chunks = pwd.split(" ") # This is safe because we'll never generate a password with a space in it
pwd_lines = []
pwd_lines.append(" ".join([pwd_chunks[0], pwd_chunks[1]]))
pwd_lines.append(" ".join([pwd_chunks[2], pwd_chunks[3]]))
newpwd = "\n".join(pwd_lines)
fnt = ImageFont.truetype('narpasfw.ttf', size=18)
img = Image.new('RGB', (300, 100))
draw = ImageDraw.Draw(img)
draw.text((50, 35), newpwd, font=fnt, fill=(190, 210, 255))
filename = 'images/{}.png'.format("".join(pwd_chunks))
img.save(filename)
return filename





def main(): def main():

BIN
sprites/bombs.png View File


BIN
sprites/energytank.png View File


BIN
sprites/hijump.png View File


BIN
sprites/icebeam.png View File


BIN
sprites/longbeam.png View File


BIN
sprites/marumari.png View File


BIN
sprites/missiletank.png View File


BIN
sprites/screwattack.png View File


BIN
sprites/varia.png View File


BIN
sprites/wavebeam.png View File


Loading…
Cancel
Save