import os

btext = ""
for h in range(0, 1):
    for m in range(0, 60):
        text = ""
        for s in range(0, 60):
            for t in range(0, 20):
                text += "execute as @a[scores={Time_Second="+str(s)+",Time_Tick="+str(t)+"}] run "
                score = ((h*60+m)*60+s)*20+t
                
                score = (90 - (score*100)%89) + score*100
                text += """tellraw @a ["",{"text":"-> Click here to submit your score! <-","bold":true,"color":"yellow","clickEvent":{"action":"open_url","value":"http://zedafox.com/lb/pwms.php?score="""+str(score)+'"}}]'
                text += "\n"

        f = open("h_"+str(h)+"_"+str(m)+".mcfunction","w+")
        f.write(text)
        f.close()

        btext+= "execute as @a[scores={Time_Minute="+str(m)+",Time_Hour="+str(h)+"}] run function parkour:leaderboard/h_"+str(h)+"_"+str(m)
        btext+= "\n"

f = open("submit.mcfunction","w+")
f.write(btext)
f.close()
        
