home *** CD-ROM | disk | FTP | other *** search
/ Treasure Hunt 2001 PRESSKIT / TH2001_PRESSKIT.iso / demo / scol_install / Partition / comm / comapi.pkg next >
Encoding:
Text File  |  2000-09-18  |  1.2 KB  |  90 lines

  1. /* Comapi.pkg */
  2.  
  3. fun __ComConnect (adr)= 
  4.   if (_channel==APIchn) then 
  5.   { 
  6.     APIContact adr;
  7.     0
  8.   }
  9.   else
  10.   {
  11.     _closechannel;
  12.     0
  13.   }
  14. };;
  15.  
  16. defcom ComNotFound = ComNotFound S;; 
  17.  
  18. fun __ComSearch (adr)= 
  19.   if (_channel==APIchn) then 
  20.   { 
  21.     let searchline adr->res in 
  22.     { 
  23.       if (res==nil) then 
  24.       {   
  25.         _on _channel ComNotFound [adr]; 0 
  26.       } 
  27.       else 
  28.       { 
  29.         _setenv _channel _envchannel res; 
  30.         _script "ComAPIplug\n"; 
  31.         _setenv res _envchannel _channel; 
  32.       } 
  33.     } 
  34.   } 
  35.   else 
  36.   { 
  37.     _closechannel; 
  38.     0 
  39.   } 
  40. };; 
  41.  
  42. fun APIMain ()= 
  43.   set APIchn=_channel; 
  44. };; 
  45.  
  46. fun __ComSetNick (nick)= 
  47.   if (_channel==APIchn) then 
  48.   { 
  49.     _SETtext nickname nick; 
  50.     0 
  51.   } 
  52.   else 
  53.   { 
  54.     _closechannel; 
  55.     0 
  56.   } 
  57. };; 
  58.  
  59. fun __ComRoom (i)= 
  60.   if (_channel==APIchn) then if (i==1) then 
  61.   { 
  62.     _SETcheck chatroom 1; 
  63.     0 
  64.   } 
  65.   else 
  66.   { 
  67.     _SETcheck chatroom 0; 
  68.     0 
  69.   } 
  70.   else 
  71.   { 
  72.     _closechannel; 
  73.     0 
  74.   } 
  75. };; 
  76.  
  77. fun __ComSimpleConnect (adr)= 
  78.   if (_channel==APIchn) then 
  79.   { 
  80.     Contact adr; 
  81.     _closechannel; 
  82.   } 
  83.   else _closechannel; 
  84. };;