initial release
This commit is contained in:
158
cosmic rage/worlds/plugins/Timestamps.xml
Normal file
158
cosmic rage/worlds/plugins/Timestamps.xml
Normal file
@@ -0,0 +1,158 @@
|
||||
<?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"
|
||||
date_modified="2011-05-20 16:05:00"
|
||||
requires="4.62"
|
||||
version="1.1"
|
||||
>
|
||||
<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))
|
||||
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 OnPluginClose ()
|
||||
OnPluginDisable ()
|
||||
end -- OnPluginClose
|
||||
|
||||
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>
|
||||
Reference in New Issue
Block a user