====== 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 [[luaapi:user_table|user table]]s without operator status.| |Core.GetOnlineNonOps(bAllData) | Return table with all logged [[luaapi:user_table|user table]]s without operator status. Use true for bAllData if you want [[luaapi:user_table|user table]]s with all data.| |Core.GetOnlineOps() | Return table with all logged [[luaapi:user_table|user table]]s with operator status.| |Core.GetOnlineOps(bAllData) | Return table with all logged [[luaapi:user_table|user table]]s with operator status. Use true for bAllData if you want [[luaapi:user_table|user table]]s with all data.| |Core.GetOnlineRegs() | Return table with all logged and registered (profile > -1) [[luaapi:user_table|user table]]s.| |Core.GetOnlineRegs(bAllData) | Return table with all logged and registered (profile > -1) [[luaapi:user_table|user table]]s. Use true for bAllData if you want [[luaapi:user_table|user table]]s with all data.| |Core.GetOnlineUsers() | Return table with all logged [[luaapi:user_table|user table]]s.| |Core.GetOnlineUsers(bAllData) | Return table with all logged [[luaapi:user_table|user table]]s. Use true for bAllData if you want [[luaapi:user_table|user table]]s 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 [[luaapi:user_table|user table]]s with all data.| |Core.GetUser(sNick) | Return online user of given nick as [[luaapi:user_table|user table]] or nil when user not exist.| |Core.GetUser(sNick, bAllData) | Return online user of given nick as [[luaapi:user_table|user table]] or nil when user not exist. Use true for bAllData if you want [[luaapi:user_table|user table]] with all data.| |Core.GetUserAllData([[luaapi:user_table|tUser]]) | Add or update all user data in [[luaapi:user_table|user table]]. Return nil when failed (user is not online) or true when sucess.| |Core.GetUserData([[luaapi:user_table|tUser]], [[luaapi:user_data_ids|iValueId]]) | Add or update value of given id in [[luaapi:user_table|user table]]. Return nil when failed (user is not online) or true when sucess.| |Core.GetUserValue([[luaapi:user_table|tUser]], [[luaapi:user_data_ids|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 [[luaapi:user_table|user table]]s 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 [[luaapi:user_table|user table]]s or nil when no user with that IP is found or invalid IP is given. Use true for bAllData if you want [[luaapi:user_table|user table]] with all data.| | | | |Core.Disconnect(sNick) | Disconnect user with given nick. Return nil when failed, true when success.| |Core.Disconnect([[luaapi:user_table|tUser]]) | Disconnect user. Return nil when failed, true when success.| | | | |Core.Kick([[luaapi:user_table|tUser]], sKickerNick, sReason) | Kick user. Max KickerNick length 64 chars, max Reason length 128000 chars. Return nil when failed, true when success.| |Core.Redirect([[luaapi:user_table|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([[luaapi:user_table|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([[luaapi:user_table|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([[luaapi:user_table|tUser]], sFromNick, sData) | Send private message to user. Max FromNick length 64 chars, max Data length 128000 chars.| | | | |Core.SetUserInfo([[luaapi:user_table|tUser]], [[luaapi:user_info_ids|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.|