spellid doesn't contain a value for that function.
In another function it is stored in a temporary variable of spellID but then that information is lost when you leave the function it is in unless you pass it to another function to work with which you aren't.
Look at the highlighted code and change appropriately and it should work.
Code:
function NuttyWarAnnounce:COMBAT_LOG_EVENT_UNFILTERED(event, timestamp, subevent, srcGUID, srcName, srcflags, dstGUID, dstname, dstflags, spellID)
if UnitGUID("player") == srcGUID then
if subevent == "SPELL_AURA_APPLIED" then
if NuttyWarAnnounce.spellids.shouts[spellID] then
NuttyWarAnnounce:sendmessage()
else if NuttyWarAnnounce.spellids.alerts[spellID] then
NuttyWarAnnounce:spellcastcheck(spellID)
end
end
end
if subevent == "SPELL_AURA_REMOVED" then
if NuttyWarAnnounce.spellids.shouts[spellID] then
NuttyWarAnnounce:sendmessage()
end
end
end
end
function NuttyWarAnnounce:spellcastcheck(spellid)
print(spellid) --not working
end