home *** CD-ROM | disk | FTP | other *** search
- /* Comapi.pkg */
-
- fun __ComConnect (adr)=
- {
- if (_channel==APIchn) then
- {
- APIContact adr;
- 0
- }
- else
- {
- _closechannel;
- 0
- }
- };;
-
- defcom ComNotFound = ComNotFound S;;
-
- fun __ComSearch (adr)=
- {
- if (_channel==APIchn) then
- {
- let searchline adr->res in
- {
- if (res==nil) then
- {
- _on _channel ComNotFound [adr]; 0
- }
- else
- {
- _setenv _channel _envchannel res;
- _script "ComAPIplug\n";
- _setenv res _envchannel _channel;
- }
- }
- }
- else
- {
- _closechannel;
- 0
- }
- };;
-
- fun APIMain ()=
- {
- set APIchn=_channel;
- };;
-
- fun __ComSetNick (nick)=
- {
- if (_channel==APIchn) then
- {
- _SETtext nickname nick;
- 0
- }
- else
- {
- _closechannel;
- 0
- }
- };;
-
- fun __ComRoom (i)=
- {
- if (_channel==APIchn) then if (i==1) then
- {
- _SETcheck chatroom 1;
- 0
- }
- else
- {
- _SETcheck chatroom 0;
- 0
- }
- else
- {
- _closechannel;
- 0
- }
- };;
-
- fun __ComSimpleConnect (adr)=
- {
- if (_channel==APIchn) then
- {
- Contact adr;
- _closechannel;
- }
- else _closechannel;
- };;