Quantcast
Execute slash cmd/Function from another addon - WoWInterface
Thread Tools Display Modes
08-31-08, 04:03 AM   #1
Scale
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 28
Execute slash cmd/Function from another addon

I would like to either run the slash command from my addon:
"/aguf raid raidset 1"

Or the LUA command inside aguf:
aUF:setVisibilityOption(CurrentRaidSet, 1)

Is this possible?

Thanks!
  Reply With Quote
09-01-08, 01:22 PM   #2
Mera
Retired of WoW, In ESO :)
 
Mera's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 331
sure you just have to copy paste where you need the function

aUF:setVisibilityOption(CurrentRaidSet, 1)

it will recognize it even in your addon because aUF is a global table.
__________________
If you need to reach me I'm in ESO, @class101 or "Fathis Ules i"
addons: SpamBayes, BrokerCPU
projects: ThunderBayes
Mera[xeh]? - La CroisadeEcarlate (wow)
  Reply With Quote
09-01-08, 04:35 PM   #3
Scale
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 28
Originally Posted by Mera_LaCroisadeEcarlate View Post
sure you just have to copy paste where you need the function

aUF:setVisibilityOption(CurrentRaidSet, 1)

it will recognize it even in your addon because aUF is a global table.
So if i understand i just have to copy:

aUF:setVisibilityOption(CurrentRaidSet, 1)

And paste it where i need it, but then when i run it:

attempt to call method 'setVisibilityOption' (a nil value)
  Reply With Quote
09-02-08, 03:09 AM   #4
Mera
Retired of WoW, In ESO :)
 
Mera's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 331
Originally Posted by Scale View Post
So if i understand i just have to copy:

aUF:setVisibilityOption(CurrentRaidSet, 1)

And paste it where i need it, but then when i run it:

attempt to call method 'setVisibilityOption' (a nil value)
I have got a look at ag source and you wont be able to use SetVisibility or I don't see the trick to do it because this is not aUF:SetVisibility which is set but

Code:
local function setVisibilityOption(option, value)
this is a local function and not global so you cannot call it outside the addon, you will have to write another function that is doing the same thing than the auf one, it's calling SetVisibility() auf api which this one is global

Code:
function aUF.classes.aUFgroup.prototype:SetVisibility()
self:UpdateRaidSet()
if self.database.Hidden == true
or self.database.Exists == false
or (not (self.raidSetVisible) and self.type == "raid")
or (self.type == "raid" and aUF.db.profile.units.raid.HideFrame == true)
or (self.type == "party" and (aUF.db.profile.units.party.HideFrame == true or (aUF.db.profile.RaidHideParty and UnitInRaid("player")) ))
or (self.type == "partypet" and (aUF.db.profile.units.partypet.HideFrame == true or (aUF.db.profile.RaidHideParty and UnitInRaid("player")) )) then
  self.header:Hide()
  self.anchor:Hide()
  else
    self.header:Show()
  end
end
and can be called, it's not that easy to use addons functions from source directly so if you are really not fine with addon, better to start understanding from scratch
__________________
If you need to reach me I'm in ESO, @class101 or "Fathis Ules i"
addons: SpamBayes, BrokerCPU
projects: ThunderBayes
Mera[xeh]? - La CroisadeEcarlate (wow)
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Execute slash cmd/Function from another addon

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