Function Index: Difference between revisions

From Vendetta Lua
Jump to navigationJump to search
No edit summary
No edit summary
Line 336: Line 336:
=== ForEachBuddy ===
=== ForEachBuddy ===
'''Definition:'''<br>
'''Definition:'''<br>
ForEachBuddy(function )
ForEachBuddy(function func(string name, bool isonline, int pos)) -> nil
<br><br>
<br><br>
'''Description:'''
'''Description:'''<br>
calls '''func''' with the name, if the player is online for each of your buddies as well as his position if the player is currently online
<br><br>
'''Arguments:'''<br>
'''func''' gets called for each buddy<br>
'''name''' name of the buddy<br>
'''isonline''' true if the player is online else false<br>
'''pos''' id of sector in which the player is located
<br><br>
'''Returns:'''
<br><br>
'''Example:'''<br>
ForEachBuddy(function (name, isonline, pos) print(name .." "..tostring(isonline).." "..tostring(pos)) end)<br>
prints a list with your buddies and their status
<br><br>
 
=== ForEachPlayer ===
'''Definition:'''<br>
ForEachPlayer(function func(int charid)) -> nil
<br><br>
'''Description:'''<br>
calls '''func''' with the character id of each player in the sector. that includes bots and the sector thingy itself
<br><br>
'''Arguments:'''<br>
'''func''' gets called for each buddy<br>
'''ncharid''' character id <br>
<br><br>
'''Returns:'''
<br><br>
'''Example:'''<br>
ForEachPlayer(function (id) print(id) end)<br>
prints a list with all players in the sector
<br><br>
 
 
=== GetAccomplishmentLevels ===
'''Definition:'''<br>
GetAccomplishmentLevels(int accomid) -> int curlevel int reqlevel
<br><br>
'''Description:'''<br>
returns the current and the required level for the selected accomplishment
<br><br>
'''Arguments:'''<br>
'''accomid''' id of the accomplishment
<br><br>
'''Returns:'''<br>
'''curlevel''' current level of the accomplishment<br>
'''reqlevel''' what is required to get the accomplishment<br>
<br><br>
'''Example:'''
GetAccomplishmentLevels(9) -> 34 50<br>
assuming 9 is busskills this player has 34 kills of the 500 required
<br><br>
 
 
=== GetAccomplishmentType ===
'''Definition:'''<br>
GetAccomplishmentType(int accomid) -> int ret1 int ret2
<br><br>
'''Description:'''<br>
returns some numbers..
<br><br>
'''Arguments:'''<br>
'''accomid''' id of the accomplishment
<br><br>
'''Returns:'''<br>
'''ret1''' same as '''accomid'''?<br>
'''ret2''' some number. possibly if it's of the combat/economic class<br>
<br><br>
'''Example:'''
<br><br>
 
 
=== GetActiveChatChannel ===
'''Definition:'''<br>
GetActiveChatChannel() -> int channel
<br><br>
'''Description:'''<br>
returns the active channel
<br><br>
<br><br>
'''Arguments:'''
'''Arguments:'''
<br><br>
<br><br>
'''Returns:'''
'''Returns:'''<br>
'''channel''' active chat channel<br>
<br><br>
<br><br>
'''Example:'''
'''Example:'''
GetActiveChatChannel() -> 1<br>
you are currently in channel 1
<br><br>
<br><br>
"GetStationSellableInventoryInfoByID"<br>
"GetStationSellableInventoryInfoByID"<br>
"GetStationShipList"<br>
"GetStationShipList"<br>

Revision as of 04:43, 28 June 2007

Functions

AbortMission

Definition:
AbortMission() -> ??

Description:
Abort the currently running mission.

Arguments:

Returns:

Example:

Article

Definition:
Article(string word) -> string ret1

Description:
prepends the appropriate article to the string word

Arguments:
word string to prepend an article to.

Returns:
ret1 the string with an article prepended.

Example:
Article("apple") -> "an apple"

CanUseAddon

Definition:
CanUseAddon(string itemid) -> bool ret1 table ret2

Description:
check if the player can equip the addon itemid

Arguments:
itemid itemid of addon to check

Returns:
ret1 true or false depending on equipability
ret1 license requirements of the item at the current station (only returned for local addons and if the player is docked with the station)

Example:
CanUseAddon(12345) -> true {1, 2, 2, 2, 2}

CanUseMerchandise

Definition:

Description:

Arguments:

Returns:

Example:

CancelPurchaseShipLayout

Definition:

Description:

Arguments:

Returns:

Example:

ClearGeneralChatLog

Definition:

Description:
doesn't seem to do anything ...

Arguments:

Returns:

Example:

ClearLastShipLoadout

Definition:
ClearLastShipLoadout() -> nil

Description:
prevents client from asking to rebuy ship after destruction

Arguments:

Returns:

Example:

ClearMissionChatLog

Definition:

Description:

Arguments:

Returns:

Example:

ClearProximityCache

Definition:

Description:
I guess it clears the proximity cache?

Arguments:

Returns:

Example:

ClearStationChatLog

Definition:

Description:
does nothing...

Arguments:

Returns:

Example:

ConfigureMultipleWeaponGroups

Definition: ConfigureMultipleWeaponGroups{table group1key1, table group1key2 ... table group1key6, table group2key1, table group2key2...}

Description:
configures weapon groups according to given tables

Arguments:
group*key* each table seems to represent one group key to which a group of ports can be assigned. Members of the tables contain boolean values where each index represents a port. the first index seems to switch the whole group on or off depending on its value. that kind of works for the first table at least ..

Returns:

Example: ConfigureMultipleWeaponGroups


ConfigureWeaponGroup

Definition:

Description:

Arguments:

Returns:

Example:


ConnectAddon

Definition:
ConnectAddon(int portid, int itemid) -> bool ret1

Description:
Attaches the addon itemid to the active ship in port portid

Arguments:
portid portid of the the port
1 = battery
2-n = s-ports
n+1-m = l-ports
itemid itemid of the addon

Returns:
ret1 returns true if the player is docked and has an active ship otherwise nil

Example:
ConnectAddon(2, 123) -> true
put the addon 123 into port 2 while the player is docked to a station


CreateCharacter

Definition:
CreateCharacter(int name, int nation) -> nil

Description:
Creates the character of the given nation

Arguments:
name name of character
nation nation of character

Returns:

Example:

DeleteCharacter

Definition:
DeleteCharacter(int slot) -> nil

Description:
Deletes the character in the character slot slot

Arguments:
slot which character to delete

Returns:

Example:


DisableProximityWarning

Definition:
DisableProximityWarning() -> nil

Description:
disable the proximity warning ...

Arguments:

Returns:

Example:

DisconnectAddon

Definition:
DisconnectAddon(int itemid) -> bool ret1

Description:
detaches the addon itemid and stores it in the station
Note: detached items will likely have a different itemid in the station

Arguments:
itemid id of the item to detach

Returns:
ret1 returns true if the player is docked and has an active ship otherwise nil

Example:
DisconnectAddon(123) -> true remove the item 123 from the active ship while the player is docked to a station


DisconnectAllAddons

Definition: DisconnectAllAddons() -> nil

Description:
Detach all addons from the active ship and store them in the current station

Arguments:

Returns:

Example:


EnableProximityWarning

Definition:
DisableProximityWarning() -> nil

Description:
enable the proximity warning ...

Arguments:

Returns:

Example:


FindAndReplaceTags

Definition:
FindAndReplaceTags(string text, table matches) -> string ret1

Description:
Replaces all occurances of with < and > enclosed substrings in text with matching values form the given table

Arguments:
test string to replace tags in
matches table tags/replacement pairs

Returns:
ret1: converted text

Example:
FindAndReplaceTags("hi this is a <br> linebreak", {br="\n"})
-> "hi this is a
linebreak"


FindAndReplaceTagsCB

Definition:

Description:

Arguments:

Returns:

Example:


FindMissionByID

Definition:

Description:

Arguments:

Returns:

Example:


ForEachBuddy

Definition:
ForEachBuddy(function func(string name, bool isonline, int pos)) -> nil

Description:
calls func with the name, if the player is online for each of your buddies as well as his position if the player is currently online

Arguments:
func gets called for each buddy
name name of the buddy
isonline true if the player is online else false
pos id of sector in which the player is located

Returns:

Example:
ForEachBuddy(function (name, isonline, pos) print(name .." "..tostring(isonline).." "..tostring(pos)) end)
prints a list with your buddies and their status

ForEachPlayer

Definition:
ForEachPlayer(function func(int charid)) -> nil

Description:
calls func with the character id of each player in the sector. that includes bots and the sector thingy itself

Arguments:
func gets called for each buddy
ncharid character id


Returns:

Example:
ForEachPlayer(function (id) print(id) end)
prints a list with all players in the sector


GetAccomplishmentLevels

Definition:
GetAccomplishmentLevels(int accomid) -> int curlevel int reqlevel

Description:
returns the current and the required level for the selected accomplishment

Arguments:
accomid id of the accomplishment

Returns:
curlevel current level of the accomplishment
reqlevel what is required to get the accomplishment


Example: GetAccomplishmentLevels(9) -> 34 50
assuming 9 is busskills this player has 34 kills of the 500 required


GetAccomplishmentType

Definition:
GetAccomplishmentType(int accomid) -> int ret1 int ret2

Description:
returns some numbers..

Arguments:
accomid id of the accomplishment

Returns:
ret1 same as accomid?
ret2 some number. possibly if it's of the combat/economic class


Example:


GetActiveChatChannel

Definition:
GetActiveChatChannel() -> int channel

Description:
returns the active channel

Arguments:

Returns:
channel active chat channel


Example: GetActiveChatChannel() -> 1
you are currently in channel 1


"GetStationSellableInventoryInfoByID"
"GetStationShipList"
"GetStationTurretInfo"
"GetStorageLocationSector"
"GetSurveyChoices"
"GetSurveyQuestion"
"GetSystemID"
"GetTargetDistance"
"GetTargetFriendlyStatus"
"GetTargetInfo"
"GetTip"
"GiveMoney"
"HasLastShipLoadout"

IsConnected()

Returns: wheater you are connected to the game

"IsEnemy"
"IsStormPresent"

JettisonAll()

Jettisons the cargo in your hold.

JettisonMultiple

JettisonMultiple{int itemid = int count; ...}

Same as JettisonSingle() but takes a table of itemid and count pairs as argument

JettisonSingle

JettisonSingle(int itemid, int count)

Jettisons count units of the cargo itemid

Script: jettison junk


"JoinChannel"
"LeaveChannel"
"ListChannels"
"LoadCargo"
"LoadChannels"
"LoadNavpath"
"Login"
"Logout"
"PlayerInStation"
"PlayerInventoryIterator"
"PrintJoinUsage"
"PrintLeaveUsage"
"ProcessEvent"
"PurchaseMerchandiseItem"
"PurchaseShipLoadout"
"RegisterEvent"
"ReloadInterface"
"ReplenishAll"
"ReplenishWeapon"
"RequestCharacterStats"
"RequestLaunch"
"RequestMissionDetails"
"RequestMissionList"
"RequestNewsArticle"
"RequestTargetStats"
"SaveChannels"
"SaveNavpath"
"SaveShipLoadout"
"SelectActiveShip"
"SelectCharacter"
"SellInventoryItem"
"SendChat"
"SendMissionQuestionResponse"
"SetCurrentChatTab"
"SetHomeStation"
"SetShipPurchaseColor"
"ShortLocationStr"
"SubmitSurvey"
"TabCompleteName"
"UnloadCargo"
"UnloadSellCargo"
"UnregisterEvent"
"clearscene"
"debugprint"
"ipairs"
"loadscene"
"log_print"
"next"
"pairs"
"spickle"
"tonumber"
"tostring"
"type"
"unpack"
"unspickle"

Variables

"CLASSTYPE_ADDON": 2
"CLASSTYPE_FLAG": 3
"CLASSTYPE_GENERIC": 0
"CLASSTYPE_MISSION": 5
"CLASSTYPE_SHIP": 1
"CLASSTYPE_STORAGE": 4
"VO_VERSION": 3
"Platform": "Unix"

Tables

"Buddy"
"Duel"
"FactionName"
"FactionNameFull"
"FactionStanding"
"Game"
"Guild"
"Ignore"
"InvManager"
"Mentor"
"NavRoute"
"Skills"
"Timer"
"Vote"
"coroutine"
"gkini"
"gkinterface"
"gkmisc"
"gvector"
"iup"
"joystick"
"math"
"math3d"
"quaternion"
"radar"
"string"
"table"