Difference between revisions of "Guild"

From Vendetta Lua
Jump to: navigation, search
m (Added to category.)
Line 4: Line 4:
  
  
== Functions ==
+
>== Functions ==
  
 
=== allowdepositors ===
 
=== allowdepositors ===
'''Definition:'''<br>
+
'''Definition:'''&lt;br&gt;
allowdepositors{int rank, ..} -> string error  
+
allowdepositors{int rank, ..} -&gt; string error  
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Description:''' <br>
+
'''Description:''' &lt;br&gt;
 
Control who can deposit money into the bank (untested)
 
Control who can deposit money into the bank (untested)
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Arguments:'''<br>
+
'''Arguments:'''&lt;br&gt;
 
'''rank''' numbers that represent ranks
 
'''rank''' numbers that represent ranks
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Returns:'''<br>
+
'''Returns:'''&lt;br&gt;
 
'''error''' error message on failure otherwise nil
 
'''error''' error message on failure otherwise nil
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Example:'''<br>
+
'''Example:'''&lt;br&gt;
<source lang="lua">Guild.allowdepositors{Guild.RankCommander, Guild.RankCouncil}</source>
+
&lt;source lang=&quot;lua&quot;&gt;Guild.allowdepositors{Guild.RankCommander, Guild.RankCouncil}&lt;/source&gt;
 
allow commander and councilmembers to deposit
 
allow commander and councilmembers to deposit
<br><br>
+
&lt;br&gt;&lt;br&gt;
  
  
 
=== allowlogviewers ===
 
=== allowlogviewers ===
'''Definition:'''<br>
+
'''Definition:'''&lt;br&gt;
allowlogviewers{int rank, ..} -> string error  
+
allowlogviewers{int rank, ..} -&gt; string error  
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Description:''' <br>
+
'''Description:''' &lt;br&gt;
 
Control who can view the bank transaction log (untested)
 
Control who can view the bank transaction log (untested)
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Arguments:'''<br>
+
'''Arguments:'''&lt;br&gt;
 
'''rank''' numbers that represent ranks
 
'''rank''' numbers that represent ranks
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Returns:'''<br>
+
'''Returns:'''&lt;br&gt;
 
'''error''' error message on failure otherwise nil
 
'''error''' error message on failure otherwise nil
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Example:'''<br>
+
'''Example:'''&lt;br&gt;
<source lang="lua">Guild.allowlogviewers{Guild.RankCommander, Guild.RankCouncil}</source>
+
&lt;source lang=&quot;lua&quot;&gt;Guild.allowlogviewers{Guild.RankCommander, Guild.RankCouncil}&lt;/source&gt;
 
allow commander and councilmembers to view the log
 
allow commander and councilmembers to view the log
<br><br>
+
&lt;br&gt;&lt;br&gt;
  
  
  
 
=== allowwithdrawalers ===
 
=== allowwithdrawalers ===
'''Definition:'''<br>
+
'''Definition:'''&lt;br&gt;
allowwithdrawalers{int rank, ..} -> string error  
+
allowwithdrawalers{int rank, ..} -&gt; string error  
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Description:''' <br>
+
'''Description:''' &lt;br&gt;
 
Control who can withdraw money from the bank (untested)
 
Control who can withdraw money from the bank (untested)
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Arguments:'''<br>
+
'''Arguments:'''&lt;br&gt;
 
'''rank''' numbers that represent ranks
 
'''rank''' numbers that represent ranks
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Returns:'''<br>
+
'''Returns:'''&lt;br&gt;
 
'''error''' error message on failure otherwise nil
 
'''error''' error message on failure otherwise nil
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Example:'''<br>
+
'''Example:'''&lt;br&gt;
<source lang="lua">Guild.allowwithdrawalers{Guild.RankCommander, Guild.RankCouncil}</source>
+
&lt;source lang=&quot;lua&quot;&gt;Guild.allowwithdrawalers{Guild.RankCommander, Guild.RankCouncil}&lt;/source&gt;
 
allow commander and councilmembers to withdraw money
 
allow commander and councilmembers to withdraw money
<br><br>
+
&lt;br&gt;&lt;br&gt;
  
  
  
 
=== appoint ===
 
=== appoint ===
'''Definition:'''<br>
+
'''Definition:'''&lt;br&gt;
appoint() -> ?  
+
appoint() -&gt; ?  
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Description:''' <br>
+
'''Description:''' &lt;br&gt;
 
appoint a guildmember as lieutenant (untested)
 
appoint a guildmember as lieutenant (untested)
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Arguments:'''<br>
+
'''Arguments:'''&lt;br&gt;
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Returns:'''<br>
+
'''Returns:'''&lt;br&gt;
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Example:'''<br>
+
'''Example:'''&lt;br&gt;
<br><br>
+
&lt;br&gt;&lt;br&gt;
  
  
 
=== create ===
 
=== create ===
'''Definition:'''<br>
+
'''Definition:'''&lt;br&gt;
create(string acronym, name) -> ?
+
create(string acronym, name) -&gt; ?
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Description:''' <br>
+
'''Description:''' &lt;br&gt;
 
create a guild
 
create a guild
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Arguments:'''<br>
+
'''Arguments:'''&lt;br&gt;
'''acronym''' guild acronym 4 chars or less<br>
+
'''acronym''' guild acronym 4 chars or less&lt;br&gt;
 
'''name''' name of the guild
 
'''name''' name of the guild
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Returns:'''<br>
+
'''Returns:'''&lt;br&gt;
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Example:'''<br>
+
'''Example:'''&lt;br&gt;
<br><br>
+
&lt;br&gt;&lt;br&gt;
  
  
 
=== decline ===
 
=== decline ===
'''Definition:'''<br>
+
'''Definition:'''&lt;br&gt;
create(string name) -> ?
+
create(string name) -&gt; ?
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Description:''' <br>
+
'''Description:''' &lt;br&gt;
 
decline an invitation to a guild(untested)
 
decline an invitation to a guild(untested)
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Arguments:'''<br>
+
'''Arguments:'''&lt;br&gt;
 
'''name''' name of player that invited you
 
'''name''' name of player that invited you
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Returns:'''<br>
+
'''Returns:'''&lt;br&gt;
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Example:'''<br>
+
'''Example:'''&lt;br&gt;
<br><br>
+
&lt;br&gt;&lt;br&gt;
  
 
=== deposit ===
 
=== deposit ===
'''Definition:'''<br>
+
'''Definition:'''&lt;br&gt;
deposit(int amount, string reason) -> boolean valid
+
deposit(int amount, string reason) -&gt; boolean valid
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Description:''' <br>
+
'''Description:''' &lt;br&gt;
 
deposit money into the guild bank
 
deposit money into the guild bank
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Arguments:'''<br>
+
'''Arguments:'''&lt;br&gt;
'''amount''' how much to deposit, can be a number or a string in format accepted by tonumber function eg. '1000' or '1e3'<br>
+
'''amount''' how much to deposit, can be a number or a string in format accepted by tonumber function eg. '1000' or '1e3'&lt;br&gt;
 
'''reason''' reason for deposit or nil
 
'''reason''' reason for deposit or nil
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Returns:'''<br>
+
'''Returns:'''&lt;br&gt;
'''valid''' - true if specified amount was in valid format, else otherwise. (does not depend on whether the operation succeded)<br>
+
'''valid''' - true if specified amount was in valid format, else otherwise. (does not depend on whether the operation succeded)&lt;br&gt;
 
information whether money was withdrawn or not is posted to chat via CHAT_MSG_SERVER event.
 
information whether money was withdrawn or not is posted to chat via CHAT_MSG_SERVER event.
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Example:'''<br>
+
'''Example:'''&lt;br&gt;
<br><br>
+
&lt;br&gt;&lt;br&gt;
  
  
  
 
=== expel ===
 
=== expel ===
'''Definition:'''<br>
+
'''Definition:'''&lt;br&gt;
expel(string name) -> ?
+
expel(string name) -&gt; ?
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Description:''' <br>
+
'''Description:''' &lt;br&gt;
 
expel a guildmember(untested)
 
expel a guildmember(untested)
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Arguments:'''<br>
+
'''Arguments:'''&lt;br&gt;
 
'''name''' name of player
 
'''name''' name of player
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Returns:'''<br>
+
'''Returns:'''&lt;br&gt;
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Example:'''<br>
+
'''Example:'''&lt;br&gt;
<br><br>
+
&lt;br&gt;&lt;br&gt;
  
  
  
 
=== getactivitylogpage ===
 
=== getactivitylogpage ===
'''Definition:'''<br>
+
'''Definition:'''&lt;br&gt;
getactivitylogpage(int page) -> string error
+
getactivitylogpage(int page) -&gt; string error
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Description:''' <br>
+
'''Description:''' &lt;br&gt;
 
get activity log page. the function triggers the GUILD_ACTIVITY_LOG event and passes the page to the callback in the registered table.
 
get activity log page. the function triggers the GUILD_ACTIVITY_LOG event and passes the page to the callback in the registered table.
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Arguments:'''<br>
+
'''Arguments:'''&lt;br&gt;
 
'''page''' page index
 
'''page''' page index
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Returns:'''<br>
+
'''Returns:'''&lt;br&gt;
 
'''error''' error message or nil
 
'''error''' error message or nil
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Example:'''<br>
+
'''Example:'''&lt;br&gt;
obj = {} function obj:OnEvent(name, data) if print(data) end RegisterEvent(obj, "GUILD_ACTIVITY_LOG") Guild.getactivitylogpage(1)
+
obj = {} function obj:OnEvent(name, data) if print(data) end RegisterEvent(obj, &quot;GUILD_ACTIVITY_LOG&quot;) Guild.getactivitylogpage(1)
<br><br>
+
&lt;br&gt;&lt;br&gt;
  
  
Line 170: Line 170:
  
 
=== getbankbalance ===
 
=== getbankbalance ===
'''Definition:'''<br>
+
'''Definition:'''&lt;br&gt;
getbankbalance() -> ?
+
getbankbalance() -&gt; ?
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Description:''' <br>
+
'''Description:''' &lt;br&gt;
 
get bank balance(?) triggers GUILD_BALANCE_UPDATED event. with no data though
 
get bank balance(?) triggers GUILD_BALANCE_UPDATED event. with no data though
<br><br>
+
&lt;br&gt;&lt;br&gt;
 
'''Arguments:'''
 
'''Arguments:'''
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Returns:'''<br>
+
'''Returns:'''&lt;br&gt;
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Example:'''<br>
+
'''Example:'''&lt;br&gt;
<br><br>
+
&lt;br&gt;&lt;br&gt;
  
  
 
=== getbanklogpage ===
 
=== getbanklogpage ===
'''Definition:'''<br>
+
'''Definition:'''&lt;br&gt;
getbanklogpage(int page) -> string error
+
getbanklogpage(int page) -&gt; string error
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Description:''' <br>
+
'''Description:''' &lt;br&gt;
 
get bank log page. the function triggers the GUILD_BANK_LOG event and passes the page to the callback in the registered table.
 
get bank log page. the function triggers the GUILD_BANK_LOG event and passes the page to the callback in the registered table.
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Arguments:'''<br>
+
'''Arguments:'''&lt;br&gt;
 
'''page''' page index
 
'''page''' page index
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Returns:'''<br>
+
'''Returns:'''&lt;br&gt;
 
'''error''' error message or nil
 
'''error''' error message or nil
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Example:'''<br>
+
'''Example:'''&lt;br&gt;
obj = {} function obj:OnEvent(name, data) if print(data) end RegisterEvent(obj, "GUILD_BANK_LOG") Guild.getbanklogpage(1)
+
obj = {} function obj:OnEvent(name, data) if print(data) end RegisterEvent(obj, &quot;GUILD_BANK_LOG&quot;) Guild.getbanklogpage(1)
<br><br>
+
&lt;br&gt;&lt;br&gt;
  
 
=== withdraw ===
 
=== withdraw ===
'''Definition:'''<br>
+
'''Definition:'''&lt;br&gt;
withdraw(int amount, string reason) -> boolean valid
+
withdraw(int amount, string reason) -&gt; boolean valid
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Description:'''<br>
+
'''Description:'''&lt;br&gt;
 
Attempts to withdraw specified amount of money from guild bank.
 
Attempts to withdraw specified amount of money from guild bank.
  
<br>
+
&lt;br&gt;
'''Arguments:'''<br>
+
'''Arguments:'''&lt;br&gt;
'''amount''' - amount of money to be withdrawn, can be a number or a string in format accepted by tonumber function eg. '1000' or '1e3'<br>
+
'''amount''' - amount of money to be withdrawn, can be a number or a string in format accepted by tonumber function eg. '1000' or '1e3'&lt;br&gt;
 
'''reason'''
 
'''reason'''
<br><br>
+
&lt;br&gt;&lt;br&gt;
'''Returns:'''<br>
+
'''Returns:'''&lt;br&gt;
'''valid''' - true if specified amount was in valid format, else otherwise. (does not depend on whether the operation succeded)<br>
+
'''valid''' - true if specified amount was in valid format, else otherwise. (does not depend on whether the operation succeded)&lt;br&gt;
 
information whether money was withdrawn or not is posted to chat via CHAT_MSG_SERVER  event.
 
information whether money was withdrawn or not is posted to chat via CHAT_MSG_SERVER  event.
<br><br>
+
&lt;br&gt;&lt;br&gt;
 +
 
 +
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://yqowoka.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]=
 +
----
 +
=[http://yqowoka.co.cc CLICK HERE]=
 +
----
 +
</div>
  
 
== Constants ==
 
== Constants ==

Revision as of 05:36, 18 November 2010

Functions to handle guild related features.

The constants in this table represent ranks that are used by various functions. They can be mapped to names using the Guild#RankName table


>== Functions ==

allowdepositors

Definition:<br> allowdepositors{int rank, ..} -> string error <br><br> Description: <br> Control who can deposit money into the bank (untested) <br><br> Arguments:<br> rank numbers that represent ranks <br><br> Returns:<br> error error message on failure otherwise nil <br><br> Example:<br> <source lang="lua">Guild.allowdepositors{Guild.RankCommander, Guild.RankCouncil}</source> allow commander and councilmembers to deposit <br><br>


allowlogviewers

Definition:<br> allowlogviewers{int rank, ..} -> string error <br><br> Description: <br> Control who can view the bank transaction log (untested) <br><br> Arguments:<br> rank numbers that represent ranks <br><br> Returns:<br> error error message on failure otherwise nil <br><br> Example:<br> <source lang="lua">Guild.allowlogviewers{Guild.RankCommander, Guild.RankCouncil}</source> allow commander and councilmembers to view the log <br><br>


allowwithdrawalers

Definition:<br> allowwithdrawalers{int rank, ..} -> string error <br><br> Description: <br> Control who can withdraw money from the bank (untested) <br><br> Arguments:<br> rank numbers that represent ranks <br><br> Returns:<br> error error message on failure otherwise nil <br><br> Example:<br> <source lang="lua">Guild.allowwithdrawalers{Guild.RankCommander, Guild.RankCouncil}</source> allow commander and councilmembers to withdraw money <br><br>


appoint

Definition:<br> appoint() -> ? <br><br> Description: <br> appoint a guildmember as lieutenant (untested) <br><br> Arguments:<br> <br><br> Returns:<br> <br><br> Example:<br> <br><br>


create

Definition:<br> create(string acronym, name) -> ? <br><br> Description: <br> create a guild <br><br> Arguments:<br> acronym guild acronym 4 chars or less<br> name name of the guild <br><br> Returns:<br> <br><br> Example:<br> <br><br>


decline

Definition:<br> create(string name) -> ? <br><br> Description: <br> decline an invitation to a guild(untested) <br><br> Arguments:<br> name name of player that invited you <br><br> Returns:<br> <br><br> Example:<br> <br><br>

deposit

Definition:<br> deposit(int amount, string reason) -> boolean valid <br><br> Description: <br> deposit money into the guild bank <br><br> Arguments:<br> amount how much to deposit, can be a number or a string in format accepted by tonumber function eg. '1000' or '1e3'<br> reason reason for deposit or nil <br><br> Returns:<br> valid - true if specified amount was in valid format, else otherwise. (does not depend on whether the operation succeded)<br> information whether money was withdrawn or not is posted to chat via CHAT_MSG_SERVER event. <br><br> Example:<br> <br><br>


expel

Definition:<br> expel(string name) -> ? <br><br> Description: <br> expel a guildmember(untested) <br><br> Arguments:<br> name name of player <br><br> Returns:<br> <br><br> Example:<br> <br><br>


getactivitylogpage

Definition:<br> getactivitylogpage(int page) -> string error <br><br> Description: <br> get activity log page. the function triggers the GUILD_ACTIVITY_LOG event and passes the page to the callback in the registered table. <br><br> Arguments:<br> page page index <br><br> Returns:<br> error error message or nil <br><br> Example:<br> obj = {} function obj:OnEvent(name, data) if print(data) end RegisterEvent(obj, "GUILD_ACTIVITY_LOG") Guild.getactivitylogpage(1) <br><br>



getbankbalance

Definition:<br> getbankbalance() -> ? <br><br> Description: <br> get bank balance(?) triggers GUILD_BALANCE_UPDATED event. with no data though <br><br> Arguments: <br><br> Returns:<br> <br><br> Example:<br> <br><br>


getbanklogpage

Definition:<br> getbanklogpage(int page) -> string error <br><br> Description: <br> get bank log page. the function triggers the GUILD_BANK_LOG event and passes the page to the callback in the registered table. <br><br> Arguments:<br> page page index <br><br> Returns:<br> error error message or nil <br><br> Example:<br> obj = {} function obj:OnEvent(name, data) if print(data) end RegisterEvent(obj, "GUILD_BANK_LOG") Guild.getbanklogpage(1) <br><br>

withdraw

Definition:<br> withdraw(int amount, string reason) -> boolean valid <br><br> Description:<br> Attempts to withdraw specified amount of money from guild bank.

<br> Arguments:<br> amount - amount of money to be withdrawn, can be a number or a string in format accepted by tonumber function eg. '1000' or '1e3'<br> reason <br><br> Returns:<br> valid - true if specified amount was in valid format, else otherwise. (does not depend on whether the operation succeded)<br> information whether money was withdrawn or not is posted to chat via CHAT_MSG_SERVER event. <br><br>


Constants

RankCommander

Value
4

RankCouncil

Value
2

RankCouncilLieutenant

Value
3

RankLieutenant

Value
1

RankMember

Value
0


"getbankprivileges": function: 0xa05f860 "invite": function: 0xa0f8c50 "join": function: 0xa10d650 "list": function: 0xa2e8c50 "motd": function: 0x9e471e0 "resign": function: 0x9ffd898 "setwithdrawallimit": function: 0xa2efab0 "vote": function: 0xa129b38 "RankName": table: 0x9fc6d58