Quote:
Can you make a trigger to catch the world.note stuff
--- Connected on Friday, February 07, 2003, 8:52 AM ---
and the disconnected message and then find the difference between them? I seem to be having troubles getting a trigger to match.
Those messages are world "notes" and triggers only match on incoming text from the MUD, so that won't work. However MUSHclient provides a "callback" for world connect and disconnect, so simply put a script function for both of them. Something like this, although I haven't tested it ...
dim connect_time
connect_time = Now ' in case already connected
sub OnConnect
connect_time = Now
end sub
sub OnDisconnect
dim Elapsed, TotalConnected
'
' get connected time in minutes
'
Elapsed = DateDiff ("m", connect_time, Now)
'
' find previous connected time
'
TotalConnected = CLng (world.GetVariable ("connected_time"))
'
' add new time
'
TotalConnected = TotalConnected + CLng (Elapsed)
'
' save new time
'
world.SetVariable "connected_time", TotalConnected
end sub