Time/Appending

Posted by Hoss on Tue 15 Mar 2005 03:18 AM — 7 posts, 24,902 views.

USA #0
I didn't see any other post about this but I want so when I receive this:

(Pages): Lazul says, "A rite to help you gather things."

It would appened 09:12|Lazu: A Rite to help you gather things.

I already have the trigger to put the name and message in but I need help in order to put the time it was said..

Here is the trigger I have so far:

<triggers>
<trigger
enabled="y"
match="(Pages): * says, &quot;*&quot;"
send_to="5"
sequence="100"
>
<send>%1: %2</send>
</trigger>
</triggers>

Any help will be appreciated

Hoss
USA #1
You get the time using the VBScript time functions/variables/etc.

"Time" contains the current system time (Now contains date/time).
However, then you have to deal with seconds etc. You can use Hour() and Minute() to return those (with a time in parenthesis). I think that would be your best bet.

So, Hour(Now) would be the hour and Minute(Now) would be the minute.

You'd have to change to send to script, and then script this out and then send it back to the output.
Amended on Tue 15 Mar 2005 07:40 AM by Flannel
USA #2
Hey Thanks I got it working now I'm having problems matching on two different lines For Example It shows:

(*): * says, "I don't suppose there's a * willing to(line Break)
reflect for me on spectre? I need the karma bad."

I was wondering how I could match on that and still match on something that is only one line like:

(*): * says, "We need ae general store."

Here's the trigger I have for appending:

<triggers>
<trigger
enabled="y"
match="(Magnagora): * *, &quot;*.&quot;"
send_to="5"
sequence="99"
>
<send>world.AppendToNotepad "CityTells", Hour(Now) &amp; ":" &amp; Minute(Now) &amp; " | (Magnagora) %1: %3"


</send>
</trigger>
</triggers>


but I'm having problems figuring out how to be able to match on multiple lines. Any Ideas?

Hoss
USA #3
While I'm at it I'm having some problems with the MoveNotepadWindow command It doesn't seem to be working here is what I have MoveNotepadWindow "CHANNELS" 1, 430, 1020, 158 but whenever it matches on it and tries that it tells me

Error number: -2146827263
Event: Execution of line 2 column 32
Description: Expected end of statement
Line in error:
MoveNotepadWindow ("CHANNELS") 1, 430, 1020, 158
Called by: Immediate execution

Any Ideas?

Hoss
USA #4
Also, How do you make it so when it does append to a notepad it puts it on a seperate line?

Hoss

(Sorry for all the questions)
USA #5
Are the multiple lines serverside or just the client wrapping?
If they're clientside, you don't need to do anything differently. If they're serverside, you get you do some fun creative things (however, It's been done before) to determine when the line ends.

As for your move notepad, you'll need to seperate the notepad window name and the positions with a comma:
long MoveNotepadWindow(BSTR Title, long Left, long Top, long Width, long Height);

So, your example would be:
MoveNotepadWindow "CHANNELS", 1, 430, 1020, 158
Ah, I see that nick doesn't have that in his example. That's a typo on his part. There really should be that comma (and you don't put parenthesis).

And for linebreaks, you'll use VBCrLf (VisualBasic Carriage Return Line Feed) you just append it to the end of your strings like this:
AppendToNotepad "window", "somestuff to append" & VBCrLf
would append "somestuff to append" and then a newline (so your next append would end up on the next line).
Oh, and it's not case sensitive.
USA #6
Thanks Flannel thats excatly what I needed to know