Difference between revisions of "Guild"

From Vendetta Lua
Jump to: navigation, search
m (Reverted edits by Otutytaqo (Talk) to last version by ArielF)
 
Line 4: Line 4:
  
  
>== Functions ==
+
== Functions ==
  
 
=== allowdepositors ===
 
=== allowdepositors ===
'''Definition:'''<br>
+
'''Definition:'''<br>
allowdepositors{int rank, ..} -&gt; string error  
+
allowdepositors{int rank, ..} -> string error  
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:''' &lt;br&gt;
+
'''Description:''' <br>
 
Control who can deposit money into the bank (untested)
 
Control who can deposit money into the bank (untested)
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Arguments:'''&lt;br&gt;
+
'''Arguments:'''<br>
 
'''rank''' numbers that represent ranks
 
'''rank''' numbers that represent ranks
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Returns:'''&lt;br&gt;
+
'''Returns:'''<br>
 
'''error''' error message on failure otherwise nil
 
'''error''' error message on failure otherwise nil
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Example:'''&lt;br&gt;
+
'''Example:'''<br>
&lt;source lang=&quot;lua&quot;&gt;Guild.allowdepositors{Guild.RankCommander, Guild.RankCouncil}&lt;/source&gt;
+
<source lang="lua">Guild.allowdepositors{Guild.RankCommander, Guild.RankCouncil}</source>
 
allow commander and councilmembers to deposit
 
allow commander and councilmembers to deposit
&lt;br&gt;&lt;br&gt;
+
<br><br>
  
  
 
=== allowlogviewers ===
 
=== allowlogviewers ===
'''Definition:'''&lt;br&gt;
+
'''Definition:'''<br>
allowlogviewers{int rank, ..} -&gt; string error  
+
allowlogviewers{int rank, ..} -> string error  
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:''' &lt;br&gt;
+
'''Description:''' <br>
 
Control who can view the bank transaction log (untested)
 
Control who can view the bank transaction log (untested)
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Arguments:'''&lt;br&gt;
+
'''Arguments:'''<br>
 
'''rank''' numbers that represent ranks
 
'''rank''' numbers that represent ranks
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Returns:'''&lt;br&gt;
+
'''Returns:'''<br>
 
'''error''' error message on failure otherwise nil
 
'''error''' error message on failure otherwise nil
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Example:'''&lt;br&gt;
+
'''Example:'''<br>
&lt;source lang=&quot;lua&quot;&gt;Guild.allowlogviewers{Guild.RankCommander, Guild.RankCouncil}&lt;/source&gt;
+
<source lang="lua">Guild.allowlogviewers{Guild.RankCommander, Guild.RankCouncil}</source>
 
allow commander and councilmembers to view the log
 
allow commander and councilmembers to view the log
&lt;br&gt;&lt;br&gt;
+
<br><br>
  
  
  
 
=== allowwithdrawalers ===
 
=== allowwithdrawalers ===
'''Definition:'''&lt;br&gt;
+
'''Definition:'''<br>
allowwithdrawalers{int rank, ..} -&gt; string error  
+
allowwithdrawalers{int rank, ..} -> string error  
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:''' &lt;br&gt;
+
'''Description:''' <br>
 
Control who can withdraw money from the bank (untested)
 
Control who can withdraw money from the bank (untested)
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Arguments:'''&lt;br&gt;
+
'''Arguments:'''<br>
 
'''rank''' numbers that represent ranks
 
'''rank''' numbers that represent ranks
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Returns:'''&lt;br&gt;
+
'''Returns:'''<br>
 
'''error''' error message on failure otherwise nil
 
'''error''' error message on failure otherwise nil
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Example:'''&lt;br&gt;
+
'''Example:'''<br>
&lt;source lang=&quot;lua&quot;&gt;Guild.allowwithdrawalers{Guild.RankCommander, Guild.RankCouncil}&lt;/source&gt;
+
<source lang="lua">Guild.allowwithdrawalers{Guild.RankCommander, Guild.RankCouncil}</source>
 
allow commander and councilmembers to withdraw money
 
allow commander and councilmembers to withdraw money
&lt;br&gt;&lt;br&gt;
+
<br><br>
  
  
  
 
=== appoint ===
 
=== appoint ===
'''Definition:'''&lt;br&gt;
+
'''Definition:'''<br>
appoint() -&gt; ?  
+
appoint() -> ?  
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:''' &lt;br&gt;
+
'''Description:''' <br>
 
appoint a guildmember as lieutenant (untested)
 
appoint a guildmember as lieutenant (untested)
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Arguments:'''&lt;br&gt;
+
'''Arguments:'''<br>
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Returns:'''&lt;br&gt;
+
'''Returns:'''<br>
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Example:'''&lt;br&gt;
+
'''Example:'''<br>
&lt;br&gt;&lt;br&gt;
+
<br><br>
  
  
 
=== create ===
 
=== create ===
'''Definition:'''&lt;br&gt;
+
'''Definition:'''<br>
create(string acronym, name) -&gt; ?
+
create(string acronym, name) -> ?
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:''' &lt;br&gt;
+
'''Description:''' <br>
 
create a guild
 
create a guild
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Arguments:'''&lt;br&gt;
+
'''Arguments:'''<br>
'''acronym''' guild acronym 4 chars or less&lt;br&gt;
+
'''acronym''' guild acronym 4 chars or less<br>
 
'''name''' name of the guild
 
'''name''' name of the guild
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Returns:'''&lt;br&gt;
+
'''Returns:'''<br>
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Example:'''&lt;br&gt;
+
'''Example:'''<br>
&lt;br&gt;&lt;br&gt;
+
<br><br>
  
  
 
=== decline ===
 
=== decline ===
'''Definition:'''&lt;br&gt;
+
'''Definition:'''<br>
create(string name) -&gt; ?
+
create(string name) -> ?
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:''' &lt;br&gt;
+
'''Description:''' <br>
 
decline an invitation to a guild(untested)
 
decline an invitation to a guild(untested)
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Arguments:'''&lt;br&gt;
+
'''Arguments:'''<br>
 
'''name''' name of player that invited you
 
'''name''' name of player that invited you
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Returns:'''&lt;br&gt;
+
'''Returns:'''<br>
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Example:'''&lt;br&gt;
+
'''Example:'''<br>
&lt;br&gt;&lt;br&gt;
+
<br><br>
  
 
=== deposit ===
 
=== deposit ===
'''Definition:'''&lt;br&gt;
+
'''Definition:'''<br>
deposit(int amount, string reason) -&gt; boolean valid
+
deposit(int amount, string reason) -> boolean valid
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:''' &lt;br&gt;
+
'''Description:''' <br>
 
deposit money into the guild bank
 
deposit money into the guild bank
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Arguments:'''&lt;br&gt;
+
'''Arguments:'''<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;
+
'''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
 
'''reason''' reason for deposit or nil
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Returns:'''&lt;br&gt;
+
'''Returns:'''<br>
'''valid''' - true if specified amount was in valid format, else otherwise. (does not depend on whether the operation succeded)&lt;br&gt;
+
'''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.
 
information whether money was withdrawn or not is posted to chat via CHAT_MSG_SERVER event.
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Example:'''&lt;br&gt;
+
'''Example:'''<br>
&lt;br&gt;&lt;br&gt;
+
<br><br>
  
  
  
 
=== expel ===
 
=== expel ===
'''Definition:'''&lt;br&gt;
+
'''Definition:'''<br>
expel(string name) -&gt; ?
+
expel(string name) -> ?
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:''' &lt;br&gt;
+
'''Description:''' <br>
 
expel a guildmember(untested)
 
expel a guildmember(untested)
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Arguments:'''&lt;br&gt;
+
'''Arguments:'''<br>
 
'''name''' name of player
 
'''name''' name of player
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Returns:'''&lt;br&gt;
+
'''Returns:'''<br>
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Example:'''&lt;br&gt;
+
'''Example:'''<br>
&lt;br&gt;&lt;br&gt;
+
<br><br>
  
  
  
 
=== getactivitylogpage ===
 
=== getactivitylogpage ===
'''Definition:'''&lt;br&gt;
+
'''Definition:'''<br>
getactivitylogpage(int page) -&gt; string error
+
getactivitylogpage(int page) -> string error
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:''' &lt;br&gt;
+
'''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.
 
get activity log page. the function triggers the GUILD_ACTIVITY_LOG event and passes the page to the callback in the registered table.
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Arguments:'''&lt;br&gt;
+
'''Arguments:'''<br>
 
'''page''' page index
 
'''page''' page index
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Returns:'''&lt;br&gt;
+
'''Returns:'''<br>
 
'''error''' error message or nil
 
'''error''' error message or nil
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Example:'''&lt;br&gt;
+
'''Example:'''<br>
obj = {} function obj:OnEvent(name, data) if print(data) end RegisterEvent(obj, &quot;GUILD_ACTIVITY_LOG&quot;) Guild.getactivitylogpage(1)
+
obj = {} function obj:OnEvent(name, data) if print(data) end RegisterEvent(obj, "GUILD_ACTIVITY_LOG") Guild.getactivitylogpage(1)
&lt;br&gt;&lt;br&gt;
+
<br><br>
  
  
Line 170: Line 170:
  
 
=== getbankbalance ===
 
=== getbankbalance ===
'''Definition:'''&lt;br&gt;
+
'''Definition:'''<br>
getbankbalance() -&gt; ?
+
getbankbalance() -> ?
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:''' &lt;br&gt;
+
'''Description:''' <br>
 
get bank balance(?) triggers GUILD_BALANCE_UPDATED event. with no data though
 
get bank balance(?) triggers GUILD_BALANCE_UPDATED event. with no data though
&lt;br&gt;&lt;br&gt;
+
<br><br>
 
'''Arguments:'''
 
'''Arguments:'''
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Returns:'''&lt;br&gt;
+
'''Returns:'''<br>
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Example:'''&lt;br&gt;
+
'''Example:'''<br>
&lt;br&gt;&lt;br&gt;
+
<br><br>
  
  
 
=== getbanklogpage ===
 
=== getbanklogpage ===
'''Definition:'''&lt;br&gt;
+
'''Definition:'''<br>
getbanklogpage(int page) -&gt; string error
+
getbanklogpage(int page) -> string error
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:''' &lt;br&gt;
+
'''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.
 
get bank log page. the function triggers the GUILD_BANK_LOG event and passes the page to the callback in the registered table.
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Arguments:'''&lt;br&gt;
+
'''Arguments:'''<br>
 
'''page''' page index
 
'''page''' page index
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Returns:'''&lt;br&gt;
+
'''Returns:'''<br>
 
'''error''' error message or nil
 
'''error''' error message or nil
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Example:'''&lt;br&gt;
+
'''Example:'''<br>
obj = {} function obj:OnEvent(name, data) if print(data) end RegisterEvent(obj, &quot;GUILD_BANK_LOG&quot;) Guild.getbanklogpage(1)
+
obj = {} function obj:OnEvent(name, data) if print(data) end RegisterEvent(obj, "GUILD_BANK_LOG") Guild.getbanklogpage(1)
&lt;br&gt;&lt;br&gt;
+
<br><br>
  
 
=== withdraw ===
 
=== withdraw ===
'''Definition:'''&lt;br&gt;
+
'''Definition:'''<br>
withdraw(int amount, string reason) -&gt; boolean valid
+
withdraw(int amount, string reason) -> boolean valid
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:'''&lt;br&gt;
+
'''Description:'''<br>
 
Attempts to withdraw specified amount of money from guild bank.
 
Attempts to withdraw specified amount of money from guild bank.
  
&lt;br&gt;
+
<br>
'''Arguments:'''&lt;br&gt;
+
'''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'&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>
 
'''reason'''
 
'''reason'''
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Returns:'''&lt;br&gt;
+
'''Returns:'''<br>
'''valid''' - true if specified amount was in valid format, else otherwise. (does not depend on whether the operation succeded)&lt;br&gt;
+
'''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.
 
information whether money was withdrawn or not is posted to chat via CHAT_MSG_SERVER  event.
&lt;br&gt;&lt;br&gt;
+
<br><br>
 
+
----
+
<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 ==

Latest revision as of 18:54, 20 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:
allowdepositors{int rank, ..} -> string error

Description:
Control who can deposit money into the bank (untested)

Arguments:
rank numbers that represent ranks

Returns:
error error message on failure otherwise nil

Example:

Guild.allowdepositors{Guild.RankCommander, Guild.RankCouncil}

allow commander and councilmembers to deposit


allowlogviewers

Definition:
allowlogviewers{int rank, ..} -> string error

Description:
Control who can view the bank transaction log (untested)

Arguments:
rank numbers that represent ranks

Returns:
error error message on failure otherwise nil

Example:

Guild.allowlogviewers{Guild.RankCommander, Guild.RankCouncil}

allow commander and councilmembers to view the log


allowwithdrawalers

Definition:
allowwithdrawalers{int rank, ..} -> string error

Description:
Control who can withdraw money from the bank (untested)

Arguments:
rank numbers that represent ranks

Returns:
error error message on failure otherwise nil

Example:

Guild.allowwithdrawalers{Guild.RankCommander, Guild.RankCouncil}

allow commander and councilmembers to withdraw money


appoint

Definition:
appoint() -> ?

Description:
appoint a guildmember as lieutenant (untested)

Arguments:


Returns:


Example:



create

Definition:
create(string acronym, name) -> ?

Description:
create a guild

Arguments:
acronym guild acronym 4 chars or less
name name of the guild

Returns:


Example:



decline

Definition:
create(string name) -> ?

Description:
decline an invitation to a guild(untested)

Arguments:
name name of player that invited you

Returns:


Example:


deposit

Definition:
deposit(int amount, string reason) -> boolean valid

Description:
deposit money into the guild bank

Arguments:
amount how much to deposit, can be a number or a string in format accepted by tonumber function eg. '1000' or '1e3'
reason reason for deposit or nil

Returns:
valid - true if specified amount was in valid format, else otherwise. (does not depend on whether the operation succeded)
information whether money was withdrawn or not is posted to chat via CHAT_MSG_SERVER event.

Example:



expel

Definition:
expel(string name) -> ?

Description:
expel a guildmember(untested)

Arguments:
name name of player

Returns:


Example:



getactivitylogpage

Definition:
getactivitylogpage(int page) -> string error

Description:
get activity log page. the function triggers the GUILD_ACTIVITY_LOG event and passes the page to the callback in the registered table.

Arguments:
page page index

Returns:
error error message or nil

Example:
obj = {} function obj:OnEvent(name, data) if print(data) end RegisterEvent(obj, "GUILD_ACTIVITY_LOG") Guild.getactivitylogpage(1)



getbankbalance

Definition:
getbankbalance() -> ?

Description:
get bank balance(?) triggers GUILD_BALANCE_UPDATED event. with no data though

Arguments:

Returns:


Example:



getbanklogpage

Definition:
getbanklogpage(int page) -> string error

Description:
get bank log page. the function triggers the GUILD_BANK_LOG event and passes the page to the callback in the registered table.

Arguments:
page page index

Returns:
error error message or nil

Example:
obj = {} function obj:OnEvent(name, data) if print(data) end RegisterEvent(obj, "GUILD_BANK_LOG") Guild.getbanklogpage(1)

withdraw

Definition:
withdraw(int amount, string reason) -> boolean valid

Description:
Attempts to withdraw specified amount of money from guild bank.


Arguments:
amount - amount of money to be withdrawn, can be a number or a string in format accepted by tonumber function eg. '1000' or '1e3'
reason

Returns:
valid - true if specified amount was in valid format, else otherwise. (does not depend on whether the operation succeded)
information whether money was withdrawn or not is posted to chat via CHAT_MSG_SERVER event.

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