Silent Lua
silEnT servers support Lua 5.1.4 scripts. Starting from version 0.5.1 the Lua interpreter is inbuilt into the server side mod. Before the vesion 0.5.1, the Lua was installed as an external module. A separate build of the silEnT mod is supplied within the download to admins who still want to use separate Lua library. silEnT's Lua API is aiming to be fully compatible to ETPro's Lua API. The origin of the silEnT Lua API is the Lua module in ETPub version 0.9.1.
Cvars
lua_modules
Description:
List of files to be loaded by the Lua API engine. Can be separated by space, comma or semicolon. The paths are relative to the mod's directory, and can optionally be placed inside pk3 archieves. We are aiming for compatibility with ETPro's Lua Mod API found at http://wolfwiki.anime.net/index.php/Lua_Mod_API.
Type: string
Default: ""
lua_allowedModules
Description:
List of sha1 signatures for the lua modules to be loaded by the Lua API engine. Can be separated by space, comma or semicolon. Only lua modules with the matching sha1 signature listed in this cvar will be allowed to load by the Lua API engine (ACL).
Type: string
Default: ""
Commands
lua_status
Shows information about the scripts currently loaded by the Lua API server engine. This command works also from the client so that players can check what modules are currently loaded by the server.
Library Calls
Modules
RegisterModname
Description:
Registers a descriptive name for this Lua mod.
Syntax:
et.RegisterModname( modname )
- modname is a string
Support:
Function is ETPro compatible.
FindSelf
Description:
Returns a number indicating the VM slot the current mod is loaded into.
Syntax:
vmnumber = et.FindSelf()
Support:
Function is ETPro compatible.
FindMod
Description
Returns the name and the SHA-1 signature of the mod loaded in the VM slot. Returns (nil, nil) if the VM slot is not valid.
Syntax:
modname, signature = et.FindMod( vmnumber )
Support:
Function is ETPro compatible.
IPCSend
Description
Inter Process Communication. This function enables communication between different loaded Lua modules.
Syntax:
success = et.IPCSend( vmnumber, message )
- vmnumber is the number of the loaded module message is sent
- message is a string
- return value success is always 1
Support:
Function is not completely ETPro compatible. The return value in ETPub and in silEnT does not have a meaning. ETPro returns 1 for success and 0 for failure.
Printing
G_Print
Description
Prints text to the server console.
Syntax:
et.G_Print( text )
- text is a string
Support:
Function is ETPro compatible.
G_LogPrint
Argument Handling
ConcatArgs
trap_Argc
trap_Argv
Cvars
trap_Cvar_Get
trap_Cvar_Set
Configstrings
trap_GetConfigstring
trap_SetConfigstring
Server Console and Client Handling
trap_SendConsoleCommand
trap_DropClient
trap_SendServerCommand
ClientNumberFromString
G_Say
ClientUserinfoChanged
trap_GetUserinfo
trap_SetUserinfo
G_Damage
ClientIsFlooding
G_AddSkillPoints
G_LoseSkillPoints
String Utility Functions
Info_RemoveKey
Info_SetValueForKey
Info_ValueForKey
Q_CleanStr
Filesystem
trap_FS_FOpenFile
trap_FS_Read
trap_FS_Write
trap_FS_Rename
trap_FS_FCloseFile
Sounds and Models
G_SoundIndex
G_ModelIndex
G_globalSound
G_Sound
G_ClientSound
Entities
G_Spawn
G_TempEntity
G_FreeEntity
G_EntitiesFree
G_GetSpawnVar
G_SetSpawnVar
trap_LinkEntity
trap_UnlinkEntity
gentity_get
gentity_set
G_AddEvent
Shrubbot
G_shrubbot_permission
G_shrubbot_level
Time
trap_Milliseconds
Callbacks
et_InitGame
et_ShutdownGame
et_RunFrame
et_ClientConnect
et_ClientDisconnect
et_ClientBegin
et_ClientUserinfoChanged
et_ClientSpawn
et_ClientCommand
et_ConsoleCommand
et_UpgradeSkill
et_SetPlayerSkill
et_Print
et_Obituary
References
- Document was constructed using information at http://wolfwiki.anime.net/index.php/ETPro:Lua_Mod_API as well as reading the mod source.
- Official Lua http://www.lua.org/