How to use API?

Hi, I’ve recently started to check LUA and API on wowwiki. In this thread I’m gonna focus on API. There are many API functions, for instance GetMinimapZoneText().

How do you actually use these in game?

I managed to create a button in TMW where I could write GetMinimapZoneText()= “Tarren Mill”.
This button lights up when I’m in Tarren Mill.

But how do you use this function to get a string value returned in chat? I simply tried to write GetMinimapZoneText() in the chatwindow and it just printed out my input instead of the current minimap zone name which is what i wanted.

Thanks.

/dump GetMinimapZoneText()
/run print(GetMinimapZoneText())
3 Likes

While Ketho is right, try an addon for that very purpose, that is WowLua. It creates window(s) with outputs as chat is not the best place to test functions. You can also create scripts.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.