- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAutoInviteGuild.lua
More file actions
Latest commit
157 lines (125 loc) · 4.8 KB
/
Copy pathAutoInviteGuild.lua
File metadata and controls
157 lines (125 loc) · 4.8 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
localaddonName, addonTable=...
localrotenable=false
localannoenable=false
localticktime=60;
localruntick=GetTime()
localcount=0
AutoInviteGroup=addonTable
functionprint(msg) DEFAULT_CHAT_FRAME:AddMessage(msg) end
functionIsPlayerInGuild(playerName)
returnGetGuildInfo(playerName)
end
functiontimerproc()
if (annoenable) then
if (runtick<=GetTime()) then
runtick=GetTime() +ticktime
localids= {}
count=count+1
forkey,valueinipairs({"大脚世界频道","世界频道","寻求组队","综合","交易","公会招募","世界防务"}) do
id=GetChannelName(value)
table.insert(ids,id)
SendChatMessage("{三角}{三角}《Hello World》公会诚招各路IT同僚,打造一个和谐,友爱,文明的公会,将于10月下旬打造一个团结高效的GKP团队,活动时间每周六,周日下午1-5点,扰屏见谅{三角}{三角}"..count, "CHANNEL", nil, id)
end
print("已在"..table.concat(ids,",").."频道中喊话");
end
end
end
AutoInviteGroup.autoInviteFrame=CreateFrame("Frame", "AutoInviteGroup", UIParent)
AutoInviteGroup.autoInviteFrame:RegisterEvent("PLAYER_LOGIN")
AutoInviteGroup.autoInviteFrame:RegisterEvent("CHAT_MSG_WHISPER")
AutoInviteGroup.autoInviteFrame:SetScript("OnUpdate", function(self, event, ...)
timerproc(arg);
end)
AutoInviteGroup.autoInviteFrame:SetScript("OnEvent", function(self, event, ...)
ifevent=="PLAYER_LOGIN" then
-- AutoInviteGroup:Initialize()
end
ifevent=="CHAT_MSG_WHISPER" then
AutoInviteGroup:ProcessWhisper(...)
end
end)
-- function AutoInviteGroup:Initialize()
-- if AutoInviteSettings == nil then
-- AutoInviteGroup:LoadDefaults()
-- else
-- AutoInviteGroup:ApplySavedVariables()
-- end
-- end
functionAutoInviteGroup:ProcessWhisper(text, playerName)
ifnotrotenablethen
return
end
iftext=="123" then
canInvite=CanGuildInvite()
ifcanInvitethen
GuildInvite(playerName)
end
else
SendChatMessage("我是自动喊话机器人,Hello World公会诚招各路IT人士,励志打造一个和谐,友爱,文明的公会,组织一个进度高效的副本团队和一个能打胜战的PVP团队", "WHISPER", nil, playerName)
SendChatMessage("准备在10月下旬开组40人GKP团本,活动时间每周六下午1-5点,招最聪明的人,打最效率的魔兽!", "WHISPER", nil, playerName)
SendChatMessage("具体细节可以私聊Typescript,如果他在线的话,公会官网github點com/classicalwow/homepage,里面有微信群,欢迎您的加入", "WHISPER", nil, playerName)
SendChatMessage("在这里,您将拥有最先进的魔兽插件和辅助功能,如果您热爱魔兽,团结友爱,请先加入微信群,我再拉你们入公会", "WHISPER", nil, playerName)
end
end
SLASH_AUTOINVITEGROUP1="/aig"
SLASH_AUTOINVITEGROUP2="/aig announce enable"
SLASH_AUTOINVITEGROUP3="/aig announce disable"
SLASH_AUTOINVITEGROUP4="/aig robot enable"
SLASH_AUTOINVITEGROUP5="/aig robot disable"
SLASH_AUTOINVITEGROUP6="/aig help"
SlashCmdList["AUTOINVITEGROUP"] =function(msg)
ifAutoInviteGroup:StringIsNullOrEmpty(msg) then
AutoInviteGroup:PrintHelpInformation()
end
localslashCommandMsg=AutoInviteGroup:SplitString(msg, "")
localsubCommand=slashCommandMsg[1]
localsubCommandMsg=nil
iftable.getn(slashCommandMsg) >1then
subCommandMsg=slashCommandMsg[2]
end
ifsubCommand=="help" then
AutoInviteGroup:PrintHelpInformation()
end
ifsubCommand=="announce" then
ifslashCommandMsg[2] =="enable" then
runtick=GetTime()
annoenable=true
print("自动喊话已开启")
end
ifslashCommandMsg[2] =="disable" then
annoenable=false
print("自动喊话已关闭")
end
end
ifsubCommand=="robot" then
ifslashCommandMsg[2] =="enable" then
rotenable=true
print("自动机器人已开启")
end
ifslashCommandMsg[2] =="disable" then
rotenable=false
print("自动机器人已关闭")
end
end
end
functionAutoInviteGroup:StringIsNullOrEmpty(s)
ifs==nilors=='' then
returntrue
end
end
functionAutoInviteGroup:PrintHelpInformation()
print("AutoInviteGroup Help Information")
print("/aig, /aig help -- 帮助指令.")
print("/aig announce enable -- 开启自动喊话.")
print("/aig announce disable -- 关闭自动喊话.")
print("/aig robot enable -- 如果挂机不在的情况,开启机器人对话.")
print("/aig robot disable -- 关闭机器人对话.")
end
functionAutoInviteGroup:SplitString(slashCommand, delimiter)
result= {}
formatchin (slashCommand..delimiter):gmatch("(.-)" ..delimiter) do
table.insert(result, match)
end
returnresult
end
print("密我邀请进公会插件加载,默认关闭,更多帮助,开启请输入/aig,开启喊话前先确认加入了3个频道 /join 世界频道 /join 寻求组队 /join 大脚世界频道")