The User class represents a user connected to the hub.
Hex.User(iUserId) returns a new object of type User.
For more information about how to create an instance of this object read Hex.User(iUserId) section.
This function sends data to a user.
This function does not return a value.
Limitations:
You are prohibited from sending data containing: "$connecttome" or "$revconnecttome".
If your data contains either of the above strings then your request to send data will be silently ignored.
If you failed to terminate your data with a pipe then your request to send data will be ignored, but a warning issued in the console window.
This limitation is necessary to prevent a malicious hub owner/administrator to send out forged connection requests.
Requsts to remove this limitation will be denied.
Parameters:
-
sData = a string terminated with "|" (pipe).
This function disconnects the user.
It returns true on success, and false on failure.
This function returns the nickname of the user.
If the user was renamed, you can use User:GetClientNick() to obtain the login nickname (only clients not supporting NickChange).
This function returns the clients nickname of the user.
For a client not supporting NickChange, this is the nickname used to login with.
Is it recommended that you use this function rather than User:GetNick() if you use the nickname as a part of a command.
For example:
local str = "$To: "..User:GetClientNick().." From: "..BotNick.." $<"..BotNick.." > Hi there "..User:GetNick().."|"
The above example illustrates how to use User:GetNick() and User:GetClientNick() respectivly.
This function returns the network address (IP) of the user as a 32 bit number.
This function returns the network address (IP) of the user as a string in dotted notation.
This function returns the OP status code of the user.
Return values:
-
0 = Not operator (normal user)
-
1 = Public operator
-
2 = Hidden operator
This function changes the OP status of a user.
This function returns true on success, false on error.
Parameters:
-
iOpStatus = The OP status code to apply to this user.
OP status codes:
-
0 = Not operator (normal user)
-
1 = Public operator
-
2 = Hidden operator
This function returns the user identifier of the user represented by this object.
This function is intended to be used when iterating through the hubs nicklist.
This function returns the users account identifier, or 0 (zero) if the user is unregistered.
The account identifier can be used to initialize an Account class object (not available yet).
This function returns the users profile identifier, or -1 if the user is unregistered.
The profile idenrifier can be used to initialize the Profile class object.
This function returns the users hub language as a 2-letter language identifier.
This function changes users hub language.
This function returns true on success, and false on error.
Parameters:
-
sLanguage = a 2-letter language identifier (e.g. "EN", "RO", ect).
This function returns the name of the chat filter wich set on the user.
This function changes the users mode.
This function returns true on success, and false on error.
Parameters:
-
sMode = The name of the chat filter.
This function returns the users ISP name.
This function returns the users access level.
This function changes the users access level
This function does not return a value.
Parameters:
-
iAccess = The new access level. Valid range is 0-49999.
This function is used when iterating througt the hubs nicklist.
To use this function the User class object must be initialized with the value -1.
This function returns true on success, and false when there is no more users in the nicklist to iterate.
Snippet: Lua code sample: Iterating the nicklist
This function bans the users network address (IP), but does not disconnect the user.
This function returns true on success, and false on error.
If the ban type is not found in sReason then the ban will not be set.
Ban types (must be included in sReason parameter):
Parameters:
-
sReason = The reason why this user is being banned including ban type (e.g. "Dont spam this server _ban1_").
-
iTime = Time in seconds until the ban expires, or 0 (zero) for a permanent ban.
This function bans the users nickname, but does not disconnect the user.
This function returns true on success, and false on error.
If the ban type is not found in sReason then the ban will not be set.
Ban types (must be included in sReason parameter):
Parameters:
-
sReason = The reason why this user is being banned including ban type (e.g. "Dont spam this server _ban1_").
-
iTime = Time in seconds until the ban expires, or 0 (zero) for a permanent ban.
This function bans both the users network address (IP) and nickname, but does not disconnect the user.
This function returns true on success, and false on error.
If the ban type is not found in sReason then the ban will not be set.
Ban types (must be included in sReason parameter):
Parameters:
-
sReason = The reason why this user is being banned including ban type (e.g. "Dont spam this server _ban1_").
-
iTime = Time in seconds until the ban expires, or 0 (zero) for a permanent ban.
This function returns the full $MyINFO string of the user.
This function returns a myinfo string where restictions apply.
To get the myinfo string without restrictions use the User:GetFullMyINFO() function.
This function changes the users $MyINFO string, but it does not broadcast it.
Your myinfo string will be sent to new users though.
This function returns true on success, and false on error.
Parameters:
-
sMyINFO = A fully qualified myinfo string.
These functions returns a part of the myinfo string. The names of the functions indicate what field they return.
All the User:Get* functions return a string.
And all the User:Set* functions take a string as parameter, and returns a boolean to indicate success or failure.
true = success, false = failure.
None of these functions will cause the hub to broadcast the myinfo string, but the updated myinfo is sent to new users.
The User:Set* functions have limitations on the length of the string parameter. Those limitations is stated in hexhub's plugins.txt.
Functions
-
User:GetDescription()
-
User:SetDescription(sDescription)
-
User:GetTag()
-
User:SetTag(sTag)
-
User:GetConnection()
-
User:SetConnection(sConnection)
-
User:GetMail()
-
User:SetMail(sMail)
-
User:GetShareString()
-
User:SetShareString(sShare)
local usr = Hex.User(-1)
local bResult = true
while bResult == true do
print("Nickname="..usr:GetNick())
bResult = usr:Next()
end
Generated on Thu Aug 21 11:24:07 2008 for HeXHub/HexScript by
1.5.4
Site hosted by