MyChat Scripts Engine: function mIsUINOnline, check if a user is online
"For developers", "Server scripts", "Functions description", "Users", "mIsUINOnline".
Function to check if a user with a specified UIN is online or not.
Syntax
function mIsUINOnline(iUIN: integer): boolean;
Parameters and return values
Parameter |
Type |
Value |
iUIN |
integer |
unique user identifier. |
Function result
true, if the user is connected to the server and online, false if disconnected (offline). Built-in bot Elisa (UIN=0) is always online.
Example
const
iUIN = 0; // user UIN for test, set your own number
var
sUserName: string;
begin
sUserName := mGetUserAttribute(iUIN, 'InternalNickName');
if mIsUINOnline(iUIN) then mLogScript('UIN: ' + inttostr(iUIN) + ', nickname "' + sUserName + '" is online now', '')
else mLogScript('UIN: ' + inttostr(iUIN) + ', nickname "' + sUserName + '" is offline', '');
end.
Script work result
[19:00:02] (Log "mIsUINOnline"): UIN: 0, nickname "Elisa" is online now
[19:00:02] (Run "mIsUINOnline"): Script operation time: 3 ms
[19:00:02] (Run "mIsUINOnline"): Script done successfully.