Browse Source

Initial upload of mpy and ans files

main
travis 3 months ago
parent
commit
d875825f28
  1. 7
      tdih.ans
  2. 53
      tdih.mpy

7
tdih.ans

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@

゚゚ーーーー゚゚ ーーーー ゚゚ーーーワ ゚ーーーー゚ ーーーー ーーーー
アアアア アアアア アアアア アアアア アアアア ワワアアアア
イイイイ イイイイ イイイイ イイイイ イイイイ イイイイ
ロロロロ HIS ロロロロワワワロロロ゚ AY ワロロロロワ N ロロロロ ロロロロ ISTORY

53
tdih.mpy

@ -0,0 +1,53 @@ @@ -0,0 +1,53 @@
import mystic_bbs as bbs
import random
import json
tdihJSON = '/mystic/tdih.json'
############################
# Custom function to pause #
############################
def pause():
bbs.writeln("|PA")
##################################
# Custom fuction to clear screen #
##################################
def clear():
bbs.write('|CL')
#############
# Line Feed #
#############
def linefeed():
bbs.writeln('|CR')
###################
# Show Title ANSI #
###################
def showTitle():
bbs.showfile("tdih.ans", 57600, 0, 0, 0)
# Import the JSON File with today's history
with open("tdih.json", "r") as f:
tdih = json.load(f)
# Count the events and generate 5 random numbers within that range
rEventNums = random.sample(range(0,len(tdih["data"]["Events"])-1), 5)
clear()
showTitle()
linefeed()
# Sort the random event numbers in numerical order and print each one.
for rEventNum in sorted(rEventNums):
event = tdih["data"]["Events"][rEventNum]
bbs.writeln('|15' + event["year"] + ' |08- |07' + event["text"])
linefeed()
pause()
Loading…
Cancel
Save