|
|
@@ -5,8 +5,9 @@ |
|
|
|
# This uses http://games.technoplaza.net/mpg/password.txt as a basis for its password algorithm |
|
|
|
|
|
|
|
import random, sys |
|
|
|
from ananas import PineappleBot, hourly |
|
|
|
|
|
|
|
class MetroidState: |
|
|
|
class MetroidState(PineappleBot): |
|
|
|
""" Stores the game state |
|
|
|
""" |
|
|
|
def __init__(self): |
|
|
@@ -400,10 +401,6 @@ class MetroidState: |
|
|
|
pw = "Password: {}".format(self.password) |
|
|
|
return "\n".join([ic, mt, et, zb, kb, rs, sw, sl, dr, ms, pw]) |
|
|
|
|
|
|
|
def printPassword(self): |
|
|
|
print(self.password) |
|
|
|
return self.password |
|
|
|
|
|
|
|
def randomize(self): |
|
|
|
""" The randomizer! |
|
|
|
""" |
|
|
@@ -826,6 +823,16 @@ class MetroidState: |
|
|
|
if i%64 == 63: |
|
|
|
print() |
|
|
|
|
|
|
|
@hourly(minute=35) |
|
|
|
def postPassword(self): |
|
|
|
self.initializeBitfield() |
|
|
|
self.randomize() |
|
|
|
self.createBitfield() |
|
|
|
self.generatePassword() |
|
|
|
post_text = self.toString() |
|
|
|
self.mastodon.status_post(post_text, visibility = "unlisted", spoiler_text = "Metroid password: {}".format(self.password)) |
|
|
|
print("Metroidgen scheduled: posted {}".format(self.password)) |
|
|
|
|
|
|
|
def main(): |
|
|
|
gs = MetroidState() |
|
|
|
gs.randomize() |