BigWorm
04-21-2004, 06:48 PM
I try my best to stay out of jail, but during Beta I played in the stocks a bit. Anyway, the debate about the stocks script and the way some people chose to solve it made me wonder. I decided to waste about three hours of my life and show a few different ways to do variable extraction with the Wizard. This script uses the time verb to figure out the current day of the week, month, time, etc. and will convert the Elanthian versions into English versions. Although sometimes the structure uses the time verb more times than are really required, this is a function of the structure of the counting section that allows it to be much more expandable.
Since I wrote the script in about three hours, I'm sure there are some bugs (I'm really not sure about how the Day of the Huntress [Friday] will work), but I got many of the other kinks worked out.
This script doesn't output the information in a very "pretty" way, but this is mostly due to the two variable nature of the Wizard. It's also right about useless, but it's more about the concepts than the function. Also, because of the way the script is written, it would be pretty easy to break it up to only get the minutes of the hour for instance.
I think Bob said that %c and %s are already used by the Stockade script, but I'm too lazy to look at the script and see if I could modify it to use a more flexible structure because I'm rarely in the stockades.
Anyway, here's the script. I'll probably play around with it some more and post some edits later.
Damn, the BBCode code format looks shitty. I'll post an attachment too that should look better.
# Find the current day, month, year, etc.
Start:
COUNTER SET 0
SAVE ""
FindWeekDay:
MATCH WeekDayRestday Today is Restday,
MATCH WeekDayVolnes Today is Volnes,
MATCH WeekDayTilamaires Today is Tilamaires,
MATCH WeekDayLeyan Today is Leyan,
MATCH WeekDayNiiman Today is Niiman,
MATCH WeekDayDayOfTheHuntress Today is the Day of the Huntress,
MATCH WeekDayFeastday Today is Feastday,
MATCH WeekDayError elven time standard.
PUT time
MATCHWAIT
WeekDayRestday:
SAVE Restday
GOTO FoundWeekDay
WeekDayVolnes:
SAVE Volnes
GOTO FoundWeekDay
WeekDayTilamaires:
SAVE Tilamaires
GOTO FoundWeekDay
WeekDayLeyan:
SAVE Leyan
GOTO FoundWeekDay
WeekDayNiiman:
SAVE Niiman
GOTO FoundWeekDay
WeekDayDayOfTheHuntress:
SAVE "Day of the Huntress"
SAVE Day_of_the_Huntress
GOTO FoundWeekDay
WeekDayFeastday:
SAVE Feastday
GOTO FoundWeekDay
WeekDayError:
SAVE "Error in FindWeekDay"
GOTO FatalError
FoundWeekDay:
ECHO * Day of the week: %s
GOTO ConvertWeekDay
#GOTO FindDayOfMonth
ConvertWeekDay:
GOTO ConvertWeekDay%s
ConvertWeekDayRestday:
SAVE Sunday
GOTO FoundConvertedWeekDay
ConvertWeekDayVolnes:
SAVE Monday
GOTO FoundConvertedWeekDay
ConvertWeekDayTilamaires:
SAVE Tuesday
GOTO FoundConvertedWeekDay
ConvertWeekDayLeyan:
SAVE Wednesday
GOTO FoundConvertedWeekDay
ConvertWeekDayNiiman:
SAVE Thursday
GOTO FoundConvertedWeekDay
ConvertWeekDayDay_of_the_Huntress:
SAVE Friday
GOTO FoundConvertedWeekDay
ConvertWeekDayFeastday:
SAVE Saturday
GOTO FoundConvertedWeekDay
FoundConvertedWeekDay:
ECHO * Weekday in English: %s
GOTO FindDayOfMonth
FindDayOfMonth:
COUNTER SET 0
WAIT
MATCH DayOfMonth1 day 1
MATCH DayOfMonth2 day 2
MATCH DayOfMonth3 day 3
MATCH DayOfMonth4 day 4
MATCH DayOfMonth5 day 5
MATCH DayOfMonth6 day 6
MATCH DayOfMonth7 day 7
MATCH DayOfMonth8 day 8
MATCH DayOfMonth9 day 9
MATCH DayOfMonth0 day 0
MATCH DayOfMonthError elven time standard.
PUT time
MATCHWAIT
DayOfMonth1:
COUNTER SET %c1
GOTO DayOfMonthHelper
DayOfMonth2:
COUNTER SET %c2
GOTO DayOfMonthHelper
DayOfMonth3:
COUNTER SET %c3
GOTO DayOfMonthHelper
DayOfMonth4:
COUNTER SET %c4
GOTO DayOfMonthHelper
DayOfMonth5:
COUNTER SET %c5
GOTO DayOfMonthHelper
DayOfMonth6:
COUNTER SET %c6
GOTO DayOfMonthHelper
DayOfMonth7:
COUNTER SET %c7
GOTO DayOfMonthHelper
DayOfMonth8:
COUNTER SET %c8
GOTO DayOfMonthHelper
DayOfMonth9:
COUNTER SET %c9
GOTO DayOfMonthHelper
DayOfMonth0:
COUNTER SET %c0
GOTO DayOfMonthHelper
DayOfMonthHelper:
WAIT
MATCH DayOfMonth1 day %c1
MATCH DayOfMonth2 day %c2
MATCH DayOfMonth3 day %c3
MATCH DayOfMonth4 day %c4
MATCH DayOfMonth5 day %c5
MATCH DayOfMonth6 day %c6
MATCH DayOfMonth7 day %c7
MATCH DayOfMonth8 day %c8
MATCH DayOfMonth9 day %c9
MATCH DayOfMonth0 day %c0
MATCH FoundDayOfMonth day %c
MATCH DayOfMonthError elven time standard.
PUT time
MATCHWAIT
DayOfMonthError:
SAVE "Error in FindDayOfMonth"
GOTO FatalError
FoundDayOfMonth:
ECHO * Day of the month: %c
GOTO FindMonth
FindMonth:
SAVE ""
WAIT
MATCH MonthLormesta of the month Lormesta in the year
MATCH MonthFashanos of the month Fashanos in the year
MATCH MonthCharlatos of the month Charlatos in the year
MATCH MonthOlaesta of the month Olaesta in the year
MATCH MonthIvastaen of the month Ivastaen in the year
MATCH MonthLumnea of the month Lumnea in the year
MATCH MonthKoaratos of the month Koaratos in the year
MATCH MonthPhoenatos of the month Phoenatos in the year
MATCH MonthImaerasta of the month Imaerasta in the year
MATCH MonthJastatos of the month Jastatos in the year
MATCH MonthEoantos of the month Eoantos in the year
MATCH MonthEorgaen of the month Eorgaen in the year
MATCH MonthError elven time standard.
PUT time
MATCHWAIT
MonthLormesta:
SAVE Lormesta
GOTO FoundMonth
MonthFashanos:
SAVE Fashanos
GOTO FoundMonth
MonthCharlatos:
SAVE Charlatos
GOTO FoundMonth
MonthOlaesta:
SAVE Olaesta
GOTO FoundMonth
MonthIvastaen:
SAVE Ivastaen
GOTO FoundMonth
MonthLumnea:
SAVE Lumnea
GOTO FoundMonth
MonthKoaratos:
SAVE Koaratos
GOTO FoundMonth
MonthPhoenatos:
SAVE Phoenatos
GOTO FoundMonth
MonthImaerasta:
SAVE Imaerasta
GOTO FoundMonth
MonthJastatos:
SAVE Jastatos
GOTO FoundMonth
MonthEoantos:
SAVE Eoantos
GOTO FoundMonth
MonthEorgaen:
SAVE Eorgaen
GOTO FoundMonth
MonthError:
SAVE "Error in FindMonth"
GOTO FatalError
FoundMonth:
ECHO * Month: %s
GOTO ConvertMonth
#GOTO FindYear
ConvertMonth:
GOTO ConvertMonth%s
ConvertMonthLormesta:
SAVE January
GOTO FoundConvertedMonth
ConvertMonthFashanos:
SAVE February
GOTO FoundConvertedMonth
ConvertMonthCharlatos:
SAVE March
GOTO FoundConvertedMonth
ConvertMonthOlaesta:
SAVE April
GOTO FoundConvertedMonth
ConvertMonthIvastaen:
SAVE May
GOTO FoundConvertedMonth
ConvertMonthLumnea:
SAVE June
GOTO FoundConvertedMonth
ConvertMonthKoaratos:
SAVE July
GOTO FoundConvertedMonth
ConvertMonthPhoenatos:
SAVE August
GOTO FoundConvertedMonth
ConvertMonthImaerasta:
SAVE September
GOTO FoundConvertedMonth
ConvertMonthJastatos:
SAVE October
GOTO FoundConvertedMonth
ConvertMonthEoantos:
SAVE November
GOTO FoundConvertedMonth
ConvertMonthEorgaen:
SAVE December
GOTO FoundConvertedMonth
FoundConvertedMonth:
ECHO * Month in English: %s
GOTO FindYear
# The FindYear section is only set up to recognize up to 2008.
# It would be very easy to expand to forever, but would add four
# more uses of the time verb. I didn't see it as neccesary for a
# script with little practical purpose
FindYear:
COUNTER SET 0
WAIT
MATCH Year5104 in the year 5104. It is
MATCH Year5105 in the year 5105. It is
MATCH Year5106 in the year 5106. It is
MATCH Year5107 in the year 5107. It is
MATCH Year5108 in the year 5108. It is
MATCH YearError elven time standard.
PUT time
MATCHWAIT
Year5104:
COUNTER SET 5104
GOTO FoundYear
Year5105:
COUNTER SET 5105
GOTO FoundYear
Year5106:
COUNTER SET 5106
GOTO FoundYear
Year5107:
COUNTER SET 5107
GOTO FoundYear
Year5108:
COUNTER SET 5108
GOTO FoundYear
YearError:
SAVE "Error in FindYear"
GOTO FatalError
FoundYear:
ECHO * Year: %c
GOTO ConvertYear
#GOTO FindTime
ConvertYear:
COUNTER SUBTRACT 3100
GOTO FoundConvertedYear
FoundConvertedYear:
ECHO * Year in English: %c
GOTO FindTime
FindTime:
SAVE ""
GOTO FindHour
FindHour:
#WAIT
MATCH Hour1 It is %s1
MATCH Hour2 It is %s2
MATCH Hour3 It is %s3
MATCH Hour4 It is %s4
MATCH Hour5 It is %s5
MATCH Hour6 It is %s6
MATCH Hour7 It is %s7
MATCH Hour8 It is %s8
MATCH Hour9 It is %s9
MATCH Hour0 It is %s0
MATCH FoundHour It is %s:
MATCH HourError elven time standard.
PUT time
MATCHWAIT
Hour1:
SAVE %s1
GOTO FindHour
Hour2:
SAVE %s2
GOTO FindHour
Hour3:
SAVE %s3
GOTO FindHour
Hour4:
SAVE %s4
GOTO FindHour
Hour5:
SAVE %s5
GOTO FindHour
Hour6:
SAVE %s6
GOTO FindHour
Hour7:
SAVE %s7
GOTO FindHour
Hour8:
SAVE %s8
GOTO FindHour
Hour9:
SAVE %s9
GOTO FindHour
Hour0:
SAVE %s0
GOTO FindHour
HourError:
SAVE "Error in FindHour"
GOTO FatalError
FoundHour:
COUNTER SET 0
GOTO FindMinute
FindMinute:
MATCH Minute1 It is %s:1
MATCH Minute2 It is %s:2
MATCH Minute3 It is %s:3
MATCH Minute4 It is %s:4
MATCH Minute5 It is %s:5
MATCH Minute6 It is %s:6
MATCH Minute7 It is %s:7
MATCH Minute8 It is %s:8
MATCH Minute9 It is %s:9
MATCH Minute0 It is %s:0
MATCH MinuteError elven time standard.
PUT time
MATCHWAIT
Minute1:
COUNTER SET %c1
GOTO MinuteHelper
Minute2:
COUNTER SET %c2
GOTO MinuteHelper
Minute3:
COUNTER SET %c3
GOTO MinuteHelper
Minute4:
COUNTER SET %c4
GOTO MinuteHelper
Minute5:
COUNTER SET %c5
GOTO MinuteHelper
Minute6:
COUNTER SET %c6
GOTO MinuteHelper
Minute7:
COUNTER SET %c7
GOTO MinuteHelper
Minute8:
COUNTER SET %c8
GOTO MinuteHelper
Minute9:
COUNTER SET %c9
GOTO MinuteHelper
Minute0:
COUNTER SET %c0
GOTO MinuteHelper
MinuteHelper:
WAIT
MATCH Minute1 It is %s:%c1
MATCH Minute2 It is %s:%c2
MATCH Minute3 It is %s:%c3
MATCH Minute4 It is %s:%c4
MATCH Minute5 It is %s:%c5
MATCH Minute6 It is %s:%c6
MATCH Minute7 It is %s:%c7
MATCH Minute8 It is %s:%c8
MATCH Minute9 It is %s:%c9
MATCH Minute0 It is %s:%c0
MATCH MinuteLeadingZero It is %s:0%c by the elven time standard.
MATCH FoundMinute It is %s:%c by the elven time standard.
MATCH MinuteError elven time standard.
PUT time
MATCHWAIT
MinuteError:
SAVE "Error in FindMinute"
GOTO FatalError
MinuteLeadingZero:
ECHO * Leading Zero in Minute
# ECHO * Because of the way the Wizard saves the counter variable,
# ECHO * it trims leading zeros off of the variable. The variable
# ECHO * extraction still works, but the representation won't look
# ECHO * as pretty without a lot more code. Actually, if seperate
# ECHO * variables are not needed for the hour and minute, it is
# ECHO * easiest to combine the two into %s, but I feel that keeping
# ECHO * the variables seperate is more useful
GOTO FoundTime # Comment out this line to make the time representation in the Wizard to look right
GOTO FoundTimeLeadingZero
FoundTimeLeadingZero:
SAVE %s:0%c
ECHO * Time: %s
GOTO Done
FoundMinute:
GOTO FoundTime
TimeError:
SAVE "Error in FindTime"
GOTO FatalError
FoundTime:
ECHO * Time: %s:%c
GOTO Done
LabelError:
ECHO * LabelError, most likely due to conversion of Day of the Huntress
ECHO * Will attempt to fix problem, but issue is known
SAVE Friday
GOTO FoundConvertedWeekDay
FatalError:
ECHO *
ECHO * Fatal Error Encountered:
ECHO * %s
ECHO *
EXIT
Done:
EXIT
Since I wrote the script in about three hours, I'm sure there are some bugs (I'm really not sure about how the Day of the Huntress [Friday] will work), but I got many of the other kinks worked out.
This script doesn't output the information in a very "pretty" way, but this is mostly due to the two variable nature of the Wizard. It's also right about useless, but it's more about the concepts than the function. Also, because of the way the script is written, it would be pretty easy to break it up to only get the minutes of the hour for instance.
I think Bob said that %c and %s are already used by the Stockade script, but I'm too lazy to look at the script and see if I could modify it to use a more flexible structure because I'm rarely in the stockades.
Anyway, here's the script. I'll probably play around with it some more and post some edits later.
Damn, the BBCode code format looks shitty. I'll post an attachment too that should look better.
# Find the current day, month, year, etc.
Start:
COUNTER SET 0
SAVE ""
FindWeekDay:
MATCH WeekDayRestday Today is Restday,
MATCH WeekDayVolnes Today is Volnes,
MATCH WeekDayTilamaires Today is Tilamaires,
MATCH WeekDayLeyan Today is Leyan,
MATCH WeekDayNiiman Today is Niiman,
MATCH WeekDayDayOfTheHuntress Today is the Day of the Huntress,
MATCH WeekDayFeastday Today is Feastday,
MATCH WeekDayError elven time standard.
PUT time
MATCHWAIT
WeekDayRestday:
SAVE Restday
GOTO FoundWeekDay
WeekDayVolnes:
SAVE Volnes
GOTO FoundWeekDay
WeekDayTilamaires:
SAVE Tilamaires
GOTO FoundWeekDay
WeekDayLeyan:
SAVE Leyan
GOTO FoundWeekDay
WeekDayNiiman:
SAVE Niiman
GOTO FoundWeekDay
WeekDayDayOfTheHuntress:
SAVE "Day of the Huntress"
SAVE Day_of_the_Huntress
GOTO FoundWeekDay
WeekDayFeastday:
SAVE Feastday
GOTO FoundWeekDay
WeekDayError:
SAVE "Error in FindWeekDay"
GOTO FatalError
FoundWeekDay:
ECHO * Day of the week: %s
GOTO ConvertWeekDay
#GOTO FindDayOfMonth
ConvertWeekDay:
GOTO ConvertWeekDay%s
ConvertWeekDayRestday:
SAVE Sunday
GOTO FoundConvertedWeekDay
ConvertWeekDayVolnes:
SAVE Monday
GOTO FoundConvertedWeekDay
ConvertWeekDayTilamaires:
SAVE Tuesday
GOTO FoundConvertedWeekDay
ConvertWeekDayLeyan:
SAVE Wednesday
GOTO FoundConvertedWeekDay
ConvertWeekDayNiiman:
SAVE Thursday
GOTO FoundConvertedWeekDay
ConvertWeekDayDay_of_the_Huntress:
SAVE Friday
GOTO FoundConvertedWeekDay
ConvertWeekDayFeastday:
SAVE Saturday
GOTO FoundConvertedWeekDay
FoundConvertedWeekDay:
ECHO * Weekday in English: %s
GOTO FindDayOfMonth
FindDayOfMonth:
COUNTER SET 0
WAIT
MATCH DayOfMonth1 day 1
MATCH DayOfMonth2 day 2
MATCH DayOfMonth3 day 3
MATCH DayOfMonth4 day 4
MATCH DayOfMonth5 day 5
MATCH DayOfMonth6 day 6
MATCH DayOfMonth7 day 7
MATCH DayOfMonth8 day 8
MATCH DayOfMonth9 day 9
MATCH DayOfMonth0 day 0
MATCH DayOfMonthError elven time standard.
PUT time
MATCHWAIT
DayOfMonth1:
COUNTER SET %c1
GOTO DayOfMonthHelper
DayOfMonth2:
COUNTER SET %c2
GOTO DayOfMonthHelper
DayOfMonth3:
COUNTER SET %c3
GOTO DayOfMonthHelper
DayOfMonth4:
COUNTER SET %c4
GOTO DayOfMonthHelper
DayOfMonth5:
COUNTER SET %c5
GOTO DayOfMonthHelper
DayOfMonth6:
COUNTER SET %c6
GOTO DayOfMonthHelper
DayOfMonth7:
COUNTER SET %c7
GOTO DayOfMonthHelper
DayOfMonth8:
COUNTER SET %c8
GOTO DayOfMonthHelper
DayOfMonth9:
COUNTER SET %c9
GOTO DayOfMonthHelper
DayOfMonth0:
COUNTER SET %c0
GOTO DayOfMonthHelper
DayOfMonthHelper:
WAIT
MATCH DayOfMonth1 day %c1
MATCH DayOfMonth2 day %c2
MATCH DayOfMonth3 day %c3
MATCH DayOfMonth4 day %c4
MATCH DayOfMonth5 day %c5
MATCH DayOfMonth6 day %c6
MATCH DayOfMonth7 day %c7
MATCH DayOfMonth8 day %c8
MATCH DayOfMonth9 day %c9
MATCH DayOfMonth0 day %c0
MATCH FoundDayOfMonth day %c
MATCH DayOfMonthError elven time standard.
PUT time
MATCHWAIT
DayOfMonthError:
SAVE "Error in FindDayOfMonth"
GOTO FatalError
FoundDayOfMonth:
ECHO * Day of the month: %c
GOTO FindMonth
FindMonth:
SAVE ""
WAIT
MATCH MonthLormesta of the month Lormesta in the year
MATCH MonthFashanos of the month Fashanos in the year
MATCH MonthCharlatos of the month Charlatos in the year
MATCH MonthOlaesta of the month Olaesta in the year
MATCH MonthIvastaen of the month Ivastaen in the year
MATCH MonthLumnea of the month Lumnea in the year
MATCH MonthKoaratos of the month Koaratos in the year
MATCH MonthPhoenatos of the month Phoenatos in the year
MATCH MonthImaerasta of the month Imaerasta in the year
MATCH MonthJastatos of the month Jastatos in the year
MATCH MonthEoantos of the month Eoantos in the year
MATCH MonthEorgaen of the month Eorgaen in the year
MATCH MonthError elven time standard.
PUT time
MATCHWAIT
MonthLormesta:
SAVE Lormesta
GOTO FoundMonth
MonthFashanos:
SAVE Fashanos
GOTO FoundMonth
MonthCharlatos:
SAVE Charlatos
GOTO FoundMonth
MonthOlaesta:
SAVE Olaesta
GOTO FoundMonth
MonthIvastaen:
SAVE Ivastaen
GOTO FoundMonth
MonthLumnea:
SAVE Lumnea
GOTO FoundMonth
MonthKoaratos:
SAVE Koaratos
GOTO FoundMonth
MonthPhoenatos:
SAVE Phoenatos
GOTO FoundMonth
MonthImaerasta:
SAVE Imaerasta
GOTO FoundMonth
MonthJastatos:
SAVE Jastatos
GOTO FoundMonth
MonthEoantos:
SAVE Eoantos
GOTO FoundMonth
MonthEorgaen:
SAVE Eorgaen
GOTO FoundMonth
MonthError:
SAVE "Error in FindMonth"
GOTO FatalError
FoundMonth:
ECHO * Month: %s
GOTO ConvertMonth
#GOTO FindYear
ConvertMonth:
GOTO ConvertMonth%s
ConvertMonthLormesta:
SAVE January
GOTO FoundConvertedMonth
ConvertMonthFashanos:
SAVE February
GOTO FoundConvertedMonth
ConvertMonthCharlatos:
SAVE March
GOTO FoundConvertedMonth
ConvertMonthOlaesta:
SAVE April
GOTO FoundConvertedMonth
ConvertMonthIvastaen:
SAVE May
GOTO FoundConvertedMonth
ConvertMonthLumnea:
SAVE June
GOTO FoundConvertedMonth
ConvertMonthKoaratos:
SAVE July
GOTO FoundConvertedMonth
ConvertMonthPhoenatos:
SAVE August
GOTO FoundConvertedMonth
ConvertMonthImaerasta:
SAVE September
GOTO FoundConvertedMonth
ConvertMonthJastatos:
SAVE October
GOTO FoundConvertedMonth
ConvertMonthEoantos:
SAVE November
GOTO FoundConvertedMonth
ConvertMonthEorgaen:
SAVE December
GOTO FoundConvertedMonth
FoundConvertedMonth:
ECHO * Month in English: %s
GOTO FindYear
# The FindYear section is only set up to recognize up to 2008.
# It would be very easy to expand to forever, but would add four
# more uses of the time verb. I didn't see it as neccesary for a
# script with little practical purpose
FindYear:
COUNTER SET 0
WAIT
MATCH Year5104 in the year 5104. It is
MATCH Year5105 in the year 5105. It is
MATCH Year5106 in the year 5106. It is
MATCH Year5107 in the year 5107. It is
MATCH Year5108 in the year 5108. It is
MATCH YearError elven time standard.
PUT time
MATCHWAIT
Year5104:
COUNTER SET 5104
GOTO FoundYear
Year5105:
COUNTER SET 5105
GOTO FoundYear
Year5106:
COUNTER SET 5106
GOTO FoundYear
Year5107:
COUNTER SET 5107
GOTO FoundYear
Year5108:
COUNTER SET 5108
GOTO FoundYear
YearError:
SAVE "Error in FindYear"
GOTO FatalError
FoundYear:
ECHO * Year: %c
GOTO ConvertYear
#GOTO FindTime
ConvertYear:
COUNTER SUBTRACT 3100
GOTO FoundConvertedYear
FoundConvertedYear:
ECHO * Year in English: %c
GOTO FindTime
FindTime:
SAVE ""
GOTO FindHour
FindHour:
#WAIT
MATCH Hour1 It is %s1
MATCH Hour2 It is %s2
MATCH Hour3 It is %s3
MATCH Hour4 It is %s4
MATCH Hour5 It is %s5
MATCH Hour6 It is %s6
MATCH Hour7 It is %s7
MATCH Hour8 It is %s8
MATCH Hour9 It is %s9
MATCH Hour0 It is %s0
MATCH FoundHour It is %s:
MATCH HourError elven time standard.
PUT time
MATCHWAIT
Hour1:
SAVE %s1
GOTO FindHour
Hour2:
SAVE %s2
GOTO FindHour
Hour3:
SAVE %s3
GOTO FindHour
Hour4:
SAVE %s4
GOTO FindHour
Hour5:
SAVE %s5
GOTO FindHour
Hour6:
SAVE %s6
GOTO FindHour
Hour7:
SAVE %s7
GOTO FindHour
Hour8:
SAVE %s8
GOTO FindHour
Hour9:
SAVE %s9
GOTO FindHour
Hour0:
SAVE %s0
GOTO FindHour
HourError:
SAVE "Error in FindHour"
GOTO FatalError
FoundHour:
COUNTER SET 0
GOTO FindMinute
FindMinute:
MATCH Minute1 It is %s:1
MATCH Minute2 It is %s:2
MATCH Minute3 It is %s:3
MATCH Minute4 It is %s:4
MATCH Minute5 It is %s:5
MATCH Minute6 It is %s:6
MATCH Minute7 It is %s:7
MATCH Minute8 It is %s:8
MATCH Minute9 It is %s:9
MATCH Minute0 It is %s:0
MATCH MinuteError elven time standard.
PUT time
MATCHWAIT
Minute1:
COUNTER SET %c1
GOTO MinuteHelper
Minute2:
COUNTER SET %c2
GOTO MinuteHelper
Minute3:
COUNTER SET %c3
GOTO MinuteHelper
Minute4:
COUNTER SET %c4
GOTO MinuteHelper
Minute5:
COUNTER SET %c5
GOTO MinuteHelper
Minute6:
COUNTER SET %c6
GOTO MinuteHelper
Minute7:
COUNTER SET %c7
GOTO MinuteHelper
Minute8:
COUNTER SET %c8
GOTO MinuteHelper
Minute9:
COUNTER SET %c9
GOTO MinuteHelper
Minute0:
COUNTER SET %c0
GOTO MinuteHelper
MinuteHelper:
WAIT
MATCH Minute1 It is %s:%c1
MATCH Minute2 It is %s:%c2
MATCH Minute3 It is %s:%c3
MATCH Minute4 It is %s:%c4
MATCH Minute5 It is %s:%c5
MATCH Minute6 It is %s:%c6
MATCH Minute7 It is %s:%c7
MATCH Minute8 It is %s:%c8
MATCH Minute9 It is %s:%c9
MATCH Minute0 It is %s:%c0
MATCH MinuteLeadingZero It is %s:0%c by the elven time standard.
MATCH FoundMinute It is %s:%c by the elven time standard.
MATCH MinuteError elven time standard.
PUT time
MATCHWAIT
MinuteError:
SAVE "Error in FindMinute"
GOTO FatalError
MinuteLeadingZero:
ECHO * Leading Zero in Minute
# ECHO * Because of the way the Wizard saves the counter variable,
# ECHO * it trims leading zeros off of the variable. The variable
# ECHO * extraction still works, but the representation won't look
# ECHO * as pretty without a lot more code. Actually, if seperate
# ECHO * variables are not needed for the hour and minute, it is
# ECHO * easiest to combine the two into %s, but I feel that keeping
# ECHO * the variables seperate is more useful
GOTO FoundTime # Comment out this line to make the time representation in the Wizard to look right
GOTO FoundTimeLeadingZero
FoundTimeLeadingZero:
SAVE %s:0%c
ECHO * Time: %s
GOTO Done
FoundMinute:
GOTO FoundTime
TimeError:
SAVE "Error in FindTime"
GOTO FatalError
FoundTime:
ECHO * Time: %s:%c
GOTO Done
LabelError:
ECHO * LabelError, most likely due to conversion of Day of the Huntress
ECHO * Will attempt to fix problem, but issue is known
SAVE Friday
GOTO FoundConvertedWeekDay
FatalError:
ECHO *
ECHO * Fatal Error Encountered:
ECHO * %s
ECHO *
EXIT
Done:
EXIT