Wikia

WoWWiki

Sky (AddOn)

Talk0
101,547pages on
this wiki
Revision as of 08:26, April 8, 2010 by A'noob (Talk | contribs)

This page is for all documentation of Sky, an outdated addon.

Functions

isChannelActive

--	isChannelActive(channelID)
--
--		Tells you if a channel is active 
--		(meaning you can use it)
--
--		e.g. 
--			Sky.isChannelActive(SKY_CHANNEL) 
--			will return true if the "Sky" channel
--			exists in your channel list. 
--
--	args:
--		channelID - can be a string, a hard channel number or a SKY_IDENT
--
--	returns:
--		true - the channel is active and usable
--		false - the channel is inactive and unusable

activate

-- 	activate()
--		Turns Sky on

deactivate

--	deactivate()
--		Turns Sky off

emptyMailbox

--[[
--
--	emptyMailbox(mailboxID)
--		Empties a mailbox with id mailboxID
--
--	args:
--		mailboxID - string which is the mailbox's ID defined in Sky.registerChatWatch
--
--	returns: 
--		nil
--]]

getAllMessages

All messages will be returned in a number-indexed table in order recieved.

--[[
--	getAllMessages(mailboxID)
--		Returns a table containing all of the messages in the mailbox. 
--		It will then empty the mailbox.
--
--	returns:
--		table of mailbox entries
--]]

getNextMessage

--[[
--	getNextMessage(mailboxID)
--		Returns a table containing the next SkyEnvelope in that mailbox, or nil if no message exists
--		The message returned is removed from the mailbox.
--	
--		See the SkyEnvelope definition for more information
--			
--	returns:
--		table - the next message
--		nil - no message
--]]

updateSlashCommand

--[[
--	updateSlashCommand ( {slashCommandParts}, ... )
--
--		Updates a /command member if its valid.
--
--		e.g.
--			updateSlashCommand({id="myID";onExecute = fooFunc; } );
--
--			will change the onExecute function for myID.
--
--	arg members:
--		id - the ID matching the old slashCommand
--		member - onExecute | onSpace | onTab | commands | action | helpText
--		newvalue - the new value. 
--
--	returns:
--		true - successfully replace.
--		false - validation failed
--]]

registerSlashCommand

--[[
--	registerSlashCommand ( {slashCommand} [, {slashCommand}] ...)
--
--		See the slashCommand definition for more information. 
--
--	(Should be at the end of this file)
--		
--	Example:
--		Sky.registerSlashCommand(
--			{
--				id = "SnoopyCommand";
--				commands = {"/snoop", "/snoopy"};
--				onExecute = function( msg, cmd ) Sea.io.print("You're snoopy, ", msg , "! You  used: ", cmd ); end; 
--				action = "before";
--				helpText = "Shows the world you're nuts!"
--			}
--		);
--
--		/snoop Belldandy
--
--		Would print "You're snoopy, Belldandy! You used /snoop"
--
--		Action:
--			"hide"
--			If you return true from the slash command, it will attempt to 
--			call the default or previous slash command.
--
--			"before"
--			It will call your new function before the default command.
--
--			"after"
--			It will cally our new function after the default command.
--
--	Returns:
--		true - success!
--		false - a command failed!
--
--]]

registerMailbox

--[[
--
--	registerMailbox({mailboxRegistrant}, ...)
--
--		Registers a mailbox which will drop messages into a 
--		mailbox matching id, if acceptTest(message) returns true. 
--
--		See the mailboxRegistrant definition for more details
--		
--	Returns:
--		true if successful
--		false if unable to register
--]]

unregisterMailbox

--[[
--	unregisterMailbox(id)
--		unregisters the mailbox with the specified id
--
--	args:
--		id - string id of the mailbox
--]]

sendTable

--[[
--	sendTable( table [, system, target, player])
--	
--		Sends a lua object to the target using Sky.
--		See sendMessage for argument details
--
--]]

sendMessage

  • This can be used for regular chat, the only difference from SendChatMessage will be that it will be bound by the outbound character limit and chopped into pieces if it's too long.
  • SAY, WHISPER, PARTY, GUILD, RAID and CHANNEL messages will not be parsed or have special characters encoded.
  • SKY_CHANNEL, SKY_GROUP, SKY_GUILD, and SKY_PLAYER have line breaks, "s", "S" and "|" converted to invisible characters and back to their correct characters on the recieving end.

EX:

Sky.sendMessage("Group Members Rock!", "PARTY")
Sky.sendMessage("Whispers Rock!", "WHISPER", nil, "PlayerName")
Sky.sendMessage("101101001 Blah", SKY_CHANNEL, "AddonID")
--[[
--	sendMessage(message [, system, target, player])
--
--		Sends a simple text message to a 
--		specified target using Sky. 
--
--	Args:
--		message - the text to be delivered
--
--		optional (Default is an unencoded "SAY" to no particular target):
--		
--		system - channel/system used for transport 
--			(Sky Encoded & Hidden Messages)
--			SKY_CHANNEL |"global" - sends to all Sky users
--			SKY_GROUP  - sends to party/raid members using Sky
--			SKY_GUILD - sends to all guild members using Sky
--			SKY_PLAYER - sends to a player using Sky, through a hidden whisper
--			(Pure/Visible Messages)
--			"SAY" sends to the world regardless of Sky usage
--			"WHISPER" sends to a player regardless of Sky usage
--			"PARTY" sends to a party regardless of Sky usage
--			"GUILD" sends to a guild regardless of Sky usage
--			"RAID" sends to a raid regardless of Sky usage
--			"CHANNEL" sends to a particular channel (1, general, etc)
--			
--		target - destination mailbox
--			This value will be the .target value of the envelope sent to acceptTest
--
--		player - 
--			( channel identifier for "CHANNEL" )
--			( playername for SKY_PLAYER/"WHISPER" )
--			( nil for everything else )
--
--]]

isSkyUser

--	isSkyUser ( username ) 
--		Checks if a username is a known sky user. If they are not, you get nil.
--		If they are, you get a list of the channels they have been seen in. 
--
--		Due to the way the SkyUserList updates, 
--		You should do this 20 seconds after the party changes.
--
--	Returns:
--		table - list of the channels they are in
--		nil - they are not known to be a sky user. 

flush

Warning:

Do not use this function recklessly. It will attempt to dump 30 messages at a time out of the SkyQueue. However, this may cause framerate drops if you have a lot of messaging going on.

A better solution is to use Sky.sendFastMessage().

--	flush()
--		Forces all timers to go off NOW
--
--

sendAlert

--[[
--	sendAlert (message [, system, alertid])
--
--		Sends a message instantly through Sky. 
--		Alerts cannot be longer than SKY_MAX_DATAGRAM_LENGTH
--		and cannot contain anything but text.
--
--	Args:
--		message - message to be sent
--		system - SKY_CHANNEL|SKY_PARTY|SKY_PLAYER|SKY_ZONE|SKY_RAID
--		alertid - 2 character code to indicate who gets alerted
--
--	Returns:
--		true - message parsed and sent
--		false - unable to parse or unable to send
--		
--]]

registerAlert

--[[
--	registerAlert ( {alertRegistrant} [, {alertRegistrant} ] ... )
--
--		Registers an alert watcher with Sky. 
--		Alerts are called immediately, rather than stored. 
--		This can cause lag if too many are sent. 
--		You are warned!
--]]

registerHostess

--[[
--	registerHostess( {skyHostess} [, {skyHostess}] )
--		Registers a hostess who gets informed as channels are made available,
--		removed, or when players are joined/added. 
--
--	args:
--		skyHostess - table
--			{
--				id - unique id for the hostess
--				callback - function called when a channel even occurs
--					(action, actionData)
--					action - string containing 
--						SKY_PLAYER_JOIN|SKY_PLAYER_LEAVE|SKY_CHANNEL_LIST|SKY_CHANNEL_JOIN|SKY_CHANNEL_LEFT
--                                             NOTE: SkyLight seems to implement SKY_CHANNEL_LEAVE instead of SKY_CHANNEL LEFT,
--                                                   even though its comments don't reflect this. I don't know about regular Sky.
--					actionData - table
--						{
--							channel - channel name (SKY_CHANNEL or whatever)
--							
--						(action dependent:)
--							username - string - username of the player who joined/left
--							list - table - users in channel
--						}
--					
--				channels - table containing channels
--					SKY_CHANNEL, SKY_PARTY, "general", etc
--				description - short string describing the addon
--			}
--]]

updateHostess

--[[
--	updateHostess ( {skyHostess} [, {skyHostess}] )
--		Updates a hostess to have new values
--
--	args: 
--		See registerHostess
--
--	returns:
--		true - success
--		false - failed to register
--]]

unregisterHostess

--[[
--	unregisterHostess(id)
--		unregisters the specified hostess by id
--
--	args:
--		id - string id
--]]

unregisterSlashCommand

--[[
--	unregisterSlashCommand(id)
--		Removes the slash commands associated with that id
--
--	args:
--		id - string id
--
--]]

unregisterAlert

--[[
--	unregisterAlert(id)
--		Unregisters an alert by its id
--
--	args:
--		id - string id
--
--]]

unregisterMailbox

--[[
--	unregisterMailbox(id)
--		unregisters the mailbox with the specified id
--
--	args:
--		id - string id of the mailbox
--]]

checkBandwidth

--[[
--	checkBandwidth()
--		Check the status of the bandwidth limit.
--	returns:
--		A positive or negative number, the size of which indicates how
--		much over (positive) or under (negative) the client is relative
--		to the bandwidth limit.
--]]

isHostingByID

--[[
--	isHostingByID(id)
--		retuns true if there's a hostess with that id
--
--	args:
--		id - string id
--
--	returns:
--		true - it exists
--		false - not exists
--]]

Around Wikia's network

Random Wiki