I don't know if it has been alrdy made, or something exists, but trying to make a casting checker from bosses. So it anounces party while boss is casting a nasty skill, so all can react quick :d
Got this so far, and it not working
local disabled = false -- Starting value
SLASH_BossBuff1 = "/BossBuffer"
SLASH_BossBuff2 = "/BB" -- Add as many variations as you like just increment the number
SlashCmdList["BossBuff"] = function(editBox, msg)
if msg then
msg = string.lower(msg)
if msg == "on" then -- on
disabled = false
elseif msg == "off" then -- off
disabled = true
else
disabled = not disabled -- Toggles addon if 'on' or 'off' is not used.
end
if disabled then
SendSystemChat("BossBuff is disabled")
SendChatMessage("|H|h|cffFF0000BossBuff Checker has been deactivated|h", "party")
else
SendSystemChat("BossBuff is enabled")
SendChatMessage("|H|h|cff16DC07BossBuff Checker has been activated|h", "party")
end
end
end
local BossBuff = {} -- the AddOn namespace, all your functions should be placed inside here instead of as globals.
_G.BossBuff = BossBuff -- expose it to the global scope
function BossBuff.VN()
if (Casting("target", "Tearing Claw Attack") == true) then
SendChatMessage("|H|h|cffFCF802Lyong is casting Tearing Claw Attack!!|h", "party")
end
if (Casting("target", "Rune Pulse") == true) then
SendChatMessage("|H|h|cffFCF802Player is casting rune pulse!!|h", "say")
end
end;
-- Searches the target for a specified debuff.
-- Use "player", "target", "party3", "raid1" etc. for tgt parameter.
function Casting(tgt,CastingName)
local counter=1
local currentcasting="none"
while currentcasting ~= nil do
currentcasting=UnitCasting(tgt,counter)
if currentcasting ~= nil then
if string.find(string.lower(currentcasting),string.lower(CastingName)) then
return true
else
counter=counter+1
end
end
end
return false
end
local time_remaining = 0.5 -- in seconds
function BossBuff:OnUpdate(elapsed)
if disabled == true then
return
end
-- elapsed is the amount of time in seconds since the last frame tick
time_remaining = time_remaining - elapsed
if time_remaining > 0 then
-- cut out early, we're not ready yet
return
end
time_remaining = 0.5 -- reset to 2
end
local disabled = false -- Starting value
SLASH_BossBuff1 = "/BossBuffer"
SLASH_BossBuff2 = "/BB" -- Add as many variations as you like just increment the number
SlashCmdList["BossBuff"] = function(editBox, msg)
if msg then
msg = string.lower(msg)
if msg == "on" then -- on
disabled = false
elseif msg == "off" then -- off
disabled = true
else
disabled = not disabled -- Toggles addon if 'on' or 'off' is not used.
end
if disabled then
SendSystemChat("BossBuff is disabled")
SendChatMessage("|H|h|cffFF0000BossBuff Checker has been deactivated|h", "party")
else
SendSystemChat("BossBuff is enabled")
SendChatMessage("|H|h|cff16DC07BossBuff Checker has been activated|h", "party")
end
end
end
local BossBuff = {} -- the AddOn namespace, all your functions should be placed inside here instead of as globals.
_G.BossBuff = BossBuff -- expose it to the global scope
function BossBuff.VN()
if (OnCast("target", "Tearing Claw Attack") == true) then
SendChatMessage("|H|h|cffFCF802Lyong is casting Tearing Claw Attack!!|h", "party")
end
if (OnCast("target", "Heal") == true) then
SendChatMessage("|H|h|cffFCF802Player is casting heal!!|h", "say")
end
end;
-- Searches the target for a specified debuff.
-- Use "player", "target", "party3", "raid1" etc. for tgt parameter.
function OnCast(tgt,CastingName)
local counter=1
local Casting="none"
while Casting ~= nil do
Casting=UnitCasting(tgt,counter)
if Casting ~= nil then
if string.find(string.lower(Casting),string.lower(CastingName)) then
return true
else
counter=counter+1
end
end
end
return false
end
local time_remaining = 0.5 -- in seconds
function BossBuff:OnUpdate(elapsed)
if disabled == true then
return
end
-- elapsed is the amount of time in seconds since the last frame tick
time_remaining = time_remaining - elapsed
if time_remaining > 0 then
-- cut out early, we're not ready yet
return
end
time_remaining = 0.5 -- reset to 2
end
also not working, someone knows the correct function?
every 0.5 seconds the onupdate function resets the time_remaining variable. It does nothing else. The BossBuff.VN() function, which seems to do the work, never gets called. So I think the onupdate function is supposed to call it every 0.5 seconds. So where is says
local time_remaining = 0.5 -- in seconds
function BossBuff:OnUpdate(elapsed)
if disabled == true then
return
end
-- elapsed is the amount of time in seconds since the last frame tick
time_remaining = time_remaining - elapsed
if time_remaining > 0 then
-- cut out early, we're not ready yet
return
end
time_remaining = 0.5 -- reset to 2
BossBuff.VN()
end
local disabled = false -- Starting value
SLASH_BossBuff1 = "/BossBuffer"
SLASH_BossBuff2 = "/BB" -- Add as many variations as you like just increment the number
SlashCmdList["BossBuff"] = function(editBox, msg)
if msg then
msg = string.lower(msg)
if msg == "on" then -- on
disabled = false
elseif msg == "off" then -- off
disabled = true
else
disabled = not disabled -- Toggles addon if 'on' or 'off' is not used.
end
if disabled then
SendSystemChat("BossBuff is disabled")
SendChatMessage("|H|h|cffFF0000BossBuff Checker has been deactivated|h", "party")
else
SendSystemChat("BossBuff is enabled")
SendChatMessage("|H|h|cff16DC07BossBuff Checker has been activated|h", "party")
end
end
end
local BossBuff = {} -- the AddOn namespace, all your functions should be placed inside here instead of as globals.
_G.BossBuff = BossBuff -- expose it to the global scope
function BossBuff.VN()
if (OnCast("target", "Tearing Claw Attack") == true) then
SendChatMessage("|H|h|cffFCF802Lyong is casting Tearing Claw Attack!!|h", "party")
end
if (OnCast("target", "Black Flame") == true) then
SendChatMessage("Black Flame!!!", "party")
end
end;
-- Searches the target for a specified debuff.
-- Use "player", "target", "party3", "raid1" etc. for tgt parameter.
function OnCast(tgt,CastingName)
local counter=1
local Casting="none"
while Casting ~= nil do
Casting=UnitCasting(tgt,counter)
if Casting ~= nil then
if string.find(string.lower(Casting),string.lower(CastingName)) then
return true
else
counter=counter+1
end
end
end
return false
end
local time_remaining = 0.5 -- in seconds
function BossBuff:OnUpdate(elapsed)
if disabled == true then
return
end
-- elapsed is the amount of time in seconds since the last frame tick
time_remaining = time_remaining - elapsed
if time_remaining > 0 then
-- cut out early, we're not ready yet
return
end
time_remaining = 0.5 -- reset to 2
BossBuff.VN()
end
the on and off slash commands works, but when the boss is casting like Black Flame its not announcing my party chat :/
local disabled = false -- Starting value
SLASH_BossBuff1 = "/BossBuffer"
SLASH_BossBuff2 = "/BB" -- Add as many variations as you like just increment the number
SlashCmdList["BossBuff"] = function(editBox, msg)
if msg then
msg = string.lower(msg)
if msg == "on" then -- on
disabled = false
elseif msg == "off" then -- off
disabled = true
else
disabled = not disabled -- Toggles addon if 'on' or 'off' is not used.
end
if disabled then
SendSystemChat("BossBuff is disabled")
SendChatMessage("|H|h|cffFF0000BossBuff Checker has been deactivated|h", "party")
else
SendSystemChat("BossBuff is enabled")
SendChatMessage("|H|h|cff16DC07BossBuff Checker has been activated|h", "party")
end
end
end
local BossBuff = {} -- the AddOn namespace, all your functions should be placed inside here instead of as globals.
_G.BossBuff = BossBuff -- expose it to the global scope
function BossBuff.VN()
if (UnitCastingTime("target", "Tearing Claw Attack") == true) then
SendChatMessage("|H|h|cffFCF802Lyong is casting Tearing Claw Attack!!|h", "party")
end
if (UnitCastingTime("target", "Black Flame") == true) then
SendChatMessage("Black Flame!!!", "party")
end
end;
-- Searches the target for a specified debuff.
-- Use "player", "target", "party3", "raid1" etc. for tgt parameter.
function UnitCastingTime(tgt,CastingName)
local counter=1
local currCastingTime="none"
while currCastingTime ~= nil do
currCastingTime=UnitCasting(tgt,counter)
if currCastingTime ~= nil then
if string.find(string.lower(currCastingTime),string.lower(CastingName)) then
return true
else
counter=counter+1
end
end
end
return false
end
local time_remaining = 0.5 -- in seconds
function BossBuff:OnUpdate(elapsed)
if disabled == true then
return
end
-- elapsed is the amount of time in seconds since the last frame tick
time_remaining = time_remaining - elapsed
if time_remaining > 0 then
-- cut out early, we're not ready yet
return
end
time_remaining = 0.5 -- reset to 2
BossBuff.VN()
end
No, I meant use that function I linked to, not create a function by with that name. I meant use "UnitCastingTime" instead of "UnitCasting" which doesn't look like a valid game function. It's not listed under the rom wikis "List of Functions". http://runesofmagic.gamepedia.com/List_of_Functions.
So looking at the function example, you could use something like
I am trying to make this function work, but i keep getting "attempt to call global 'UnitCastingTime' (a nil value). Could someone help.
<onLoad>
function OnCast(tgt,CastingName)
local name = UnitCastingTime(tgt)
if name == CastingName then
return true
else
return false
end
end
</onLoad>
<!-- # 1 --><waypoint x="2256" z="33093" y="0" type="TRAVEL">
local mob = player:findNearestNameOrId(103980)
if mob then
player:target(mob);
if OnCast("target","Erupting Spore") == true then
sendpartychat("mob casting");
end
end
</waypoint>
</waypoints>