Thread Tools Display Modes
Prev Previous Post   Next Post Next
02-15-15, 04:14 PM   #1
Kraiven
A Deviate Faerie Dragon
 
Kraiven's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2015
Posts: 10
Help with my own addon, need some LUA guidance.

I'm attempting to write my first addon while trying to learn LUA. I'm having trouble finding the exact API data to move forward with my code. I'd like to write it myself, but I'm wondering if someone can point me in the right direction with some better examples. Currently I'm trying to make a very simple code that when you enter a LFG, it compares your active spec(tank, healer, damage) to your Queued selected role(tank, healer, damage), and if they don't match, prints a message in chat saying you are in the wrong spec. Some of the "get(functions)" I've been looking at in the WoW API are incomplete for data and explanations. Any pointers?

Here's my current codewhich I'm sorry if it's noobish, but I'm currently learning Python)

Code:
-- Spec Check load on Instance
local f = CreateFrame("Frame")
local role = UnitGroupRolesAssigned("player")
local isAssigned = GetPartyAssignment("assignment", "player")

f:RegisterEvent(PLAYER_ROLES_ASSIGNED);
--f:RegisterEvent(ending event);


-- Check Active Role Vs. Assigned Role
f:SetScript("OnEvent", function(self, event, ...)
	if event == "PLAYER_ROLES_ASSIGNED" and role ~= isassigned then
		print("Your current Talent Spec is set Wrong, switch specs!")
	end

end)
Thank you for any tips, I'm just doing this for fun.
  Reply With Quote
 

WoWInterface » Developer Discussions » General Authoring Discussion » Help with my own addon, need some LUA guidance.


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