-
Notifications
You must be signed in to change notification settings - Fork 0
/
enne_quitcheck.xml
113 lines (105 loc) · 2.66 KB
/
enne_quitcheck.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
<?xml version="1.0" encoding="iso-8859-1"?> <muclient><script> <![CDATA[
require "serialize"
container=GetVariable("container") or ""
local save=GetVariable("items")
items={}
if save~=nil and save~="" then
loadstring(save)()
end-- if
save=nil
action=""
function start(name, line, val)
action=val[1]
container=val[2]
if action=="get" then
act()
return
end-- if
items={}
Send("quit check")
EnableTrigger("enne_quitcheck_parse", true)
Send("echo <-<-<-enne quitcheck stop->->->")
EnableTrigger("enne_quitcheck_stop", true)
end-- func
function parse(name, line, val)
table.insert(items, #items+1, {val[1], (val[2]==nil and "" or val[2])})
end-- func
function stop(name, line, val)
EnableTrigger("enne_quitcheck_parse", false)
EnableTrigger("enne_quitcheck_stop", false)
act()
end-- func
function act()
if #items<1 then
Note("No items to "..action..".")
return
end-- if
local action2=(action=="get" and "put " or "get ")
action=action.." "
for key,val in pairs(items) do
if action=="get " then
Send(action..val[1].." "..container)
end-- if
if val[2]~="" then
if val[2]=="Keyring" then
Send("keyring "..action2..val[1])
else
Send(action2..val[1].." "..val[2])
end-- if
end-- if
if action=="put " then
Send(action..val[1].." "..container)
end-- if
end-- for
action=""
action2=nil
if action=="put " then
SaveState()
end-- if
end-- func
function OnPluginSaveState()
SetVariable ("items", serialize.save("items", items))
end-- func
function OnPluginInstall()
Note("Quitcheck by Enne: type qc put <container name or container id> to put all of your items listed in quit check into a container (even if they are on your keyring or inside a container), and type qc get <container name or id> to get them back, and it will put them back on your keyring and into your containers.")
end-- func
]]> </script>
<aliases>
<alias
match="^qc (put|get) (.+)$"
enabled="y"
regexp="y"
expand_variables="y"
script="start"
>
</alias>
</aliases>
<triggers>
<trigger
name="enne_quitcheck_start"
match="<-<-<-enne quitcheck start->->->"
enabled="y"
omit_from_output="y"
script="start"
>
</trigger>
<trigger
name="enne_quitcheck_parse"
match="^\[\s*\d+\]\s*\(.+?\)\s*\-\s*(\d+)\s*.*?(?|\(inside .+?\/(\d+)\)|\((Keyring)\))?$"
enabled="n"
regexp="y"
omit_from_output="y"
script="parse"
>
</trigger>
<trigger
name="enne_quitcheck_stop"
match="<-<-<-enne quitcheck stop->->->"
enabled="n"
omit_from_output="y"
script="stop"
>
</trigger>
</triggers>
<plugin name="enne_quitcheck" author="enne" id="74d08f3caafc4bf30ad45987" language="Lua" purpose="Uses quit check to put items in a container, remembers where they were, and can pick them back up." date_written="2022-07-05 08:37:01" requires="5.07" version="1.0" save_state="y"> </plugin>
</muclient>