MyChat Scripts Engine: mGetUserState, get a user's network status
Function to determine the user's network status by his UIN.
Syntax
function mGetUserState(iUIN: integer): integer;
Parameters and return values
Parameter |
Type |
Value |
iUIN |
integer |
unique user identifier, status of which you need to determine. |
Function result
Integer number, the type can be viewed in the reference book of user network statuses.
Example
const
iUIN = 0; // user UIN for test, set your own number
var
sUserName, sState: string;
iState: integer;
begin
sUserName := mGetUserAttribute(iUIN, 'InternalNickName');
iState := mGetUserState(iUIN);
case iState of
-1: sState := 'offline';
0: sState := 'online, free';
1: sState := 'online, away';
2: sState := 'online, do not dusturb (dnd)';
end;
mLogScript('UIN: ' + inttostr(iUIN) + ', nickname "' + sUserName + '" is ' + sState, '');
end.
Script work result
[19:13:31] (Log "mGetUserState"): UIN: 0, nickname "Elisa" is online, free
[19:13:31] (Run "mGetUserState"): Script operation time: 2 ms
[19:13:31] (Run "mGetUserState"): Script done successfully.
See also
Created with the Personal Edition of HelpNDoc: Keep Your Sensitive PDFs Safe with These Easy Security Measures