Using subtime - TADS1.3

Well, here I am using TADS3.1

I finally have subtime.t working well in my game except for a small problem. I am using a watch to tell the time and it works great. I would like to be able to tell the time using the following commands ‘time’ or ‘read time’ or ‘look at time’ or ‘l time’.

I’ve been searching through the manuals but I can’t find what I need to accomplish this. Once again, I’m looking here for someone to bail me out. :question:

Rong

Reading subtime.t suggests that the clockManager object can give you the info you need through its checkTimeFmt() method. So all you need is to create a new verb matches the commands you specified in your post and that prints whatever checkTimeFmt() returns.

Thanks for the suggestion. Due to my problems with sight and memory, I have trouble remembering and noting things that I look for in the manuals. Would someone give me some examples on how to create and use the verbs I first mentioned in this post :question:

That will give me some things to print from this series of posts and use them as references.

RonG

Sure. Here is code for a LookAtTime action with verb rules that match your requirements:

TIME
READ TIME
READ THE TIME
LOOK AT TIME
LOOK AT THE TIME
L TIME

[code]DefineIAction(LookAtTime)
execAction()
{
“The time is <<clockManager.checkTimeFmt(‘hh:mma’)>>\n”;
}
// This action should consume no time (not advance the current turn.)
// If you prefer that this action should consume actual game time,
// then delete this.
actionTime = 0;
;

VerbRule(LookAtTime)
‘time’
| ‘read’ (| ‘the’) ‘time’
| ‘look’ ‘at’ (| ‘the’) ‘time’
| ‘l’ ‘time’
: LookAtTimeAction
verbPhrase = ‘look/looking at the time’
;[/code]

Thanks for the help. Your example will help me a lot in my future dealings with new verbs.

RonG :smiley: