WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Why / command not doing anything? (https://www.wowinterface.com/forums/showthread.php?t=58877)

hasnogaems 08-08-21 10:06 AM

Why / command not doing anything?
 
Not even any error.
It like it not registered at all.
Code:

TheEarthFather = { }

function TheEarthFather:Greet(channel)
    local allgreetings = {
        "Peace, friend.",
        "Hail.",
        "You wish to speak?",
        "How?",
        "How may I aid you?",
        "What brings you here?",
        "Ah, I've been expecting you.",
        "Well met.",
        "Greetings, traveler.",
        "Greetings.",
        "The winds guide you.",
        "I've been expecting you."
        "Speak.",
        "Speak friend.",
        "Zug-zug!",
        "For the Horde!",
        "Blood and thunder!",
        "Strength and honor!",
        "Lok-tar!",
        "Thrall hall!",
        "Mok-rah!",
        "What do you need?",
        "What can I help you with?",
        "What do you need?",
        "Greetings."
        "Anaria shola.",
        "Bal'a dash, malanore.",
        "We will persevere!",
        "Our enemies will fall!",
        "Victory lies ahead!",
        "Anu belore dela'na.",
        "What business have you?",
        "Glory to the sin'dorei.",
        "Yes?",
        "State your business.",
        "The eternal sun guides us.",
        "The dark times will pass."
        "What do you require?",
        "This had better be good.",
        "What is it?",
        "Speak quickly.",
        "I'm listening.",
        "What do you ask of death?",
        "We are Forsaken.",
        "I am Forsaken.",
        "What now?!",
        "Hello?",
        "And you are...?"
        "Talk to me.",
        "Eh there.",
        "Who you be?",
        "Hello mon.",
        "Greetings mon.",
        "What be on ya mind?",
        "How ya doing mon?",
        "Relax.",
        "Lo' mon.",
        "Don't be shy.",
        "What'chu want?",
        "You come get da Voodoo."
        "Hello there.",
        "Greetings.",
        "Light be with you.",
        "What can I do for you?",
        "Well met.",
        "Need help?",
        "King's honor, friend.",
        "You need somethin'?",
        "Can I help you?",
        "How are you?",
        "Hey there.",
        "Hello.",
        "Good day to you."
        "Hey there!",
        "Ya got my attention.",
        "How are ya?",
        "Talk to me.",
        "'Lo!",
        "Well met.",
        "What's on your mind?",
        "Great tae meet ya.",
        "What can I do fer ya?",
        "Aye?",
        "Interest ya'n a pint?",
        "Welcome.",
        "Hello."
        "Hey.",
        "Greetings!",
        "Salutations!",
        "Honored, I'm sure.",
        "Good day to you.",
        "My, you're a tall one!",
        "Hmmm, interesting.",
        "Pleased to meet you!",
        "Can I help you?",
        "Very good.",
        "Need assistance?"
        "Blessings upon you.",
        "Archenon poros.",
        "Krona ki cristorr!",
        "May the light embrace you.",
        "The Naaru have not forgotten us.",
        "Each day is a blessing.",
        "Good fortune!",
        "Open your heart to the light.",
        "The Legion will fall.",
        "The Legion's end draws near.",
        "Warm wishes to you."
        "Elune be with you.",
        "Ishnu-alah.",
        "Elune light your path.",
        "I am listening.",
        "I am honored.",
        "What brings you here?",
        "I am listening.",
        "Greetings.",
        "Peace be with you."
    }
if channel == 'say' then   
    SendChatMessage(allgreetings[math.random(100)], "SAY")
        elseif channel == 'party' then
            SendChatMessage(allgreetings[math.random(100)], "PARTY")
        end
                end
               
       
   
   


function TheEarthFather:Dismiss(channel)
    local alldismiss = {
        "Walk with the Earth Father.",
        "Winds be at your back.",
        "Go in peace.",
        "May the eternal sun shine upon thee.",
        "Be careful.",
        "We shall meet again.",
        "Ancestors watch over you.",
        "Farewell.",
        "Goodbye."
        "Dabu.",
        "For the Horde!",
        "Go forth to victory.",
        "Strength.",
        "Go with honor.",
        "Farewell.",
        "Victory.",
        "Be safe.",
        "May your blades never dull."
        "Farewell.",
        "We will have justice!",
        "Death to all who oppose us!",
        "The reckoning is at hand!",
        "Selama ashal'anore!",
        "Remember the Sunwell.",
        "Stay the course.",
        "Time is of the essence.",
        "Shorel'aran.",
        "Keep your wits about you.",
        "Hold your head high."
        "Dark Lady watch over you.",
        "Victory for Sylvanas.",
        "Watch your back.",
        "Trust no one.",
        "Do not seek death.",
        "Goodbye.",
        "Our time will come.",
        "Beware, our enemies abound.",
        "Beware the living.",
        "Remember, patience... discipline.",
        "Embrace the shadow."
        "Layta.",
        "Ookie Dookie.",
        "See ya layta.",
        "Stay away from the Voodoo.",
        "You be careful mon.",
        "Be seeing ya.",
        "Spirits be with ya mon."
        "Farewell.",
        "Be careful.",
        "Go with honor, friend.",
        "Safe travels!",
        "For the Alliance.",
        "See you around.",
        "Light bless you.",
        "Have a good one."
        "Off with ye.",
        "Safe travels.",
        "Keep your feet on the ground.",
        "See ya soon.",
        "Watch yer back!",
        "Be good!"
        "You have a great day now.",
        "Very good.",
        "Very well then.",
        "Off and away.",
        "Be seeing you.",
        "Daylight's burning.",
        "Right.",
        "Alrighty, then!"
        "May your days be long and your hardships few.",
        "Be well.",
        "Remember the lessons of the past.",
        "Do not lose faith.",
        "Dioniss aca.",
        "Be kind to those less fortunate.",
        "Favor the road traveled by few.",
        "Remain vigilant.",
        "Safe journey.",
        "Blessings upon your family.",
        "Good health, long life."
        "Be careful.",
        "Elune guide your path.",
        "Goddess watch over you.",
        "Till the next we meet.",
        "May the stars guide you.",
        "Del-nadres.",
        "Asha-felna.",
        "Farewell.",
        "Go in peace.",
        "Good luck, friend.",
        "Goodbye."
    }

        if channel == 'say' then
            SendChatMessage(alldismiss[math.random(90)], "SAY")
        elseif channel == 'party' then
            SendChatMessage(alldismiss[math.random(90)], "PARTY")
        end
                end
   


SLASH_THEEARTHFATHER1 = "/tef"
SLASH_THEEARTHFATHER2 = "/theearthfather"

SlashCmdList.THEEARTHFATHER = function(msg, editbox)
    local arg1 = strsplit(" ", msg)
    local race = UnitRace("player")
    if msg == 'h' then
        TheEarthFather:Greet('say')
    elseif msg == 'b' then
        TheEarthFather:Dismiss('say')
    elseif msg == 'hp' then
        TheEarthFather:Greet('party')
    elseif msg == 'bp' then
        TheEarthFather:Dismiss('party')
    else
        print(format("Syntax\n /tem h\n /tem hp\n /tem b\n /tem bp\n"))
    end
end


Seerah 08-08-21 11:57 AM

Copied from one of the discord channels where you posted this same question.
Quote:

Originally Posted by Seerah
Firstly, get your greeting/dismiss tables out of those function. With them there, you are recreating new instances of all of those tables every time you call each function.
Second, are you geting any errors? (Make sure Lua errors are enabled and you're not hiding them.)


Fizzlemizz 08-08-21 12:10 PM

You have several lines in your table(s) that aren't terminated with commas
Code:

"I've been expecting you."
being the first.

If you're not getting errors then there's something wrong with whatever debugger you are using.

hasnogaems 08-08-21 02:02 PM

Quote:

Originally Posted by Fizzlemizz (Post 339678)
something wrong with whatever debugger you are using.

Wdym by that? I run "/tef b" in game. Is there other environment you can recommend?

U was right my scripterror cvar was set to 0.
And yes, commas!
https://imgur.com/a/qSxE5p4
You guys are the best

Kanegasi 08-08-21 02:39 PM

The "SAY" channel is protected when not in an instance. What you are trying to do here will not work. You can still send to "PARTY" though. You can also send to "EMOTE" if you want, like SendChatMessage("says: See ya soon!", "EMOTE")


All times are GMT -6. The time now is 07:57 AM.

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