-
Notifications
You must be signed in to change notification settings - Fork 15
/
AFK_timer.xml
132 lines (102 loc) · 2.46 KB
/
AFK_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
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient [
<!ENTITY afk_command "afk" >
<!ENTITY timer_mins "5" >
<!ENTITY timer_secs "0" >
<!ENTITY afk_message "You are now afk." >
<!ENTITY not_afk_message "You are no longer afk." >
]>
<!--
Customising (change above entities) ...
Change "afk_command" to whatever sets you AFK.
Default: afk
Change "timer_mins" to be the number of minutes before you are AFK.
Default: 5 minutes
Change "timer_secs" to be the number of seconds before you are AFK.
Default: 0 seconds
In other words, to be AFK after 2.5 minutes, timer_mins would be 2, and
timer_secs would be 30.
-->
<!-- Saved on Saturday, October 08, 2005, 10:37 AM -->
<!-- MuClient version 3.66 -->
<!-- Plugin "AFK_timer" generated by Plugin Wizard -->
<muclient>
<plugin
name="AFK_timer"
author="Nick Gammon"
id="4d167d47cac26fb36e161e48"
language="Lua"
purpose="Sends AFK to the MUD when 5 minutes elapse"
date_written="2005-10-08 10:32:50"
requires="3.52"
version="1.0"
>
<description trim="y">
<![CDATA[
After the specified interval (default 5 minutes) elapse, sends "afk" to the MUD.
]]>
</description>
</plugin>
<!-- Timers -->
<timers>
<timer name="afk_timer"
second="&timer_secs;"
minute="&timer_mins;"
send_to="12"
enabled="y"
>
<send>
ColourNote ("salmon", "", "You are now AFK.")
Send ("&afk_command;")
EnableTimer ("afk_timer", 0)
</send>
</timer>
</timers>
<!-- Triggers -->
<triggers>
<trigger
enabled="y"
match="¬_afk_message;"
send_to="12"
>
<send>
FixTimer () -- make sure timer is back on
</send>
</trigger>
</triggers>
<triggers>
<trigger
enabled="y"
match="&afk_message;"
send_to="12"
>
<send>
EnableTimer ("afk_timer", 0) -- make sure timer is off
</send>
</trigger>
</triggers>
<!-- Script -->
<script>
<![CDATA[
-- when they type something, reset AFK status
function OnPluginCommand (sText)
FixTimer ()
return true -- process the command
end
-- when you connect to the MUD, presumably you are not AFK
function OnPluginConnect ()
FixTimer ()
end
-- shared routine to handle turning AFK off
function FixTimer ()
if GetTimerOption ("afk_timer", "enabled") == 0 then
ColourNote ("salmon", "", "You are no longer AFK.")
end
-- turn timer back on
EnableTimer ("afk_timer", 1)
-- make sure the full time interval elapses
ResetTimer ("afk_timer")
end
]]>
</script>
</muclient>