Prizes to Lumi
You win a code snippet
Code: Select all
while 1:
print "Luminier is awesome"
(don't actually run it

)
My character is already top notch at astronomy (hence being able to have a decent stab at the Epoch) so it's more of a toy. I've done a bit more to it to allow conversion of geas dates into real dates and vice versa, just a handy little tool for various stuffs like knowing when IC dates crop up in RL
Here updated (and not very tested) code:
Code: Select all
#! /usr/bin/python
import time
import datetime
import os
if os.name == "posix":
clear = "clear"
elif os.name in ("nt", "dos", "ce"):
clear = "CLS"
loop = True
class clock():
def __init__(self): #yyyy, mm, dd, h, min
self.epoch = datetime.datetime(1828, 10, 16, 9, 45)
self.tick()
def tick(self):
dt = datetime.datetime.now()
self.calcTime(dt)
def calcTime(self, dt):
elapsed = (dt - self.epoch) * 6
self.year = elapsed.days / 352
self.month = (elapsed.days % 352) / 22
self.day = (elapsed.days % 352) % 22
self.hour = elapsed.seconds / 3600
self.minute = (elapsed.seconds % 3600) / 60
self.second = (elapsed.seconds % 3600) % 60
def displayDT(self):
print "TIME: %02d:%02d:%02d" % (self.hour, self.minute, self.second)
print "DATE: %02d/%02d/%04d" % (self.day, self.month, self.year)
geasTime = clock()
while loop:
print "\n\n1: Clock"
print "2: Real world to geas time"
print "3: Geas to real world time"
print "0: Quit"
choice = raw_input("Please select an option: ")
if choice == "0": loop = False
if choice == "1":
while 1:
try:
time.sleep(0.16)
os.system(clear)
geasTime.tick()
geasTime.displayDT()
print "\nHit Ctrl-C to exit"
except KeyboardInterrupt:
break
if choice == "2":
dstring = raw_input("Enter date (dd/mm/yyyy): ")
tstring = raw_input("Enter time (hh:mm): ")
d = dstring.split("/")
t = tstring.split(":")
try:
dt = datetime.datetime(int(d[2]), int(d[1]), int(d[0]), int(t[0]), int(t[1]))
except:
print "Whoops! Something went wrong, probably a bad value entered, try again"
print ("\n\n")
geasTime.calcTime(dt)
geasTime.displayDT()
if choice == "3":
print "Remember to enter the geas date correctly or things will go oddly."
print "The geas calendar has 16 months in a year with 22 days each"
dstring = raw_input("Enter date (dd/mm/yyyy): ")
d = dstring.split("/")
try:
d[2] = int(d[2]) * 16
d[2] = d[2] * 22
d[1] = int(d[1]) * 22
days = int(d[0]) + d[1] + d[2]
elapsed = datetime.timedelta(days / 6)
date = geasTime.epoch + elapsed
except:
print "Whoops! Something went wrong, probably a bad value entered, try again"
print date.strftime("\n%d/%m/%y")
It should run on any computer (cos it's python and python rocks cross platform compatibility) but I'm a linux user so it's not windows tested and I really can't be bothered if it doesn't work on win or mac. As far as I can tell, the time and date remains pretty synced to the game (a bit difficult to tell) at least the day is usually right
The exception handling should cope with most typos and mistakes, but I've not put much time into fully idiot proofing it...I wasn't THAT bored
If you want to run it, just install python, save the script as a text file (with a .py extension preferably) the execute the program in what ever manner your OS supports. If you're sensible and use linux the top line informs bash that it's a python script so typing ./geastime.py (or whatever you saved it as) will make it go
Lemme know if you use it and if you spot any major problems.
Oh, it might need manually correcting for different time zones. I'm in GMT (UTC 0) and I'm not entirely certain if the script grabs UTC or local time. If it's local, just correct the epoch manually (plus or minus your time zone from the time).