Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function AR.Invite(name)
- local guildID = AR.getIDfromName(AR.settings.recruitFor)
- local userID
- -- Define local function here for zo_callLater so we still have local variables above passed to the function
- local function ResolveInvite()
- -- If the name wasn't a display name then we need to resolve it now.
- if userID == "" or userId == nil then
- userID = GetIgnoredInfo(GetNumIgnored())
- RemoveIgnore(userID)
- end
- GuildInvite(guildID, userID)
- d("|c82fa58Auto Recruit - |r|cFFFFFF" .. userID .. "|r |c82fa58invited to " .. AR.settings.recruitFor)
- end
- -- If name is already a displayName we set that here. If not then add to the ignore list. Then the function called on a delay will get the info from the ignored player and remove them before trying to send an invite
- if IsDecoratedDisplayName(name) then
- userID = name
- zo_callLater(ResolveInvite, 5000)
- else
- AddIgnore(so_strformat("<<C:1>>", name))
- zo_callLater(ResolveInvite, 5000)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement