Skip to content

Commit 907f93c

Browse files
committed
Added Timestamps plugin to the distribution
1 parent 5120d0c commit 907f93c

File tree

2 files changed

+117
-0
lines changed

2 files changed

+117
-0
lines changed

install/mushclient.nsi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ Section "Plugins"
461461
File "..\plugins\Summary.xml"
462462
File "..\plugins\Text_To_Speech.xml"
463463
File "..\plugins\Timer.xml"
464+
File "..\plugins\Timestamps.xml"
464465
File "..\plugins\idle_message.xml"
465466
File "..\plugins\msp.xml"
466467
File "..\plugins\multiple_send.xml"
@@ -689,6 +690,7 @@ Section Uninstall
689690
Delete "$INSTDIR\worlds\plugins\Summary.xml"
690691
Delete "$INSTDIR\worlds\plugins\Text_To_Speech.xml"
691692
Delete "$INSTDIR\worlds\plugins\Timer.xml"
693+
Delete "$INSTDIR\worlds\plugins\Timestamps.xml"
692694
Delete "$INSTDIR\worlds\plugins\idle_message.xml"
693695
Delete "$INSTDIR\worlds\plugins\msp.xml"
694696
Delete "$INSTDIR\worlds\plugins\multiple_send.xml"

plugins/Timestamps.xml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
<?xml version="1.0" encoding="iso-8859-1"?>
2+
<!DOCTYPE muclient>
3+
4+
<!--
5+
Change the following variables to customise your timestamps:
6+
7+
TIMESTAMP_INPUT : what to put in front of things you type
8+
TIMESTAMP_OUTPUT : what to put in front of MUD output
9+
TIMESTAMP_NOTES : what to put in front of scripted notes
10+
11+
Text colours:
12+
13+
TIMESTAMP_INPUT_TEXT_COLOUR
14+
TIMESTAMP_OUTPUT_TEXT_COLOUR
15+
TIMESTAMP_NOTES_TEXT_COLOUR
16+
17+
Background (behind the timestamp) colours:
18+
19+
TIMESTAMP_INPUT_BACK_COLOUR
20+
TIMESTAMP_OUTPUT_BACK_COLOUR
21+
TIMESTAMP_NOTES_BACK_COLOUR
22+
23+
24+
-->
25+
26+
<muclient>
27+
<plugin
28+
name="Timestamps"
29+
author="Nick Gammon"
30+
id="559d05b18c3fd5602a433cf8"
31+
language="Lua"
32+
purpose="Adds a timestamp to each line in the output window"
33+
save_state="y"
34+
date_written="2010-09-25 14:02:11"
35+
requires="4.62"
36+
version="1.0"
37+
>
38+
<description trim="y">
39+
<![CDATA[
40+
Enable this plugin to see timestamps.
41+
42+
Disable to hide them.
43+
]]>
44+
</description>
45+
46+
</plugin>
47+
48+
49+
<!-- Script -->
50+
51+
52+
<script>
53+
<![CDATA[
54+
55+
TIMESTAMP_INPUT = "%H:%M:%S $ "
56+
TIMESTAMP_OUTPUT = "%H:%M:%S > "
57+
TIMESTAMP_NOTES = "%H:%M:%S ! "
58+
59+
TIMESTAMP_INPUT_TEXT_COLOUR = ColourNameToRGB ("maroon")
60+
TIMESTAMP_OUTPUT_TEXT_COLOUR = ColourNameToRGB ("white")
61+
TIMESTAMP_NOTES_TEXT_COLOUR = ColourNameToRGB ("cyan")
62+
63+
TIMESTAMP_INPUT_BACK_COLOUR = ColourNameToRGB ("#151515")
64+
TIMESTAMP_OUTPUT_BACK_COLOUR = ColourNameToRGB ("#151515")
65+
TIMESTAMP_NOTES_BACK_COLOUR = ColourNameToRGB ("#151515")
66+
67+
function OnPluginInstall ()
68+
69+
-- if disabled last time, stay disabled
70+
if GetVariable ("enabled") == "false" then
71+
ColourNote ("yellow", "", "Warning: Plugin " .. GetPluginName ().. " is currently disabled.")
72+
check (EnablePlugin(GetPluginID (), false))
73+
end -- they didn't enable us last time
74+
75+
OnPluginEnable ()
76+
77+
end -- OnPluginInstall
78+
79+
function OnPluginSaveState ()
80+
SetVariable ("enabled", tostring (GetPluginInfo (GetPluginID (), 17)))
81+
end -- OnPluginSaveState
82+
83+
function OnPluginDisable ()
84+
85+
SetAlphaOption ("timestamp_input", "")
86+
SetAlphaOption ("timestamp_output", "")
87+
SetAlphaOption ("timestamp_notes", "")
88+
Redraw ()
89+
90+
end -- OnPluginDisable
91+
92+
function OnPluginEnable ()
93+
94+
SetAlphaOption ("timestamp_input", TIMESTAMP_INPUT)
95+
SetAlphaOption ("timestamp_output", TIMESTAMP_OUTPUT)
96+
SetAlphaOption ("timestamp_notes", TIMESTAMP_NOTES)
97+
98+
SetOption ("timestamp_input_text_colour", TIMESTAMP_INPUT_TEXT_COLOUR )
99+
SetOption ("timestamp_output_text_colour", TIMESTAMP_OUTPUT_TEXT_COLOUR )
100+
SetOption ("timestamp_notes_text_colour", TIMESTAMP_NOTES_TEXT_COLOUR )
101+
102+
SetOption ("timestamp_input_back_colour", TIMESTAMP_INPUT_BACK_COLOUR )
103+
SetOption ("timestamp_output_back_colour", TIMESTAMP_OUTPUT_BACK_COLOUR )
104+
SetOption ("timestamp_notes_back_colour", TIMESTAMP_NOTES_BACK_COLOUR )
105+
106+
Redraw ()
107+
108+
end -- OnPluginEnable
109+
110+
111+
]]>
112+
</script>
113+
114+
115+
</muclient>

0 commit comments

Comments
 (0)