I’d like to run the TomTom slash command “/way #2022 47.0 82.6” inside of a WeakAura. I did a little research and found that I should try using:
“SlashCmdList[“SLASH_TOMTOM_WAY1”](”#2022 47.0 82.6")"
inside the Actions tab → On Show → Custom code box. (“SLASH_TOMTOM_WAY1” is the slash command /way inside of TomTom code)
However when the WeakAura is shown, I get this Lua error:
"[string “return function() SlashCmdList[“SLASH_TOMTO…”]:1: attempt to call field ‘SLASH_TOMTOM_WAY1’ (a nil value)”
I’m assuming that this means it can’t find the “SLASH_TOMTOM_WAY1” slash command in the SlashCmdList.
If there’s a different way to add a tom tom waypoint inside of a weakaura that’d be great, otherwise what am I missing?
I don’t use Weak Auras so can’t help running code inside that, but SLASH_TOMTOM_WAY1 is the “/way” command itself. You likely want SlashCmdList[“TOMTOM_WAY”] instead, or SlashCmdList.TOMTOM_WAY
/run SlashCmdList.TOMTOM_WAY("#2022 47.0 82.6")
Thanks for the help. Unfortunately I get the same error about TOMTOM_WAY. (tried it both ways)
Is there some kind of a global slash command list I need to be referencing instead? I’ve read that certain commands are local to addons themselves.
Does copy and pasting this into chat create a waypoint?
/run SlashCmdList.TOMTOM_WAY("#2022 47.0 82.6")
If so, then your solution will be finding out how Weak Auras runs code. Maybe someone else here has experience with it.
If it doesn’t run, and /way does work, use hash_SlashCmdList to get the SlashCmdList when it’s not known:
/run hash_SlashCmdList["/WAY"]("#2022 47.0 82.6")
(You probably already know, but the /run is just for entering into a macro/chat. You would exclude that in most things that run lua code.)
Copy and pasting
/run SlashCmdList.TOMTOM_WAY("#2022 47.0 82.6")
into chat creates a waypoint. Time to find out how Weak Auras runs code.
Thanks for your assistance.