View Single Post
Unread 03-12-12, 02:03 PM   #3
Ketho
A Molten Giant
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 566
Something like this?

http://addon.ziuo.net/
/rinv All max level character will be invited to raid in 10 sec. Please leave your groups.
Code:
local delay = 0

local function OnUpdate(self, elapsed)
	delay = delay + elapsed
	if delay > 10 then
		for i = 1, GetNumGuildMembers() do
			local name, _, _, level, _, _, _, _, online = GetGuildRosterInfo(i)
			if online and (level >= 70 and level <= 80) then
				InviteUnit(name)
			end
		end
		delay = 0
		self:SetScript("OnUpdate", nil)
	end
end

local f = CreateFrame("Frame")

SLASH_RAIDINVITE1 = "/rinv"
SLASH_RAIDINVITE2 = "/raidinvite"

SlashCmdList["RAIDINVITE"] = function(msg, editbox)
	SendChatMessage(msg, "GUILD")
	f:SetScript("OnUpdate", OnUpdate)
end

or with AceTimer, provided you have Ace3 loaded/embeded. The message has a limited length though
Code:
/run SendChatMessage("Hello World!","GUILD")LibStub("AceTimer-3.0"):ScheduleTimer(function()for i=1,GetNumGuildMembers()do local a,_,_,b,_,_,_,_,c=GetGuildRosterInfo(i)if c and(b>=70 and b<=80)then InviteUnit(a)end end end,10)

-- Neither of those 2 example scripts cope with changing from a party to a raid though
__________________

Last edited by Ketho : 03-12-12 at 02:36 PM.
Ketho is offline   Reply With Quote