API/Guilder

Guilder is an addon written to attempt to make everyday guild life simpler and more enjoyable The addon contains modules for guild admin as well as party/raid utilities


Guilder:CallMethodOnModules(method_name, ...)

Call a given method on all modules if those modules have the method.
This will iterate over disabled modules.

Parameters

method_name
name of the method
...
arguments that will be passed to the module

Usage

Guilder:CallMethodOnModules("SomeMethod", "SomeArgument", ...)


Guilder:CommHandler(distribution, sender, command, ...)

Is the framework's default CommHandler.
It should NEVER be called from a module. Instead, define a MyModule:CommHandler() to handle the module's own messages. The framework will automatically forward the message to the module if this method is found.

Parameters

distribution
the channel that was used
sender
the person that sent the message
command
the command that was sent to the CommHandler
...
the message that goes with the command (if any)

Usage

internal use only


Guilder:ExecuteChatCommand(arg)

Attempts to execute the supplied argument as though it were a command entered by the user in the chat window

Parameters

arg
the text the user would have typed

Usage

Guilder:ExecuteChatCommand("/silly")


Guilder:FindOfficerAlt(mainName)

Attempts to find the officer's name in the notes or officer's notes

Parameters

mainName
name of the main character

Return value

"AltName (MainName)" if found, otherwise returns nil

Usage

Guilder:FindOfficerAlt("Player")


Guilder:GetClassColorString(name)

Tries returns a coloured string by player class.
If the class is unknown, the name is returned in gray.

Parameters

name
name of the character

Return value

the name of the character in the class color, in the format: "|cFFxxxxxxPlayer|r"

Usage

Guilder:GetClassColorString("Player")


Guilder:GetNumberOfGuildOfficers()

Looks for characters holding the Officer rank and then simply performs a count to determine how many such characters there

Return value

the number of officers

Usage

Guilder:GetNumberOfGuildOfficers()


Guilder:GetNumberOfGuildOfficersOnline()

Looks for characters holding the Officer rank and then simply performs a count to determine how many are online at the moment

Return value

the number of officers

Usage

Guilder:GetNumberOfGuildOfficersOnline()


Guilder:GetUserVersion(player)

Queries the guilderUsers table and returns the version number or nil

Parameters

player
name of the player to check for

Return value

version string or nil

Usage

Guilder:GetUserVersion(UnitName("Player"))


Guilder:IsAlt(name)

Checks whether a character holds the rank of alt

Parameters

name
name of the character

Return value

true if the character is an alt, otherwise returns false

Usage

Guilder:IsAlt("Player")


Guilder:IsInBattleground()

Checks to see if we are currently in a battleground

Return value

true if we are in a battleground, otherwise returns false

Usage

  if Guilder:IsInBattleground() then
    print("You are in a battleground")
  end


Guilder:IsInCombat()

Checks to see if we are currently in combat

Return value

true if we are in combat, otherwise returns false

Usage

  if Guilder:IsInCombat() then
    print("You are in combat")
  end


Guilder:IsInFriends(name)

Checks whether the named character is on our friends list

Parameters

name
name of the character

Return value

true if the character is in the friends list, otherwise returns false

Usage

  if Guilder:IsInFriends("Player") then
    print("Player is in your friends list")
  end


Guilder:IsInParty()

Checks to see if we are currently in a party

Return value

true if we are in a party, otherwise returns false

Usage

  if Guilder:IsInParty() then
    print("You are in a party")
  end


Guilder:IsInRaid()

Checks to see if we are currently in a raid

Return value

true if we are in a raid, otherwise returns false

Usage

  if Guilder:IsInRaid() then
    print("You are in a raid")
  end


Guilder:IsOfficer(name)

Checks whether a character holds the ranks of officer

Parameters

name
name of the character

Return value

true if the character is an officer, otherwise returns false

Usage

Guilder:IsOfficer("Player")


Guilder:IsOfficerAlt(name)

Checks whether a character holds the rank of officer's alt

Parameters

name
name of the character

Return value

true if the character is an officer alt, otherwise returns false

Usage

Guilder:IsOfficerAlt("Player")


Guilder:OutOfCombatWrapper(func)

Wrap the given function so that any call to it will be piped through Guilder:RunOnLeaveCombat.

Parameters

func
function to call

Return value

the wrapped function

Usage

myFunc = Guilder:OutOfCombatWrapper(func)
MyNamespace.MyMethod = Guilder:OutOfCombatWrapper(MyNamespace.MyMethod)


Guilder:PlayersInGroup()

Returns the list of players in our current group.
First it attempts to get raid/party data from LibGroup. If we aren't in a group, only our name is added to the list.

Return value

a table of players in the group in the format: t[Player] = "|cFFxxxxxxPlayer|r"

Usage

t = Guilder:PlayersInGroup()


Guilder:PlayersInGroupAndGuild()

Returns the list of players in our current group and guild.

Return value

a table of players in the group and guild in the format: t[Player] = "|cFFxxxxxxPlayer|r"

Usage

t = Guilder:PlayersInGroupAndGuild()


Guilder:PlayersInGroupOrGuild()

Returns the list of players in our current group or else guild if we're not in a group.

Return value

a table of players in the group or guild in the format: t[Player] = "|cFFxxxxxxPlayer|r"

Usage

t = Guilder:PlayersInGroupOrGuild()


Guilder:PlayersInGuild(includeOffline)

Returns the list of players in our current guild.

Parameters

includeOffline
if set to true, will include offline guild members as well

Return value

a table of players in the guild in the format: t[Player] = "|cFFxxxxxxPlayer|r"

Usage

t = Guilder:PlayersInGuild()


Guilder:RunOnLeaveCombat(func, ...)

Call a function if out of combat or schedule to run once combat ends.
If current out of combat, the function provided will be called without delay.

Parameters

func
function to call
...
arguments to pass into func

Usage

Guilder:RunOnLeaveCombat(someSecureFunction)
Guilder:RunOnLeaveCombat(someSecureFunction, "player")


Guilder:SendComm(mod, distribution, target, ...)

Is used to send information between users of the addon

Parameters

mod
the id of the module sending the message
distribution
which channel to use. Valid options are "GUILD", "PARTY", "RAID" and "WHISPER"
target
if distribution is a "WHISPER", this is the person to send the info to.
...
the content of the message

Usage

Guilder:SendComm(self.id, "GUILD", nil, "some", "information")


Guilder:SendMessage(msg, distribution, target)

Is ostensibly a wrapper to the normal SendChatMessage function with the following changes: 1.
Language is set to nil. 2. If distribution = "SELF", output is routed to Guilder:ShowMessage() instead. 3. If distribution = "NULL", output is muted. The intention for the existence of the NULL option for the channel is to allow for functions to pass a parameter that can be switched between a normal channel and null to turn debug mode features on/off.

Parameters

msg
the text to send to the recipient
distribution
the name of the channel on which to send it
target
person you want to send the whisper to

Usage

Guilder:SendMessage("Test", "SELF", "Player")


Guilder:ShowMessage(msg)

Is a wrapper to DEFAULT_CHAT_FRAME:AddMessage() It adds the name of the addon (in colour) to the beggining of the message

Parameters

msg
the message to show in the chat frame

Usage

Guilder:ShowMessage("some message")


Guilder:UpdateConfigOptions()

Is used to dynamically update the options in the configuration screen.
Modules may define their own MyModule:UpdateConfigOptions() to do the same. This method is automatically called if it exists prior to the user opening the configuration screen.

Usage

internal use only



Comments

Posts Quoted:
Reply
Clear All Quotes