- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAutoMessage.lua
More file actions
Latest commit
190 lines (169 loc) · 5.89 KB
/
Copy pathAutoMessage.lua
File metadata and controls
190 lines (169 loc) · 5.89 KB
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
--[[
--
-- AutoMessager V1.0
-- Written by the BOFH (Stewarta of Nordrassil)
-- Please Don't Spam!
-- 被我修改了 我是沙服IT会长,新增了,号分割
--
--]]
localfunctionPrint(msg)
ifnotDEFAULT_CHAT_FRAMEthen
return
end
DEFAULT_CHAT_FRAME:AddMessage(BINDING_HEADER_FURY..": "..(msgor""))
end
functiontimerproc1(channame,am)
if (channame=="g") then
SendChatMessage(am, "GUILD")
elseif (channame=="s") then
SendChatMessage(am, "SAY")
elseif (channame=="y") then
SendChatMessage(am, "YELL")
elseif (channame=="p") then
SendChatMessage(am, "PARTY")
elseif (channame=="ra") then
SendChatMessage(am, "RAID")
elseif (channame=="ro") then
SendChatMessage(am, "OFFICER")
elseif (channame=="表情") then
SendChatMessage(am, "EMOTE")
elseif (channame=="团队警报") then
SendChatMessage(am, "RAID_WARNING")
elseif (channame=="bg") then
SendChatMessage(am, "BATTLEGROUND")
elseif (channame=="私聊") then
SendChatMessage(am, "WHISPER", nil, charname)
elseif (channame=="1") then
id=GetChannelName(channame)
SendChatMessage(am, "CHANNEL", nil, id)
elseif (channame=="2") then
id=GetChannelName(channame)
SendChatMessage(am, "CHANNEL", nil, id)
elseif (channame=="3") then
id=GetChannelName(channame)
SendChatMessage(am, "CHANNEL", nil, id)
elseif (channame=="4") then
id=GetChannelName(channame)
SendChatMessage(am, "CHANNEL", nil, id)
elseif (channame=="5") then
id=GetChannelName(channame)
SendChatMessage(am, "CHANNEL", nil, id)
elseif (channame=="6") then
id=GetChannelName(channame)
SendChatMessage(am, "CHANNEL", nil, id)
elseif (channame=="7") then
id=GetChannelName(channame)
SendChatMessage(am, "CHANNEL", nil, id)
elseif (channame=="8") then
id=GetChannelName(channame)
SendChatMessage(am, "CHANNEL", nil, id)
elseif (channame=="9") then
id=GetChannelName(channame)
SendChatMessage(am, "CHANNEL", nil, id)
elseif (channame=="10") then
id=GetChannelName(channame)
SendChatMessage(am, "CHANNEL", nil, id)
elseif (channame=="de") then
DoEmote(am)
elseif (channame=="rs") then
RunScript(am)
end
end
functiontimerproc(a)
if (stopit~=nil) then
if (stopit==0) then
if (runtick<=GetTime()) then
-- sendhelpmsg(channame)
runtick=GetTime() +ticktime
fortokeninstring.gmatch(channame, '([^,]+)') do
-- sendhelpmsg(token)
timerproc1(token,am)
end
-- timerproc1(channame,am)
end
end
end
end
functionstewRegisterCommand(id, comlist, desc, func)
if (Satellite) then
Satellite.registerSlashCommand({
id=id,
commands=comlist,
onExecute=func,
helpText=desc
})
else
SlashCmdList[id] =func
fori=1, table.getn(comlist) do
setglobal("SLASH_" ..id..i, comlist[i])
end
end
end
functionsendhelpmsg(msg) DEFAULT_CHAT_FRAME:AddMessage(msg) end
functioninitproc()
stopit=1
localid="stew"
localcomlist= {"/autohelp"}
localdesc="Automessager list of commands"
localfunc=function(msg)
sendhelpmsg("'/auto' - Opens the Automessenger configuration window")
sendhelpmsg("'/autostart' - Starts the Automessenger.")
sendhelpmsg("'/autostop' - Stops the Automessenger.")
sendhelpmsg("'/autotick <time>' - Sets the time delay between messages.")
sendhelpmsg(
"'/autochan <channel name>' - Sets the channel to send messages to.")
sendhelpmsg("'/automsg' - Sets the message to use.")
sendhelpmsg(
"'/autochar <character name>' - Sets the character to wisper messages to.")
sendhelpmsg(
"Accepted channels are: w, rs, de, s, y, e, p, r, rw, g, o, bg, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10")
end
stewRegisterCommand(id, comlist, desc, func)
id="stew0"
comlist= {"/autostart"}
desc="Starts the automessager"
func=function(msg)
stopit=0
runtick=GetTime()
end
stewRegisterCommand(id, comlist, desc, func)
id="stew00"
comlist= {"/autostop"}
desc="Stops the automessager"
func=function(msg) stopit=1end
stewRegisterCommand(id, comlist, desc, func)
id="stew1"
comlist= {"/autotick"}
desc="Sets the time between automessages"
func=function(msg) ticktime=msgend
stewRegisterCommand(id, comlist, desc, func)
id="stew2"
comlist= {"/autochan"}
desc="Sets the channel to automessage"
func=function(msg) channame=msgend
stewRegisterCommand(id, comlist, desc, func)
id="stew3"
comlist= {"/automsg"}
desc="Sets the automessage"
func=function(msg) am=msgend
stewRegisterCommand(id, comlist, desc, func)
id="stew4"
comlist= {"/auto"}
desc="Shows the automessager configuration window"
func=function(msg)
autoMessageCFGFrameEditBox1:SetText(am)
autoMessageCFGFrameEditBox2:SetText(ticktime)
autoMessageCFGFrameEditBox3:SetText(channame)
autoMessageCFGFrameEditBox4:SetText(charname)
ShowUIPanel(autoMessageCFGFrame)
autoMessageCFGFrameEditBox1:HighlightText()
end
stewRegisterCommand(id, comlist, desc, func)
id="stew5"
comlist= {"/autochar"}
desc="Sets the character to automessage"
func=function(msg) charname=msgend
stewRegisterCommand(id, comlist, desc, func)
sendhelpmsg(
"|cffff0000The BOFH was here MWHAHAHA! (automessage addon was loaded successfully by the way)")
end