Thread Tools Display Modes
08-08-21, 10:06 AM   #1
hasnogaems
A Flamescale Wyrmkin
 
hasnogaems's Avatar
Join Date: Apr 2016
Posts: 109
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
  Reply With Quote
08-08-21, 11:57 AM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Copied from one of the discord channels where you posted this same question.
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.)
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
08-08-21, 12:10 PM   #3
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
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.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
08-08-21, 02:02 PM   #4
hasnogaems
A Flamescale Wyrmkin
 
hasnogaems's Avatar
Join Date: Apr 2016
Posts: 109
Originally Posted by Fizzlemizz View Post
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

Last edited by hasnogaems : 08-08-21 at 02:06 PM.
  Reply With Quote
08-08-21, 02:39 PM   #5
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
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")
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Why / command not doing anything?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off