Picture the scene… You’re a mage in Kargath and you want to make some money creating portals for people heading to Orgimmar and elsewhere. But you’re not the only mage hoping to make some quick cash from your services. You have competition! You apply your entire marketing knowledge and yell your best sales pitch to the continuous stream of adventurers bundling out of the inn.
Nobody’s biting. Despite adventurers yelling words like “Org”, “UC”, “TB”, “Og” and “Undersh*tty”, nobody is coming to you for those portals. Every time you invite one of those gold-laden, potential customers to a group, you’re informed that they’re already in one! It seems that the other portal-selling mages are getting all the business. They smile smugly to themselves as they continuously vacuum up gold from everyone around them and yet you’re not getting a single coin.
What’s going on?
You probably already know if you’ve ever been seeking portals from a mage yourself. As soon as you utter a phrase which indicates that you’re looking for a portal then you’ll be immediately invited to a group. No human could possibly react as fast so it must be automated and indeed it is. The other mages are running AddOns to quickly create groups and get the business.
So here’s how to make a World of Warcraft AddOn to do the same thing yourself. Soon you’ll be on a level playing field with the competition!
I’m not going to prattle on about Lua and why people use AddOns just to get my word count up and hope for a better SEO ranking. Instead, I’m going to assume that you already know these things or you wouldn’t be here in the first place.
Choose a Name
First, we need a unique name for our AddOn. Something catchy but relevant to its function. Hmmm…
Create a Folder
Every AddOn needs its own folder created in a specific location in order for World of Warcraft to find it. On my PC the AddOns folder is located at:
C:\Program Files (x86)\World of Warcraft\_classic\Interface\AddOns
You’ll know you’re in the right place because you’ll likely see other AddOns in the folder but if you’re one of those rare freaks of nature that has never installed an AddOn before then you might need to create this folder yourself.
You’ll then need to create your new folder inside of this one so in my case I will be working at:
C:\Program Files (x86)\World of Warcraft_classic\Interface\AddOns\PortalWhere
Create Some Files
Every AddOn must have a
.toc file in order for World of Warcraft to recognise it. This file contains everything the game needs to know about your AddOn, including its name, description, the version of WoW required and what Lua and XML files to load to make it all work. The main thing to remember is that the
.toc file must be named the same as its parent folder and it must use the
.toc extension. So ours will be called
## Interface: 11302 ## Title: PortalWh*re ## Notes: A portal mage's best friend Core.lua
Interface line tells WoW which version this AddOn is for. Since we’re creating this for Classic then we’ll tell it that we require version
Title line is the name that will show up in the AddOns list in game, and the
Notes line specifies the description shown when you hover your mouse over it.
Underneath the ## headers is a list of files that the AddOn will load. PortalWhere is going to be a relatively simple AddOn so we’ll be able to code it all using only one Lua file – All of our code will be in
Core.lua. So create that file and we’ll move on to the good stuff – actual code!