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

  1. /* Comapi3.pkg */
  2.  
  3. defcom ComClosed = ComClosed;; 
  4. defcom ComConnected = ComConnected S;; 
  5. defcom AddLink = AddLink S S;; 
  6.  
  7. fun InitChat (nick,room)= 
  8.   _setenv APIchn _envchannel _channel; 
  9.   set serverisroom=room; 
  10.   set servernick=nick; 
  11.   set serverIP=_channelIP _channel; 
  12.   set MyNick=_GETtext nickname; 
  13.   _status strcat strcat "On server: " nick ".\n"; 
  14.   set thischn=_channel; 
  15.   set thisenv=_envchannel _channel; 
  16.   _status "Module OK\n"; 
  17.   PHONEInit; 
  18.   _on _channel ChatACK [MyNick]; 
  19.   InitChatWindow; 
  20.   _on _channel NewUser [MyNick 0 _hostIP]; 
  21.   _on APIchn ComConnected [nick]; 
  22.   0 
  23. };; 
  24.  
  25. fun APIengage ()= 
  26.   set APIchn=_channel; 
  27.   _on APIchn ComConnected [servernick]; 
  28. };; 
  29.  
  30. fun __ComAddLink (name,ln)= 
  31.   __AddLink name ln; 
  32.   _on thischn AddLink [name ln] 
  33. };; 
  34.  
  35. fun __ComClose ()= 
  36.   _on APIchn ComClosed []; 
  37.   _killchannel thischn;  
  38. };; 
  39.  
  40. fun _closed ()= 
  41.   _status strcat strcat strcat strcat "Disconnected from " servernick " (" serverIP ").\n"; 
  42.   _on APIchn ComClosed []; 
  43.   _killchannel thischn; 
  44.   _killchannel APIchn; 
  45. };; 
  46.  
  47. fun _connected ()= 
  48.   _status "Connected.\n" 
  49. };; 
  50.  
  51. fun __ComRedirectText (i)=  
  52. {
  53.   if (_channel==APIchn) then 
  54.   {
  55.     set RedirectText=i; 
  56.   } 
  57.   else 0; 
  58. };; 
  59.  
  60. fun __ComRedirectAudio (i)=  
  61. {
  62.   if (_channel==APIchn) then 
  63.   { 
  64.     set RedirectAudio=i; 
  65.   } 
  66.   else 0; 
  67. };; 
  68.  
  69. fun __ComRedirectEvents (i)=  
  70.   if (_channel==APIchn) then 
  71.   { 
  72.     set RedirectEvents=i; 
  73.   }
  74.   else 0; 
  75. };; 
  76.  
  77. fun __ComMinimizeClient ()= 
  78.   if (_channel==APIchn) then 
  79.   { 
  80.     _SHOWwindow Chatw WINDOW_MINIMIZED; 
  81.     0
  82.   } 
  83.   else 0; 
  84. };; 
  85.  
  86. fun __ComRestoreClient ()= 
  87.   if (_channel==APIchn) then 
  88.   { 
  89.     _SHOWwindow Chatw WINDOW_RESTORED; 
  90.     0 
  91.   } 
  92.   else 0; 
  93. };; 
  94.  
  95. fun __ComMaximizeClient ()= 
  96. {
  97.   if (_channel==APIchn) then 
  98.   { 
  99.     _SHOWwindow Chatw WINDOW_MAXIMIZED; 
  100.     0 
  101.   } 
  102.   else 0; 
  103. };; 
  104.  
  105. fun __ComHideClient ()= 
  106.   if (_channel==APIchn) then 
  107.   { 
  108.     _SHOWwindow Chatw WINDOW_HIDDEN; 
  109.     0
  110.   } 
  111.   else 0; 
  112. };; 
  113.  
  114. fun __ComUnHideClient ()= 
  115. {
  116.   if (_channel==APIchn) then 
  117.   { 
  118.     _SHOWwindow Chatw WINDOW_UNHIDDEN; 
  119.     0 
  120.   } 
  121.   else 0; 
  122. };; 
  123.  
  124. fun __ComSetFocusClient ()= 
  125.   if (_channel==APIchn) then 
  126.   { 
  127.     _SETfocus Chatw; 
  128.     0 
  129.   } 
  130.   else 0; 
  131. };; 
  132.  
  133. fun __ComSendText (s)= 
  134.   if (_channel==APIchn) then 
  135.   { 
  136.     _on thischn Hear [s]; 
  137.   } 
  138.   else 0; 
  139. };; 
  140.  
  141. fun __ComRecordOn ()= 
  142. {
  143.   if (_channel==APIchn) then 
  144.   {
  145.     Record; 
  146.   } 
  147.   else 0; 
  148. };; 
  149.  
  150. fun __ComRecordOff ()= 
  151.   if (_channel==APIchn) then 
  152.   { 
  153.     PauseRecord; 
  154.   }
  155.   else 0; 
  156. };; 
  157.  
  158. fun __ComLoadPack (pack,sc)= 
  159.   if (_channel==APIchn) then 
  160.   { 
  161.     _load pack; 
  162.     if (sc!=nil) then 
  163.     { 
  164.       _script sc; 
  165.       0
  166.     }
  167.     else 0; 
  168.   } 
  169.   else 0; 
  170. };; 
  171.  
  172. fun __ComMove (x,y)= 
  173.   if (_channel==APIchn) then 
  174.   { 
  175.     _MVwindow Chatw x y; 
  176.     0 
  177.   } 
  178.   else 0; 
  179. };;
  180.  
  181.