WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Say addon? (https://www.wowinterface.com/forums/showthread.php?t=45081)

Kapone 11-06-12 10:34 AM

Say addon?
 
As many have noticed the dragon roar reminds allot FUS RO DAH!
So i wanted too make a addon where you /Say fus ro dah! or yell in game when dragon roar gets clicked.
Ive take a peak on other peoples addons that has a say on spell but there is just too much code too understand where it even could be for a noob like me.

I'm already done and uploaded a addon that plays the FUS RO DAH!.mp3
All i want is help with the Say string. i could get it done with macro but then if i click the macro button i say fus ro dah without doing it.. and that is fail enough as it could be =P.

semlar 11-06-12 11:17 AM

Something like this should work.
Lua Code:
  1. local f = CreateFrame('frame')
  2. f:SetScript('OnEvent', function(_, _, _, event, _, guid, _, _, _, _, _, _, _, spell)
  3.     if event == 'SPELL_CAST_SUCCESS' and spell == 118000 and guid == UnitGUID('player') then
  4.         SendChatMessage('rawr')
  5.     end
  6. end)
  7. f:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED')

Kapone 11-06-12 12:13 PM

Thanks allot semlar! for quick and more information then i needed =)

This is what i had
Code:

                local _, eventType, _, _, srcName = select(1, ...)
                if (eventType == "SPELL_CAST_SUCCESS") and (srcName == UnitName("player")) then
                        local spellId = select(12,...);
                        if (spellId == 118000) or (spellId == 118000) then --Dragon Roar, Bladestorm

What i needed too change was
Code:

                local _, eventType, _, _, srcName = select(1, ...)
                if (eventType == "SPELL_CAST_SUCCESS") and (srcName == UnitName("player")) then
            SendChatMessage('FUS RO DAH')
                        local spellId = select(12,...);
                        if (spellId == 118000) or (spellId == 118000) then --Dragon Roar, Bladestorm

Basically nothing but as a noob i learned something tooday atleast ^^
And once again thanks for more info then i needed made me self-learning.

Kapone 11-06-12 12:53 PM

so too make him yell i have too just do it like this?
Code:

SendChatMessage("rawr ", "YELL", nil, name)

Julchen 11-06-12 02:45 PM

http://wowprogramming.com/docs/api/SendChatMessage

semlar 11-06-12 05:31 PM

Lua Code:
  1. SendChatMessage("rawr", "YELL")
Is enough to yell the message.


All times are GMT -6. The time now is 07:08 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI