-
Notifications
You must be signed in to change notification settings - Fork 15
/
Level_Timer.xml
117 lines (93 loc) · 2.03 KB
/
Level_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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient[
<!ENTITY trigger_match
"*You raised a level!" >
]>
<!-- Saved on Monday, August 11, 2003, 7:34 AM -->
<!-- MuClient version 3.42 -->
<!-- Plugin "Level_Timer" generated by Plugin Wizard -->
<!--
Change the entity above to reflect the message you get when you level.
-->
<muclient>
<plugin
name="Level_Timer"
author="Nick Gammon"
id="5f4928cc5f9e2306d3b0a361"
language="VBscript"
purpose="Displays how long it take you to level"
save_state="y"
date_written="2003-08-11 07:32:28"
requires="3.24"
version="1.0"
>
<description trim="y">
<![CDATA[
When installed, this plugin will display how long it takes you to level.
]]>
</description>
</plugin>
<!-- Triggers -->
<triggers>
<trigger
custom_colour="7"
enabled="y"
match="&trigger_match;"
script="OnLevel"
sequence="100"
other_text_colour="black"
other_back_colour="black"
>
</trigger>
</triggers>
<!-- Script -->
<script>
<![CDATA[
sub OnLevel (name, line, wildcards)
dim oldtime
dim newtime
dim days, hours, minutes
dim s1, s2, s3
dim msg
oldtime = GetVariable ("last_level_time")
'
' First time - just remember when we levelled
'
if IsEmpty (oldtime) or not IsDate (oldtime) then
SetVariable "last_level_time", now
Note "Level time noted."
exit sub
end if
'
' Find total minutes it took to level
'
minutes = DateDiff ("n", CDate (oldtime), Now)
'
' Convert to days, hours, minutes
'
days = Fix (minutes / 1440)
minutes = minutes - (days * 1440) ' remainder
hours = Fix (minutes / 60)
minutes = minutes - (hours * 60) ' remainder
'
' Add "s" if plural
'
s1 = "s"
s2 = "s"
s3 = "s"
if days = 1 then s1 = ""
if hours = 1 then s2 = ""
if minutes = 1 then s3 = ""
'
' Make message
'
msg = "Time to level = " _
& days & " day" & s1 & ", " _
& hours & " hour" & s2 & ", " _
& minutes & " minute" & s3 & "."
ColourNote "white", "blue", msg
SetVariable "last_level_time", now
end sub
]]>
</script>
</muclient>