mirror of
https://github.com/vishapoberon/vipak.git
synced 2026-04-05 20:42:26 +00:00
44 lines
727 B
Modula-2
44 lines
727 B
Modula-2
MODULE test;
|
|
|
|
IMPORT IRC, Out, Strings := ooc2Strings;
|
|
|
|
|
|
PROCEDURE clbk(VAR in: ARRAY OF CHAR);
|
|
BEGIN
|
|
Out.String("callback procedure is running, youhoo!"); Out.Ln;
|
|
Out.String("input:"); Out.Ln;
|
|
Out.String(in); 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.callback := 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.
|