Timestamp Plugin trouble

Posted by Tesagk on Fri 20 Nov 2015 12:51 PM — 12 posts, 45,382 views.

#0
Hello!

It's been YEARS since I've used MUSHclient and a lot seems to have changed. Or I simply didn't understand its capabilities a decade ago.

Either way, I tried installing the timestamp plugin via the provided XML. However, regardless of whether or not it was in MUSHclient's plugins folder or another directory, I got this error:

[WARNING] C:\Program Files (x86)\MUSHclient\worlds\plugins\Timestamp Plugin.xml
Line 26: Invalid '--' inside comment (Cannot load)

Any help in this matter would be much appreciated.

Running Windows 8.1, MUSHclient version 4.94 (the download offered from the main page).
USA Global Moderator #1
What is "Timestamp Plugin.xml"?

I only have "Timestamps.xml"

Did yours come from the forum somewhere?
Australia Forum Administrator #2
Perhaps copy and paste the plugin here, if it isn't too long.
#3

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>

<!--
Change the following variables to customise your timestamps:

TIMESTAMP_INPUT  : what to put in front of things you type
TIMESTAMP_OUTPUT : what to put in front of MUD output
TIMESTAMP_NOTES  : what to put in front of scripted notes

Text colours:

TIMESTAMP_INPUT_TEXT_COLOUR
TIMESTAMP_OUTPUT_TEXT_COLOUR
TIMESTAMP_NOTES_TEXT_COLOUR

Background (behind the timestamp) colours:

TIMESTAMP_INPUT_BACK_COLOUR
TIMESTAMP_OUTPUT_BACK_COLOUR
TIMESTAMP_NOTES_BACK_COLOUR

Special characters for date/time etc.

General
-------

%E - MUSHclient initial (startup) directory
%F - world files directory
%L - log files directory
%N - world name
%P - player name

Date/time
---------

%a - Abbreviated weekday name
%A - Full weekday name
%b - Abbreviated month name
%B - Full month name
%c - Date and time representation appropriate for locale
%d - Day of month as decimal number (01 - 31)
%H - Hour in 24-hour format (00 - 23)

%I - Hour in 12-hour format (01 - 12)
%j - Day of year as decimal number (001 - 366)
%m - Month as decimal number (01 - 12)
%M - Minute as decimal number (00 - 59)
%p - A.M./P.M. indicator for 12-hour clock
%S - Second as decimal number (00 - 59)
%U - Week of year as decimal number, with Sunday as first day of week (00 - 53)
%w - Weekday as decimal number (0 - 6; Sunday is 0)
%W - Week of year as decimal number, with Monday as first day of week (00 - 53)
%x - Date representation for current locale
%X - Time representation for current locale
%y - Year without century, as decimal number (00 - 99)
%Y - Year with century, as decimal number
%z, %Z  - Time-zone name or abbreviation; no characters if time zone is unknown
%% - Percent sign

%e - Elapsed time in microseconds since world started
%D - Delta time, in microseconds, since previous line

-->

<muclient>
<plugin
   name="Timestamps"
   author="Nick Gammon"
   id="559d05b18c3fd5602a433cf8"
   language="Lua"
   purpose="Adds a timestamp to each line in the output window"
   save_state="y"
   date_written="2010-09-25 14:02:11"
   requires="4.62"
   version="1.0"
   >
<description trim="y">
<![CDATA[
Enable this plugin to see timestamps.

Disable to hide them.
]]>
</description>

</plugin>


<!--  Script  -->


<script>
<![CDATA[

TIMESTAMP_INPUT   = "%H:%M:%S $ "
TIMESTAMP_OUTPUT  = "%H:%M:%S > "
TIMESTAMP_NOTES   = "%H:%M:%S ! "

TIMESTAMP_INPUT_TEXT_COLOUR   = ColourNameToRGB ("maroon")
TIMESTAMP_OUTPUT_TEXT_COLOUR  = ColourNameToRGB ("white")
TIMESTAMP_NOTES_TEXT_COLOUR   = ColourNameToRGB ("cyan")

TIMESTAMP_INPUT_BACK_COLOUR   = ColourNameToRGB ("#151515")
TIMESTAMP_OUTPUT_BACK_COLOUR  = ColourNameToRGB ("#151515")
TIMESTAMP_NOTES_BACK_COLOUR   = ColourNameToRGB ("#151515")

function OnPluginInstall ()

  -- if disabled last time, stay disabled
  if GetVariable ("enabled") == "false" then
    ColourNote ("yellow", "", "Warning: Plugin " .. GetPluginName ().. " is currently disabled.")
    check (EnablePlugin(GetPluginID (), false))
    return
  end -- they didn't enable us last time
 
  OnPluginEnable ()
  
end -- OnPluginInstall

function OnPluginSaveState ()
  SetVariable ("enabled", tostring (GetPluginInfo (GetPluginID (), 17)))
end -- OnPluginSaveState

function OnPluginDisable ()

  SetAlphaOption ("timestamp_input",  "")
  SetAlphaOption ("timestamp_output", "")
  SetAlphaOption ("timestamp_notes",  "")
  Redraw ()
  
end -- OnPluginDisable

function OnPluginEnable ()
 
  SetAlphaOption ("timestamp_input",  TIMESTAMP_INPUT)
  SetAlphaOption ("timestamp_output", TIMESTAMP_OUTPUT)
  SetAlphaOption ("timestamp_notes",  TIMESTAMP_NOTES)
  
  SetOption ("timestamp_input_text_colour",   TIMESTAMP_INPUT_TEXT_COLOUR )
  SetOption ("timestamp_output_text_colour",  TIMESTAMP_OUTPUT_TEXT_COLOUR )
  SetOption ("timestamp_notes_text_colour",   TIMESTAMP_NOTES_TEXT_COLOUR )

  SetOption ("timestamp_input_back_colour",   TIMESTAMP_INPUT_BACK_COLOUR )
  SetOption ("timestamp_output_back_colour",  TIMESTAMP_OUTPUT_BACK_COLOUR )
  SetOption ("timestamp_notes_back_colour",   TIMESTAMP_NOTES_BACK_COLOUR )

  Redraw ()
  
end -- OnPluginEnable


]]>
</script>


</muclient>
USA Global Moderator #4
It looks like you're using some kind of hybrid broken version of the plugin. Definitely not the Timestamps.xml plugin that comes with MUSHclient. Why not just use that instead?

( Nick, https://github.com/nickgammon/mushclient/commit/1a5ad2222ee452ff33cd0342e7d044730ec898c6

I edited this post to further remove the offending lines
http://www.gammon.com.au/forum/bbshowpost.php?id=10625&page=1 )
Amended on Sat 21 Nov 2015 02:05 AM by Fiendish
Australia Forum Administrator #5
Based on what Fiendish said try removing the multiple hyphens:


General
-------


And further down.
Australia Forum Administrator #6
It looks like MUSHclient is correctly throwing that error, though:

http://www.w3schools.com/xml/xml_syntax.asp

Quote:

Comments in XML

The syntax for writing comments in XML is similar to that of HTML.

<!-- This is a comment -->

Two dashes in the middle of a comment are not allowed.
#7
Yeah, I was grabbing the one in the forum thread. It looks like it's been edited. I'll try it again!
USA Global Moderator #8
Don't bother getting it from the thread. The plugin is already included with MUSHclient.
#9
Oh, where? I can't find it. I assume it's an option, but I have a tendency to miss the obvious...
USA Global Moderator #10
It's called Timestamps.xml and is included already in worlds/plugins. Just load it.
#11
Oh wow. I was scrolling to the side for some reason, instead of vertically. I thought there were only three plugins in there.

Thanks!