 |
jorvis01 Newbie
Joined: 14 Jan 2011 Posts: 4 Location: US
|
Posted: Fri Jan 14, 2011 4:51 pm
%time Capturing time without sending to MUD |
I don't have a lot of experience with MUD's or scripting so trying to get CMUD to do what I want is a bit difficult.
| Code: |
#CAP tells you;#GAG;%time("mmmm d, hh:mm am/pm")%char( 32)
#Capture (1) chat; |
This works well in my chat window. It provides the time just like I want. The problem is that %time actually sends out to the MUD which then spits back an error basically telling me I'm insane.
Is there a way to have the time display in the session without sending it to the MUD so that I can capture it?
Thanks in advance to everyones responses.
-Noob |
|
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Jan 14, 2011 4:57 pm |
You can go into Preferences and enable timestamping, but if you only want the time to appear for certain lines you will need to look at the following chart:
1)%time() -- wrong! (cannot start a line with a function call)
2)@linenumber %time() -- wrong! (cannot start a line with a variable)
3)#print %time() -- right! (can use any command you want) |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Jan 14, 2011 5:26 pm |
In addition, if you just want to "capture" the time, you can set the value into a variable. %time() is a function, which means it _returns_ a value. That value can be used in evaluations, equations, etc. E.g.:
| Code: |
#var currenttime %time("mmmm d, hh:mm am/pm")
$timeofday = %time("mmmm d, hh:mm am/pm")
#SHOW %concat("The time now is", %time("mmmm d, hh:mm am/pm"))
|
|
|
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Jan 14, 2011 5:39 pm |
Mmmm, specifically, if you want to put the time into the chat window, you can do:
| Code: |
#WINDOW chat %time("mmmm d, hh:mm am/pm")
|
If what you actually want to do is display the time that every line gets displayed in the chat window, there is a much easier way to do it. Click on the Chat window to select it. Then click Options and hunt through the option settings. I don't recall off the top of my head where it is under there, but there is an option to automatically start each line with a timestamp. Since each window has its own options, you can set this separately for your Chat window, your Main window, and any other windows you may have. |
|
|
|
 |
jorvis01 Newbie
Joined: 14 Jan 2011 Posts: 4 Location: US
|
Posted: Sat Jan 15, 2011 7:03 am |
Thanks MattLofton for information. It allowed me to do what I was trying to accomplish. Thanks Rahab for showing me an even better way. I now have nice looking timestamps on all my chat messages.
|
|
|
|
 |
|
|
|