Guild: Difference between revisions

From Vendetta Lua
Jump to navigationJump to search
No edit summary
m Reverted edits by Otutytaqo (Talk) to last version by ArielF
 
(7 intermediate revisions by 4 users not shown)
Line 114: Line 114:
=== deposit ===
=== deposit ===
'''Definition:'''<br>
'''Definition:'''<br>
deposit(int amount, string reason) -> string error
deposit(int amount, string reason) -> boolean valid
<br><br>
<br><br>
'''Description:''' <br>
'''Description:''' <br>
Line 120: Line 120:
<br><br>
<br><br>
'''Arguments:'''<br>
'''Arguments:'''<br>
'''amount''' how much to deposit<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
'''reason''' reason for deposit or nil
<br><br>
<br><br>
'''Returns:'''<br>
'''Returns:'''<br>
'''error''' error messsage or nil
'''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>
<br><br>
'''Example:'''<br>
'''Example:'''<br>
Line 150: Line 151:
=== getactivitylogpage ===
=== getactivitylogpage ===
'''Definition:'''<br>
'''Definition:'''<br>
getactivitylogpage(int page) -> ?
getactivitylogpage(int page) -> string error
<br><br>
<br><br>
'''Description:''' <br>
'''Description:''' <br>
get activity log page (untested)
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>
<br><br>
'''Arguments:'''<br>
'''Arguments:'''<br>
'''page''' page index from og (?)
'''page''' page index
<br><br>
<br><br>
'''Returns:'''<br>
'''Returns:'''<br>
'''error''' error message or nil
<br><br>
<br><br>
'''Example:'''<br>
'''Example:'''<br>
obj = {} function obj:OnEvent(name, data) if print(data) end RegisterEvent(obj, "GUILD_ACTIVITY_LOG") Guild.getactivitylogpage(1)
<br><br>
<br><br>


Line 180: Line 183:
<br><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 ==
== Constants ==


=== RankCommander ===
=== RankCommander ===
'''Value:''' 4
'''Value'''<br>
4
<br>
<br>


=== RankCouncil ===
=== RankCouncil ===
'''Value:''' 2
'''Value'''<br>
2
<br>
<br>


=== RankCouncilLieutenant ===
=== RankCouncilLieutenant ===
'''Value:''' 3
'''Value'''<br>
3
<br>
<br>


=== RankLieutenant ===
=== RankLieutenant ===
'''Value:''' 1
'''Value'''<br>
1
<br>
<br>


=== RankMember ===
=== RankMember ===
'''Value:''' 0
'''Value'''<br>
0
<br>
<br>




"getbanklogpage": function: 0xa0c3728
"getbankprivileges": function: 0xa05f860
"getbankprivileges": function: 0xa05f860
"invite": function: 0xa0f8c50
"invite": function: 0xa0f8c50
Line 213: Line 254:
"setwithdrawallimit": function: 0xa2efab0
"setwithdrawallimit": function: 0xa2efab0
"vote": function: 0xa129b38
"vote": function: 0xa129b38
"withdraw": function: 0xa08b398
"RankName": table: 0x9fc6d58
"RankName": table: 0x9fc6d58
[[Category:Tables]]

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:
<source lang="lua">Guild.allowdepositors{Guild.RankCommander, Guild.RankCouncil}</source> 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:
<source lang="lua">Guild.allowlogviewers{Guild.RankCommander, Guild.RankCouncil}</source> 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:
<source lang="lua">Guild.allowwithdrawalers{Guild.RankCommander, Guild.RankCouncil}</source> 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