PtokaX wiki

Hub (server) for Direct Connect

User Tools

Site Tools


Sidebar


luaapi:px_core

Core table functions

Function Description
Core.Version Return PtokaX version.
Core.BuildNumber Return PtokaX build number.
Core.Restart() Restart hub.
Core.Shutdown() Shutdown hub.
Core.ResumeAccepts() Resume listening thread(s) if they were suspended.
Core.SuspendAccepts() Stop listening thread(s). Hub looks in this time like it is not running.
Core.SuspendAccepts(iTime) Stop listening thread(s) for given time in seconds. Hub looks in this time like it is not running.
Core.RegBot(sBotName, sDescription, sEmail, bHaveKey) Chars $| and space not allowed in nick. $| not allowed in Description and Email, max length 64 chars per string. Return nil when failed, true when success.
Core.UnregBot(sBotName) Return nil when failed, true when success.
Core.GetBots() Return table with all bots registered by scripts as tables with sNick, sMyINFO, bIsOP and sScriptName.
Core.GetActualUsersPeak() Return actual users peak.
Core.GetMaxUsersPeak() Return max users peak.
Core.GetCurrentSharedSize() Return total hub share size in bytes.
Core.GetHubIP() Return IP if is available, or nil when not.
Core.GetHubIPs() Return table with one or more IP addreses or nil when no address is available.
Core.GetHubSecAlias() Return actual Hub-Security alias.
Core.GetPtokaXPath() Return PtokaX path.
Core.GetUsersCount() Return hub users count.
Core.GetUpTime() Return hub uptime in seconds.
Core.GetOnlineNonOps() Return table with all logged user tables without operator status.
Core.GetOnlineNonOps(bAllData) Return table with all logged user tables without operator status. Use true for bAllData if you want user tables with all data.
Core.GetOnlineOps() Return table with all logged user tables with operator status.
Core.GetOnlineOps(bAllData) Return table with all logged user tables with operator status. Use true for bAllData if you want user tables with all data.
Core.GetOnlineRegs() Return table with all logged and registered (profile > -1) user tables.
Core.GetOnlineRegs(bAllData) Return table with all logged and registered (profile > -1) user tables. Use true for bAllData if you want user tables with all data.
Core.GetOnlineUsers() Return table with all logged user tables.
Core.GetOnlineUsers(bAllData) Return table with all logged user tables. Use true for bAllData if you want user tables with all data.
Core.GetOnlineUsers(iProfileNumber) Return table with users of given profile.
Core.GetOnlineUsers(iProfileNumber, bAllData) Return table with users of given profile. Use true for bAllData if you want user tables with all data.
Core.GetUser(sNick) Return online user of given nick as user table or nil when user not exist.
Core.GetUser(sNick, bAllData) Return online user of given nick as user table or nil when user not exist. Use true for bAllData if you want user table with all data.
Core.GetUserAllData(tUser) Add or update all user data in user table. Return nil when failed (user is not online) or true when sucess.
Core.GetUserData(tUser, iValueId) Add or update value of given id in user table. Return nil when failed (user is not online) or true when sucess.
Core.GetUserValue(tUser, iValueId) Return value of wanted iValueId or nil when failed (user is not online).
Core.GetUsers(sIP) Return online users from given ip as table with user tables or nil when no user with that IP is found or invalid IP is given.
Core.GetUsers(sIP, bAllData) Return online users from given ip as table with user tables or nil when no user with that IP is found or invalid IP is given. Use true for bAllData if you want user table with all data.
Core.Disconnect(sNick) Disconnect user with given nick. Return nil when failed, true when success.
Core.Disconnect(tUser) Disconnect user. Return nil when failed, true when success.
Core.Kick(tUser, sKickerNick, sReason) Kick user. Max KickerNick length 64 chars, max Reason length 128000 chars. Return nil when failed, true when success.
Core.Redirect(tUser, sAddress, sReason) Redirect user to given address with given reason. Max Address length 1024 chars. Max Reason length 128000 chars. Return nil when failed, true when success.
Core.DefloodWarn(tUser) Warn user on flood. Return nil when failed, true when success.
Core.SendToAll(sData) Send data to all users. Max sData length 128000 chars. When data don't contains | on end, will be automatically added.
Core.SendToNick(sNick, sData) Send data to user with given nick. Max sData length 128000 chars. When data don't contains | on end, will be automatically added.
Core.SendToOpChat(sData) Send data as private message in OpChat. Max sData length 128000 chars. If OpChat is not enabled then nothing is sent.
Core.SendToOps(sData) Send data to operators. Max sData length 128000 chars. When data don't contains | on end, will be automatically added.
Core.SendToProfile(iProfileNumber, sData) Send data to users with given profile. Max sData length 128000 chars. When data don't contains | on end, will be automatically added.
Core.SendToUser(tUser, sData) Send data to user. Max Data length 128000 chars. When data don't contains | on end, will be automatically added.
Core.SendPmToAll(sFromNick, sData) Send data as private message to all users. Max FromNick length 64 chars, max Data length 128000 chars.
Core.SendPmToNick(sToNick, sFromNick, sData) Send data as private message to user with given nick. Max FromNick length 64 chars, max Data length 128000 chars.
Core.SendPmToOps(sFromNick, sData) Send data to operators. Max FromNick length 64 chars, max Data length 128000 chars.
Core.SendPmToProfile(iProfileNumber, sFromNick, sData) Send data as private message to users with given profile. Max FromNick length 64 chars, max Data length 128000 chars.
Core.SendPmToUser(tUser, sFromNick, sData) Send private message to user. Max FromNick length 64 chars, max Data length 128000 chars.
Core.SetUserInfo(tUser, iValueId, nil/sValue/iValue, bPermanent) Set user info in MyINFO. Max sValue lenght 64 chars, $ and | is not allowed. Use bPermanent when you want to apply change permanently.
luaapi/px_core.txt · Last modified: 09/01/2016 16:14 by ppk