Suggestions for implementing an event triggered logging system?

Posted by Gdub on Fri 25 Oct 2024 12:06 AM — 7 posts, 9,540 views.

#0
hi folks,

Looking for some input on how I would go about capturing game output to a log file that could be triggered by specific events? Stuff like solving a big quest or PVP conflicts.

I think I know how to setup the event triggers but am not sure how to go about capturing game output with all its ANSI glory...

A PVP example would be:
2 players engage in PVP.
I would like to capture (from each players POV) ~60 seconds leading up to the engagement, their equipment and inventory.

Here's an example from another MUD: https://www.durismud.com/pvp/logs/301761

Any suggestions will be greatly appreciated!
Amended on Fri 25 Oct 2024 08:32 PM by Gdub
#1
I think I have a solution... sleep does wonders for problem solving. :)
#2
I plugged into send_to_char_color() and act() with my logging hooks and am successfully writing to file. It's not capturing all the ANSI goodness though.


&g^wOvergrown Park^x

&rAlso in the room: Ant.

Obvious Exits: none.

You move to attack Ant.

! Autocombat ON !

Ant moves to attack you.

You are using:

<wielded>           &C<&R++++++++--&C>&W  &cSabre&g

<held>              &C<&R----------&C>&W  &cElvish Flute&g

<worn on back>      &C<&R++++++++++&C>&W  &cbrown leather backpack&g

Voodoo slashes Ant for 7 damage with his Sabre.

Ant charges north.

Ant flees head over heels!

&O! Autocombat OFF !

Saved...

Your surroundings begin to fade as a mystical swirling vortex of colors

envelops your body...



I'll keep digging/researching but if anyone has ideas, please share. Thank you
Amended on Fri 25 Oct 2024 08:33 PM by Gdub
#3
I shuffled everything 1 step lower to write_to_buffer() and it appears to be working!

If anyone want wants this code, please let me know.
Amended on Sat 26 Oct 2024 12:17 AM by Gdub
Australia Forum Administrator #4
OK, nicely done. Glad you solved it.
#5
I'm still not super happy with the quality of the logs themselves but the system is working.

Maybe I can find a way to convert terminal output to HTML and post process them?
Australia Forum Administrator #6
There's a function in the server that converts stuff like &C into colours. You could simply do a find-and-replace of all those codes into HTML styles easily enough.