-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathTimer.xml
147 lines (115 loc) · 2.3 KB
/
Timer.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>
<!-- Saved on Thursday, March 04, 2004, 7:32 AM -->
<!-- MuClient version 3.42 -->
<!-- Plugin "Timer" generated by Plugin Wizard -->
<muclient>
<plugin
name="Timer"
author="Nick Gammon"
id="cc98cbe576474a19d1715a02"
language="VBscript"
purpose="Shows elapsed time in status bar"
date_written="2004-03-04 07:29:18"
requires="3.30"
version="1.0"
>
<description trim="y">
<![CDATA[
This plugin displays time connected in the status bar. It can be reset to zero when you like.
The time is shown as hours and minutes (eg. 4h 22m) - if you are connected for more than a day then it will show more than 24 hours. You could amend it slightly to change that if you wanted.
Commands
--------
timerreset - reset timer to zero
Timer:help - show this help
]]>
</description>
</plugin>
<!-- Aliases -->
<aliases>
<alias
script="TimerToZero"
match="resettimer"
enabled="y"
send_to="2"
sequence="100"
>
<send>Timer reset.</send>
</alias>
</aliases>
<!-- Timers -->
<timers>
<timer name="StatusBarTimer" script="ElapsedTimer" enabled="y" second="30" >
</timer>
</timers>
<!-- Script -->
<script>
<![CDATA[
'
' Timer showing when we last connected
'
dim tConnected
tConnected = Now
'
' This world has been connected (to the MUD)
'
sub OnPluginConnect
tConnected = Now
Call ElapsedTimer ("StatusBarTimer")
end sub
'
' Plugin has been installed
'
sub OnPluginInstall
Call OnPluginConnect
end sub
'
' Called by alias to zero timer
'
Sub TimerToZero (sName, sLine, wildcards)
Call OnPluginConnect
End Sub
'
' Called when timer fires
'
Sub ElapsedTimer (sName)
dim Minutes, Hours
'
' Calculate how long in minutes
'
Minutes = DateDiff ("n", tConnected, Now)
'
' Convert to hours and minutes
'
Hours = Int (Minutes / 60)
Minutes = Minutes - (Hours * 60)
'
' Update status bar
'
SetStatus "Timer: " & Hours & "h " & Minutes & "m"
End Sub
'
' Plugin is being removed (closed)
'
sub OnPluginClose
SetStatus "Ready"
end sub
]]>
</script>
<!-- Plugin help -->
<aliases>
<alias
script="OnHelp"
match="Timer:help"
enabled="y"
>
</alias>
</aliases>
<script>
<![CDATA[
Sub OnHelp (sName, sLine, wildcards)
world.Note world.GetPluginInfo (world.GetPluginID, 3)
End Sub
]]>
</script>
</muclient>