Difference between revisions of "Function Index"

From Vendetta Lua
Jump to: navigation, search
(Redirecting to API Index)
 
(124 intermediate revisions by 7 users not shown)
Line 1: Line 1:
== Functions ==
+
#REDIRECT [[API Index]]
 +
Page moved.
  
=== AbortMission ===
+
see [[API_Index]]
'''Definition:'''<br>
+
AbortMission() -> ??
+
<br><br>
+
'''Description:''' <br>
+
Abort the currently running mission.
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
=== Article ===
+
'''Definition:'''<br>
+
Article(string '''word''') -> string '''ret1'''
+
<br><br>
+
'''Description:'''<br>
+
prepends the appropriate article to the string '''word'''
+
<br><br>
+
'''Arguments:''' <br>
+
'''word''' string to prepend an article to.
+
<br><br>
+
'''Returns:''' <br>
+
'''ret1''' the string with an article prepended.
+
<br><br>
+
'''Example''':<br>
+
Article("apple") -> "an apple"<br>
+
<br>
+
 
+
=== CanUseAddon ===
+
'''Definition:''' <br>
+
CanUseAddon(string '''itemid''') -> bool '''ret1''' table '''ret2'''
+
<br><br>
+
'''Description:'''<br>
+
check if the player can equip the addon '''itemid'''
+
<br><br>
+
'''Arguments:'''<br>
+
'''itemid''' itemid of addon to check
+
<br><br>
+
'''Returns:'''<br>
+
'''ret1''' true or false depending on equipability<br>
+
'''ret1''' license requirements of the item at the current station (only returned for local addons and if the player is docked with the station)<br>
+
 
+
'''Example:'''<br>
+
CanUseAddon(12345) -> true {1, 2, 2, 2, 2}<br>
+
<br>
+
 
+
=== CanUseMerchandise ===
+
'''Definition:'''
+
<br><br>
+
'''Description:'''
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
=== CancelPurchaseShipLayout ===
+
'''Definition:'''
+
<br><br>
+
'''Description:'''
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
=== ClearGeneralChatLog ===
+
'''Definition:'''
+
<br><br>
+
'''Description:'''<br>
+
doesn't seem to do anything ...
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
=== ClearLastShipLoadout ===
+
'''Definition:'''<br>
+
ClearLastShipLoadout() -> nil
+
<br><br>
+
'''Description:''' <br>
+
prevents client from asking to rebuy ship after destruction
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
=== ClearMissionChatLog ===
+
'''Definition:'''
+
<br><br>
+
'''Description:'''
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
=== ClearProximityCache ===
+
'''Definition:'''
+
<br><br>
+
'''Description:'''<br>
+
I guess it clears the proximity cache?
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
=== ClearStationChatLog ===
+
'''Definition:'''
+
<br><br>
+
'''Description:'''<br>
+
does nothing...
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
=== ConfigureMultipleWeaponGroups ===
+
'''Definition:''' ConfigureMultipleWeaponGroups{table group1key1, table group1key2 ... table group1key6, table group2key1, table group2key2...}
+
<br><br>
+
'''Description:'''<br>
+
configures weapon groups according to given tables
+
<br><br>
+
'''Arguments:'''<br>
+
'''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 ..
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
ConfigureMultipleWeaponGroups
+
<br><br>
+
 
+
 
+
=== ConfigureWeaponGroup ===
+
'''Definition:'''
+
<br><br>
+
'''Description:'''
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
 
+
=== ConnectAddon ===
+
'''Definition:'''<br>
+
ConnectAddon(int portid, int itemid) -> bool ret1
+
<br><br>
+
'''Description:'''<br>
+
Attaches the addon '''itemid''' to the active ship in port '''portid'''
+
<br><br>
+
'''Arguments:'''<br>
+
'''portid''' portid of the the port<br>
+
1 = battery<br>
+
2-n = s-ports<br>
+
n+1-m = l-ports<br>
+
'''itemid''' itemid of the addon
+
<br><br>
+
'''Returns:'''<br>
+
'''ret1''' returns true if the player is docked and has an active ship otherwise nil
+
<br><br>
+
'''Example:'''<br>
+
ConnectAddon(2, 123) -> true<br>
+
put the addon 123 into port 2 while the player is docked to a station
+
<br><br>
+
 
+
 
+
=== CreateCharacter ===
+
'''Definition:'''<br>
+
CreateCharacter(int name, int nation) -> nil
+
<br><br>
+
'''Description:'''<br>
+
Creates the character of the given nation
+
<br><br>
+
'''Arguments:'''<br>
+
'''name''' name of character<br>
+
'''nation''' nation of character
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
=== DeleteCharacter ===
+
'''Definition:'''<br>
+
DeleteCharacter(int slot) -> nil
+
<br><br>
+
'''Description:'''<br>
+
Deletes the character in the character slot '''slot'''
+
<br><br>
+
'''Arguments:'''<br>
+
'''slot''' which character to delete
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
 
+
=== DisableProximityWarning ===
+
'''Definition:'''<br>
+
DisableProximityWarning() -> nil
+
<br><br>
+
'''Description:'''<br>
+
disable the proximity warning ...
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
=== DisconnectAddon ===
+
'''Definition:'''<br>
+
DisconnectAddon(int '''itemid''') -> bool ret1
+
<br><br>
+
'''Description:'''<br>
+
detaches the addon '''itemid''' and stores it in the station<br>
+
Note: detached items will likely have a different itemid in the station
+
<br><br>
+
'''Arguments:'''<br>
+
'''itemid''' id of the item to detach
+
<br><br>
+
'''Returns:'''<br>
+
'''ret1''' returns true if the player is docked and has an active ship otherwise nil
+
<br><br>
+
'''Example:'''<br>
+
DisconnectAddon(123) -> true
+
remove the item 123 from the active ship while the player is docked to a station
+
<br><br>
+
 
+
 
+
=== DisconnectAllAddons ===
+
'''Definition:'''
+
DisconnectAllAddons() -> nil
+
<br><br>
+
'''Description:'''<br>
+
Detach all addons from the active ship and store them in the current station
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
 
+
=== EnableProximityWarning ===
+
'''Definition:'''<br>
+
DisableProximityWarning() -> nil
+
<br><br>
+
'''Description:'''<br>
+
enable the proximity warning ...
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
 
+
=== FindAndReplaceTags ===
+
'''Definition:'''<br>
+
FindAndReplaceTags(string text, table matches) -> string ret1
+
<br><br>
+
'''Description:'''<br>
+
Replaces all occurances of with &lt; and &gt; enclosed substrings in '''text''' with matching values form the given table
+
<br><br>
+
'''Arguments:'''<br>
+
'''test''' string to replace tags in<br>
+
'''matches''' table tags/replacement pairs
+
<br><br>
+
'''Returns:'''<br>
+
'''ret1''': converted text
+
<br><br>
+
'''Example:'''<br>
+
FindAndReplaceTags("hi this is a &lt;br&gt; linebreak", {br="\n"})<br>
+
-> "hi this is a<br>
+
linebreak"
+
<br><br>
+
 
+
 
+
=== FindAndReplaceTagsCB ===
+
'''Definition:'''
+
<br><br>
+
'''Description:'''
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
 
+
=== FindMissionByID ===
+
'''Definition:'''
+
<br><br>
+
'''Description:'''
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
 
+
=== ForEachBuddy ===
+
'''Definition:'''<br>
+
ForEachBuddy(function func(string name, bool isonline, int pos)) -> nil
+
<br><br>
+
'''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>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''<br>
+
'''channel''' active chat channel
+
<br><br>
+
'''Example:'''
+
GetActiveChatChannel() -> 1<br>
+
you are currently in channel 1
+
<br><br>
+
 
+
=== GetActiveMissionInfo ===
+
'''Definition:'''<br>
+
GetActiveMissionInfo(int num) -> string mname table mmsg int itemid
+
<br><br>
+
'''Description:'''<br>
+
Get information about the selcted active mission
+
<br><br>
+
'''Arguments:'''<br>
+
'''num''' index of active mission (always 1)
+
<br><br>
+
'''Returns:'''<br>
+
'''mname''' string containing name of active mission<br>
+
'''mmsg''' array where each index contains a mission log entry + optional interface elements and their properties<br>
+
'''itemid''' itemid of the mission
+
<br><br>
+
'''Example:'''
+
GetActiveMissionInfo(1) -> "awesome mission" {1={"awesome mission question" 2={0="button" 1="awesome button text" action=1}}} 1234<br>
+
The active mission is called "awesome mission" and the first mission log entry contains the text "awesome mission question" with a button labaled "awesome button text" which triggers the action 1. item id for this mission is 1234
+
<br><br>
+
 
+
 
+
=== GetActiveShipCargoCount ===
+
'''Definition:'''<br>
+
GetActiveChatChannel() -> int cargocount
+
<br><br>
+
'''Description:'''<br>
+
returns amount of cargo in the ship
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''<br>
+
'''cargocount''' amount of cargo in the ship
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
=== GetActiveShipEnergy ===
+
'''Definition:'''<br>
+
GetActiveShipEnergy() -> float eng fraction
+
<br><br>
+
'''Description:'''<br>
+
returns the energy level of the active ship
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''<br>
+
'''eng''' energy level in game units 0-<battery capacacity>
+
'''fraction''' energy level as float from 0.0-1.0
+
<br><br>
+
'''Example:'''
+
GetActiveShipEnergy() -> 150.0 0.5<br>
+
the battery of this ship is half empty and has a capacity of 300
+
<br><br>
+
 
+
 
+
=== GetActiveShipHealth ===
+
'''Definition:'''<br>
+
GetActiveShipHealth() -> int d1 d2 d3 d4 d5 d6 dmg max
+
<br><br>
+
'''Description:'''<br>
+
returns information about the active ships health
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''<br>
+
'''d?''' damage to subsection 0 = no damage
+
'''dmg''' accumulated damage of subsections
+
'''max''' max health of ship
+
<br><br>
+
'''Example:'''
+
GetActiveShipHealth() -> 500 10 10 0 0 0 520 10000<br>
+
ship has 500 damagei n frontal region 520 dmg overall and a max health of 10000
+
<br><br>
+
 
+
 
+
 
+
=== GetActiveShipID ===
+
'''Definition:'''<br>
+
GetActiveShipID() -> int itemid
+
<br><br>
+
'''Description:'''<br>
+
returns itemid of active ship
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''<br>
+
'''itemid''' item id of active ship
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
 
+
=== GetActiveShipItemIDAtPort ===
+
'''Definition:'''<br>
+
GetActiveShipItemIDAtPort(int portid) -> int itemid
+
<br><br>
+
'''Description:'''<br>
+
returns itemid of addon in selected port
+
<br><br>
+
'''Arguments:'''<br>
+
'''portid''' id of port
+
<br><br>
+
'''Returns:'''<br>
+
'''itemid''' itemid of addon in port
+
<br><br>
+
'''Example:'''
+
GetActiveChatChannel(1) -> 1234<br>
+
addon in port 1 has itemid 1234
+
<br><br>
+
 
+
 
+
=== GetActiveShipMass ===
+
'''Definition:'''<br>
+
GetActiveShipMass() -> int mass
+
<br><br>
+
'''Description:'''<br>
+
returns mass of active ship
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''<br>
+
'''mass''' mass of active ship
+
<br><br>
+
'''Example:'''
+
GetActiveShipMAss() -> 15.0000<br>
+
ship weights 15000kg
+
<br><br>
+
 
+
 
+
=== GetActiveShipMaxCargo ===
+
'''Definition:'''<br>
+
GetActiveShipMaxCargo() -> int cargo
+
<br><br>
+
'''Description:'''<br>
+
returns amount of cargo space of the active ship in cu
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''<br>
+
'''cargo''' cargospace
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
 
+
=== GetActiveShipMaxSpeed ===
+
'''Definition:'''<br>
+
GetActiveShipMaxSpeed() -> int speed
+
<br><br>
+
'''Description:'''<br>
+
returns max nonturbo speed of active ship
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''<br>
+
'''speed''' ...
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
 
+
=== GetActiveShipName ===
+
'''Definition:'''<br>
+
GetActiveShipName() -> string name
+
<br><br>
+
'''Description:'''<br>
+
returns a string with the active ships name
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''<br>
+
'''name''' ...
+
<br><br>
+
'''Example:'''
+
<br><br>
+
 
+
 
+
=== GetActiveShipNumAddonPorts ===
+
'''Definition:'''<br>
+
GetActiveShipNumAddonPorts() -> int ports
+
<br><br>
+
'''Description:'''<br>
+
returns number of ports in active ship
+
<br><br>
+
'''Arguments:'''
+
<br><br>
+
'''Returns:'''<br>
+
'''ports''' number of ports, including engine and battery
+
<br><br>
+
'''Example:'''
+
GetActiveShipNumAddonPorts() -> 4
+
this ship has 3 ports
+
<br><br>
+
 
+
 
+
 
+
"GetStationSellableInventoryInfoByID"<br>
+
"GetStationShipList"<br>
+
"GetStationTurretInfo"<br>
+
"GetStorageLocationSector"<br>
+
"GetSurveyChoices"<br>
+
"GetSurveyQuestion"<br>
+
"GetSystemID"<br>
+
"GetTargetDistance"<br>
+
"GetTargetFriendlyStatus"<br>
+
"GetTargetInfo"<br>
+
"GetTip"<br>
+
"GiveMoney"<br>
+
"HasLastShipLoadout"<br>
+
=== IsConnected() ===
+
 
+
'''Returns:''' wheater you are connected to the game
+
 
+
"IsEnemy"<br>
+
"IsStormPresent"<br>
+
=== 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"<br>
+
"LeaveChannel"<br>
+
"ListChannels"<br>
+
"LoadCargo"<br>
+
"LoadChannels"<br>
+
"LoadNavpath"<br>
+
"Login"<br>
+
"Logout"<br>
+
"PlayerInStation"<br>
+
"PlayerInventoryIterator"<br>
+
"PrintJoinUsage"<br>
+
"PrintLeaveUsage"<br>
+
"ProcessEvent"<br>
+
"PurchaseMerchandiseItem"<br>
+
"PurchaseShipLoadout"<br>
+
"RegisterEvent"<br>
+
"ReloadInterface"<br>
+
"ReplenishAll"<br>
+
"ReplenishWeapon"<br>
+
"RequestCharacterStats"<br>
+
"RequestLaunch"<br>
+
"RequestMissionDetails"<br>
+
"RequestMissionList"<br>
+
"RequestNewsArticle"<br>
+
"RequestTargetStats"<br>
+
"SaveChannels"<br>
+
"SaveNavpath"<br>
+
"SaveShipLoadout"<br>
+
"SelectActiveShip"<br>
+
"SelectCharacter"<br>
+
"SellInventoryItem"<br>
+
"SendChat"<br>
+
"SendMissionQuestionResponse"<br>
+
"SetCurrentChatTab"<br>
+
"SetHomeStation"<br>
+
"SetShipPurchaseColor"<br>
+
"ShortLocationStr"<br>
+
"SubmitSurvey"<br>
+
"TabCompleteName"<br>
+
"UnloadCargo"<br>
+
"UnloadSellCargo"<br>
+
"UnregisterEvent"<br>
+
"clearscene"<br>
+
"debugprint"<br>
+
"ipairs"<br>
+
"loadscene"<br>
+
"log_print"<br>
+
"next"<br>
+
"pairs"<br>
+
"spickle"<br>
+
"tonumber"<br>
+
"tostring"<br>
+
"type"<br>
+
"unpack"<br>
+
"unspickle"<br>
+
 
+
== Variables ==
+
 
+
"CLASSTYPE_ADDON": 2 <br>
+
"CLASSTYPE_FLAG": 3<br>
+
"CLASSTYPE_GENERIC": 0<br>
+
"CLASSTYPE_MISSION": 5<br>
+
"CLASSTYPE_SHIP": 1<br>
+
"CLASSTYPE_STORAGE": 4<br>
+
"VO_VERSION": 3<br>
+
"Platform": "Unix"<br>
+
 
+
== Tables ==
+
 
+
"Buddy"<br>
+
"Duel"<br>
+
"FactionName"<br>
+
"FactionNameFull"<br>
+
"FactionStanding"<br>
+
"Game"<br>
+
"Guild"<br>
+
"Ignore"<br>
+
"InvManager"<br>
+
"Mentor"<br>
+
"NavRoute"<br>
+
"Skills"<br>
+
"Timer"<br>
+
"Vote"<br>
+
"coroutine"<br>
+
"gkini"<br>
+
"gkinterface"<br>
+
[["gkmisc"]]<br>
+
"gvector"<br>
+
[["iup"]]<br>
+
"joystick"<br>
+
"math"<br>
+
"math3d"<br>
+
"quaternion"<br>
+
"radar"<br>
+
"string"<br>
+
"table"<br>
+

Latest revision as of 17:05, 2 February 2008

Redirect to:

Page moved.

see API_Index