vipak/test.Mod
norayr 1cac25c181 more handler procedures, for private, public, mentions, etc. also
parsing of the server line, getting host, message, recipient, from whom,
etc. -- noch
2017-05-18 03:05:49 +04:00

43 lines
752 B
Modula-2

MODULE test;
IMPORT IRC, Out, Strings := ooc2Strings;
PROCEDURE clbk(VAR msg : ARRAY OF CHAR);
BEGIN
Out.String("callback procedure is running, youhoo!"); Out.Ln;
Out.String("input:"); Out.Ln;
Out.String(msg); Out.String("|"); Out.Ln;
Out.Ln;
END clbk;
PROCEDURE testBot;
VAR
inst: IRC.instance;
channels : IRC.chnlist;
b: BOOLEAN;
BEGIN
inst.owner := "norayr_tanakian";
inst.user := "norayr_tanakian";
inst.nick := "vocbot";
inst.host := "irc.freenode.net";
inst.port := "6667";
inst.callbackSimple := clbk;
NEW(channels, 1);
channels[0] := "#oberon";
IRC.setChannelList(inst, channels);
IF IRC.Connect(inst) # FALSE THEN
b := IRC.Auth(inst);
IRC.Loop(inst);
END;
END testBot;
BEGIN
testBot;
END test.