Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1. function AR.Invite(name)
  2.    
  3.     local guildID = AR.getIDfromName(AR.settings.recruitFor)
  4.     local userID
  5.    
  6.     -- Define local function here for zo_callLater so we still have local variables above passed to the function
  7.     local function ResolveInvite()
  8.         -- If the name wasn't a display name then we need to resolve it now.
  9.         if userID == "" or userId == nil then
  10.             userID = GetIgnoredInfo(GetNumIgnored())
  11.             RemoveIgnore(userID)
  12.         end
  13.         GuildInvite(guildID, userID)
  14.         d("|c82fa58Auto Recruit - |r|cFFFFFF" .. userID .. "|r |c82fa58invited to " .. AR.settings.recruitFor)
  15.     end
  16.    
  17.     -- 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
  18.     if IsDecoratedDisplayName(name) then
  19.         userID = name
  20.         zo_callLater(ResolveInvite, 5000)
  21.     else
  22.         AddIgnore(so_strformat("<<C:1>>", name))
  23.         zo_callLater(ResolveInvite, 5000)
  24.     end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement