This repository has been archived by the owner on Jan 16, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
institute.trigger.xml
545 lines (508 loc) · 24.8 KB
/
institute.trigger.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MudletPackage>
<MudletPackage version="1.0">
<TriggerPackage>
<TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Institute</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList/>
<regexCodePropertyList/>
<TriggerGroup isActive="yes" isFolder="yes" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Tarot</name>
<script></script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList/>
<regexCodePropertyList/>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Soulless</name>
<script>if matches[3] == nil or tonumber(matches[3]) < 10 then
mm.doadd("rub soulless on " .. institute.target)
elseif tonumber(matches[3]) >= 10 then
mm.doadd("fling soulless at " .. institute.target)
end</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>^You sniff the card of the Soulless, and sense it has been imprinted upon (\w+) (\d+) times\.$</string>
<string>This Soulless card has not yet been imprinted on anyone.</string>
</regexCodeList>
<regexCodePropertyList>
<integer>1</integer>
<integer>3</integer>
</regexCodePropertyList>
</Trigger>
</TriggerGroup>
<Trigger isActive="yes" isFolder="no" isTempTrigger="no" isMultiline="no" isPerlSlashGOption="no" isColorizerTrigger="no" isFilterTrigger="no" isSoundTrigger="no" isColorTrigger="no" isColorTriggerFg="no" isColorTriggerBg="no">
<name>Logout</name>
<script>institute_saveConfig()</script>
<triggerType>0</triggerType>
<conditonLineDelta>0</conditonLineDelta>
<mStayOpen>0</mStayOpen>
<mCommand></mCommand>
<packageName></packageName>
<mFgColor>#ff0000</mFgColor>
<mBgColor>#ffff00</mBgColor>
<mSoundFile></mSoundFile>
<colorTriggerFgColor>#000000</colorTriggerFgColor>
<colorTriggerBgColor>#000000</colorTriggerBgColor>
<regexCodeList>
<string>You grow still and begin to pray silently for preservation of your soul while you are out of the land.</string>
</regexCodeList>
<regexCodePropertyList>
<integer>3</integer>
</regexCodePropertyList>
</Trigger>
</TriggerGroup>
</TriggerPackage>
<TimerPackage/>
<AliasPackage>
<AliasGroup isActive="yes" isFolder="yes">
<name>Institute</name>
<script></script>
<command></command>
<packageName></packageName>
<regex></regex>
<AliasGroup isActive="yes" isFolder="yes">
<name>Target</name>
<script></script>
<command></command>
<packageName></packageName>
<regex></regex>
<Alias isActive="yes" isFolder="no">
<name>Target</name>
<script>institute.target = matches[2]
institute_highlightTarget()
mm.echof("Target set to " .. institute.target)</script>
<command></command>
<packageName></packageName>
<regex>^t (\w+)$</regex>
</Alias>
<Alias isActive="yes" isFolder="no">
<name>Target colour</name>
<script>institute.targetcolour = matches[2]
institute_highlightTarget()
institute_saveConfig()
mm.echof("Target colour set to " .. institute.targetcolour)</script>
<command></command>
<packageName></packageName>
<regex>^tcol (\w+)$</regex>
</Alias>
</AliasGroup>
<AliasGroup isActive="yes" isFolder="yes">
<name>Tarot</name>
<script></script>
<command></command>
<packageName></packageName>
<regex></regex>
<Alias isActive="yes" isFolder="no">
<name>Fling</name>
<script>if (myinv["a tarot card inscribed with the " .. firstToUpper(matches[2])] == nil or next(myinv["a tarot card inscribed with the " .. firstToUpper(matches[2])]) == nil) and matches[2] ~= "hermit" then
mm.doaddfree("outd " .. matches[2])
end
if matches[2] == "healer" or matches[2] == "emperor" or matches[2] == "magician" or matches[2] == "hangedman" or matches[2] == "empress" or matches[2] == "teacher" or matches[2] == "lovers" or matches[2] == "moon" or matches[2] == "dreamer" or matches[2] == "judge" or matches[2] == "aeon" then
mm.doadd("fling ".. matches[2] .. " at " .. institute.target)
elseif matches[2] == "fool" or matches[2] == "warrior" or matches[2] == "fall" or matches[2] == "starleaper" or matches[2] == "catacombs" or matches[2] == "princess" or matches[2] == "enigma" or matches[2] == "world" then
mm.doadd("fling ".. matches[2] .. " at ground")
elseif matches[2] == "hermit" then
if myinv["a tarot card inscribed with the " .. firstToUpper(matches[2])] == nil or next(myinv["a tarot card inscribed with the " .. firstToUpper(matches[2])]) == nil then
mm.doaddfree("outd hermit$activate hermit")
else
mm.doadd("fling ".. matches[2] .. " at ground")
end
elseif matches[2] == "lust" then
if matches[3] == "g" then
mm.doadd("fling ".. matches[2] .. " at ground")
else
mm.doadd("fling ".. matches[2] .. " at " .. institute.target)
end
elseif matches[2] == "soulless" then
mm.doadd("sniff " .. matches[2])
end </script>
<command></command>
<packageName></packageName>
<regex>^fl (\w+) ?(g)?$</regex>
</Alias>
<Alias isActive="yes" isFolder="no">
<name>Activate hermit</name>
<script>mm.doaddfree("outd hermit$activate hermit")</script>
<command></command>
<packageName></packageName>
<regex>^acther$</regex>
</Alias>
</AliasGroup>
<AliasGroup isActive="yes" isFolder="yes">
<name>Aeonics</name>
<script></script>
<command></command>
<packageName></packageName>
<regex></regex>
<Alias isActive="yes" isFolder="no">
<name>Timechant</name>
<script>if matches[2] == "mindclock" or matches[2] == "insight" or matches[2] == "timelessbody" or matches[2] == "alacrity" or matches[2] == "temporalbonds" or matches[2] == "pastglimpse" or matches[2] == "futureglimpse" or matches[2] == "switchfate" or matches[2] == "aeonfield" or matches[2] == "foresight" or matches[2] == "paradox" then
mm.doadd("timechant " .. matches[2])
elseif matches[2] == "aeon" or matches[2] == "timewarp" or matches[2] == "timeechoes" or matches[2] == "oracle" or matches[2] == "contingency" or matches[2] == "displacement" then
mm.doadd("timechant " .. matches[2] .. " " .. institute.target)
elseif matches[2] == "timequake" then
if matches[3] == "t" then
mm.doadd("timechant " .. matches[2] .. " " .. institute.target)
else
mm.doadd("timechant ".. matches[2])
end
end
</script>
<command></command>
<packageName></packageName>
<regex>^tc (\w+) ?(t)?$</regex>
</Alias>
</AliasGroup>
<AliasGroup isActive="yes" isFolder="yes">
<name>Harmonics</name>
<script></script>
<command></command>
<packageName></packageName>
<regex></regex>
<Alias isActive="yes" isFolder="no">
<name>Crystalspin all gems</name>
<script>mm.doadd("ogr turquoise$crystalspin turquoise")
mm.doadd("ogr jade$crystalspin jade")
mm.doadd("ogr garnet$crystalspin garnet")
mm.doadd("ogr beryl$crystalspin beryl")
mm.doadd("ogr opal$crystalspin opal")
mm.doadd("ogr onyx$crystalspin onyx")
mm.doadd("ogr bloodstone$crystalspin bloodstone")
mm.doadd("ogr amethyst$crystalspin amethyst")
mm.doadd("ogr emerald$crystalspin emerald")
mm.doadd("ogr sapphire$crystalspin sapphire")
mm.doadd("ogr diamond$crystalspin diamond")
mm.doadd("crystalplex deactivate all")</script>
<command></command>
<packageName></packageName>
<regex>^cpall$</regex>
</Alias>
<Alias isActive="yes" isFolder="no">
<name>Crystalspin single gem</name>
<script>if matches[2] == "ruby" or matches[2] == "resonance" or matches[2] == "convoke" or matches[2] == "shockstone" or matches[2] == "heartstone" or matches[2] == "shatterplex" then
if matches[2] == "ruby" then
mm.doaddfree("ogr ruby")
elseif matches[2] == "resonance" then
mm.doaddfree("ogr turquoise$ogr jade")
elseif matches[2] == "convoke" then
mm.doaddfree("ogr onyx$ogr beryl$ogr garnet")
elseif matches[2] == "shockstone" then
mm.doaddfree("ogr jade$ogr beryl$ogr onyx$ogr sapphire")
elseif matches[2] == "heartstone" then
mm.doaddfree("ogr diamond$ogr ruby$ogr onyx$ogr sapphire")
end
mm.doadd("crystalspin " .. matches[2] .. " " .. institute.target)
elseif matches[2] == "mendingstone" or matches[2] == "balestone" or matches[2] == "glorygem" then
if matches[2] == "mendingstone" then
mm.doaddfree("ogr garnet$ogr jade")
elseif matches[2] == "balestone" then
mm.doaddfree("ogr garnet$ogr beryl")
elseif matches[2] == "glorygem" then
mm.doaddfree("ogr opal$ogr jade")
end
mm.doadd("crystalspin " .. matches[2])
elseif matches[2] == "malefactgem" then
mm.doaddfree("ogr onyx$ogr amethyst$ogr bloodstone")
if matches[3] == nil or matches[3] == "e" or matches[3] == "enemies" then
mm.doadd("crystalspin malefactgem enemies")
elseif matches[3] == "p" or matches[3] == "paralysis" or matches[3] == "c" or matches[3] == "clumsiness" or matches[3] == "a" or matches[3] == "anorexia" or matches[3] == "i" or matches[3] == "impatience" then
if matches[3] == "p" then matches[3] = "paralysis" end
if matches[3] == "c" then matches[3] = "clumsiness" end
if matches[3] == "a" then matches[3] = "anorexia" end
if matches[3] == "i" then matches[3] = "impatience" end
mm.doadd("crystalspin malefactgem " .. institute.target .. " " .. matches[3])
end
else
mm.doadd("ogr " .. matches[2] .. "$crystalspin " .. matches[2])
end</script>
<command></command>
<packageName></packageName>
<regex>^cp (\w+) ?(\w+)?$</regex>
</Alias>
<Alias isActive="yes" isFolder="no">
<name>Crystalplex target hostile</name>
<script>mm.doadd("crystalplex target garnet " .. institute.target .. "$crystalplex target opal " .. institute.target .. "$crystalplex target onyx " .. institute.target .. "$crystalplex target bloodstone " .. institute.target .. "$crystalplex target sapphire " .. institute.target)
</script>
<command></command>
<packageName></packageName>
<regex>^cphostile$</regex>
</Alias>
<Alias isActive="yes" isFolder="no">
<name>Crystalplex target friendly</name>
<script>if matches[2] then
mm.doadd("crystalplex target jade " .. matches[2] .. "$crystalplex target beryl " .. matches[2] .. "$crystalplex target amethyst " .. matches[2] .. "$crystalplex target emerald " .. matches[2] .. "$crystalplex target diamond " .. matches[2])
else
mm.doadd("crystalplex target jade me$crystalplex target beryl me$crystalplex target amethyst me$crystalplex target emerald me$crystalplex target diamond me$crystalplex target turquoise me")
end
</script>
<command></command>
<packageName></packageName>
<regex>^cpfriendly ?(\w+)?$</regex>
</Alias>
</AliasGroup>
</AliasGroup>
</AliasPackage>
<ActionPackage/>
<ScriptPackage>
<ScriptGroup isActive="yes" isFolder="yes">
<name>Institute</name>
<packageName></packageName>
<script>-------------------------------------------------
-- Put your Lua functions here. --
-- --
-- Note that you can also use external Scripts --
-------------------------------------------------
</script>
<eventHandlerList/>
<Script isActive="yes" isFolder="no">
<name>Defaults</name>
<packageName></packageName>
<script>institute = institute or {}
myinv = myinv or {}
institute_loadConfig()
if institute.initialized ~= true then
institute.target = "Portius"
institute.targetcolour = "red"
institute.initialized = true
institute_saveConfig()
end</script>
<eventHandlerList/>
</Script>
<Script isActive="yes" isFolder="no">
<name>Highlight target</name>
<packageName></packageName>
<script>function institute_highlightTarget()
if id then killTrigger(id) end
id = tempTrigger(institute.target, [[
local count = 1
while selectString("]]..institute.target..[[",count) ~= -1 do
fg("]]..institute.targetcolour..[[")
resetFormat()
count = count + 1
end
]])
end</script>
<eventHandlerList/>
</Script>
<Script isActive="yes" isFolder="no">
<name>firstToUpper</name>
<packageName></packageName>
<script>function firstToUpper(str)
return (str:gsub("^%l", string.upper))
end</script>
<eventHandlerList/>
</Script>
<ScriptGroup isActive="yes" isFolder="yes">
<name>Item tracking</name>
<packageName></packageName>
<script>-------------------------------------------------
-- Put your Lua functions here. --
-- --
-- Note that you can also use external Scripts --
-------------------------------------------------
</script>
<eventHandlerList/>
<Script isActive="yes" isFolder="no">
<name>gmcp_inv_list</name>
<packageName></packageName>
<script>function gmcp_inv_list()
local home = gmcp.Char.Items.List
if home.location ~= "inv" then return end
myinv = {}
for _, thing in ipairs(home.items) do
myinv[thing.name] = myinv[thing.name] or {}
myinv[thing.name][thing.id] = thing.attrib
end
end</script>
<eventHandlerList>
<string>gmcp.Char.Items.List</string>
</eventHandlerList>
</Script>
<Script isActive="yes" isFolder="no">
<name>gmcp_inv_add</name>
<packageName></packageName>
<script>function gmcp_inv_add()
local home = gmcp.Char.Items.Add
if home.location ~= "inv" then return end
myinv = myinv or {}
local thing = home.item
myinv[thing.name] = myinv[thing.name] or {}
myinv[thing.name][thing.id] = thing.attrib
end</script>
<eventHandlerList>
<string>gmcp.Char.Items.Add</string>
</eventHandlerList>
</Script>
<Script isActive="yes" isFolder="no">
<name>gmcp_inv_remove</name>
<packageName></packageName>
<script>function gmcp_inv_remove()
local home = gmcp.Char.Items.Remove
if home.location ~= "inv" then return end
myinv = myinv or {}
local thing = home.item
if not ( myinv[thing.name] and myinv[thing.name][thing.id] ) then return end
myinv[thing.name][thing.id] = nil
end</script>
<eventHandlerList>
<string>gmcp.Char.Items.Remove</string>
</eventHandlerList>
</Script>
<Script isActive="yes" isFolder="no">
<name>gmcp_rift_list</name>
<packageName></packageName>
<script>function gmcp_rift_list()
myrift = {}
for _, thing in ipairs(gmcp.IRE.Rift.List) do
myrift[thing.name] = tonumber(thing.amount)
end
end</script>
<eventHandlerList>
<string>gmcp.IRE.Rift.List</string>
</eventHandlerList>
</Script>
<Script isActive="yes" isFolder="no">
<name>gmcp_rift_change</name>
<packageName></packageName>
<script>function gmcp_rift_change()
myrift = myrift or {}
local thing = gmcp.IRE.Rift.Change
myrift[thing.name] = tonumber(thing.amount)
end</script>
<eventHandlerList>
<string>gmcp.IRE.Rift.Change</string>
</eventHandlerList>
</Script>
<Script isActive="yes" isFolder="no">
<name>gmcp_mobs_list</name>
<packageName></packageName>
<script>function gmcp_mobs_list()
local home = gmcp.Char.Items.List
if home.location ~= "room" then return end
mobshere = {}
for _, thing in ipairs(home.items) do
if thing.attrib and thing.attrib:match("m") then
mobshere[thing.name] = myinv[thing.name] or {}
mobshere[thing.name][thing.id] = thing.attrib
end
end
end</script>
<eventHandlerList>
<string>gmcp.Char.Items.List</string>
</eventHandlerList>
</Script>
<Script isActive="yes" isFolder="no">
<name>gmcp_mobs_arrive</name>
<packageName></packageName>
<script>function gmcp_mobs_arrive()
local home = gmcp.Char.Items.Add
if home.location ~= "room" then return end
mobshere = mobshere or {}
local thing = home.item
if thing.attrib:find("m") then
mobshere[thing.name] = myinv[thing.name] or {}
mobshere[thing.name][thing.id] = thing.attrib
end
end</script>
<eventHandlerList>
<string>gmcp.Char.Items.Add</string>
</eventHandlerList>
</Script>
<Script isActive="yes" isFolder="no">
<name>gmcp_mobs_leave</name>
<packageName></packageName>
<script>function gmcp_mobs_leave()
local home = gmcp.Char.Items.Remove
if home.location ~= "room" then return end
mobshere = mobshere or {}
local thing = home.item
if not ( mobshere[thing.name] and mobshere[thing.name][thing.id] ) then return end
mobshere[thing.name][thing.id] = nil
if table.size(mobshere[thing.name]) == 0 then mobshere[thing.name] = nil end
end</script>
<eventHandlerList>
<string>gmcp.Char.Items.Remove</string>
</eventHandlerList>
</Script>
<Script isActive="yes" isFolder="no">
<name>gmcp_mobs_die</name>
<packageName></packageName>
<script>function gmcp_mobs_die()
local home = gmcp.Char.Items.Update
if home.location ~= "room" then return end
mobshere = mobshere or {}
local thing = home.item
local name = thing.name:match("the corpse of (.*)")
if not ( mobshere[name] and mobshere[name][thing.id] ) then return end
mobshere[name][thing.id] = nil
if table.size(mobshere[thing.name]) == 0 then mobshere[thing.name] = nil end
end</script>
<eventHandlerList>
<string>gmcp.Char.Items.Update</string>
</eventHandlerList>
</Script>
</ScriptGroup>
<ScriptGroup isActive="yes" isFolder="yes">
<name>Configuration</name>
<packageName></packageName>
<script>-------------------------------------------------
-- Put your Lua functions here. --
-- --
-- Note that you can also use external Scripts --
-------------------------------------------------
</script>
<eventHandlerList/>
<Script isActive="yes" isFolder="no">
<name>Load configuration from file</name>
<packageName></packageName>
<script>function institute_loadConfig()
if institute.initialized then return false end
local file = getMudletHomeDir().."\\institute.lua"
if not io.exists(file) then return false end
table.load(file, institute)
end</script>
<eventHandlerList/>
</Script>
<Script isActive="yes" isFolder="no">
<name>Save configuration to file</name>
<packageName></packageName>
<script>function institute_saveConfig()
table.save(getMudletHomeDir() .. "\\institute.lua", institute)
end
</script>
<eventHandlerList/>
</Script>
</ScriptGroup>
</ScriptGroup>
</ScriptPackage>
<KeyPackage/>
</MudletPackage>