MSL: mLogScript, displaying the text into MyChat Server Console for scripts
When debugging your scripts, it is important to obtain some intermediate results to make sure the written program works correctly. You can record the protocols into the text file or output the text directly to the editor console:
Syntax
procedure mLogScript(sMsg, sTag: string);
Parameters and return values
Parameter |
Type |
Value |
sMsg |
string |
text message that you need to output into the console log of the script editor; |
sTag |
string |
text tag (can be empty). |
Example
var
s: string;
dt: double;
begin
s := '{"Value" : "17.10.1990.18.36.54"}'; // date/time format: dd.mm.yyyy.hh.mm.ss
// (day, month, year, hours, minutes, seconds)
if JSONGetDateTime(s, 'Value', dt) = 0 then begin
mLogScript(FormatDateTime('mmmm yyyy, number: d, a day of the week: dddd', dt), 'Date&Time test');
end;
end.
Script work result
[15:26:42] (Log "test"): [Date&Time test] October 1990, number: 17, day of the week: Wednesday