home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / gtirc306.zip / REXXCMD.CMD < prev    next >
OS/2 REXX Batch file  |  1997-11-24  |  6KB  |  100 lines

  1. /*********************************************************************/
  2. /* REXXCMD.CMD   GammaTech IRC Sample REXX Command Exit Script       */
  3. /*********************************************************************/
  4. /*                                                                   */
  5. /* This is a sample REXX script for use with GammaTech IRC. It will  */
  6. /* perform the following functions:                                  */
  7. /*                                                                   */
  8. /* 1) Provides a /BOOT command a simplified version of /KICK         */
  9. /* 2) Creates a /WHOM command which executes a /VERSION and a        */
  10. /*    /USERINFO on the specified nickname.                           */
  11. /*                                                                   */
  12. /* Warning: Do not change this script. Copy it to another name       */
  13. /* and modify the copy for backup purposes.                          */
  14. /*                                                                   */
  15. /*********************************************************************/
  16. /*                                                                   */
  17. /* Entry arguments:                                                  */
  18. /*                                                                   */
  19. /* Arg 1 - Window Handle                                             */
  20. /* Arg 2 - Your Nickname                                             */
  21. /* Arg 3 - Window Name                                               */
  22. /* Arg 4 - The command / text                                        */
  23. /*                                                                   */
  24. /* The Window Name parameter will contain one of the following:      */
  25. /*                                                                   */
  26. /*  * Channel name if the command is executed from a channel         */
  27. /*    window. In this case the first character will be a # or &.     */
  28. /*                                                                   */
  29. /*  * Other clients nick name if the command is executed from a      */
  30. /*    query window. The first character will not be #, & or !.       */
  31. /*                                                                   */
  32. /*  * If the command is executed from any other type of window       */
  33. /*    this parameter will contain a !.                               */
  34. /*                                                                   */
  35. /* The command may be suppressed or ignored. To suppress             */
  36. /* the command, return a null ("") string. To allow the command to   */
  37. /* be processed normally, return a non-null string.                  */
  38. /*                                                                   */
  39. /*********************************************************************/
  40. /*                                                                   */
  41. /* There are external REXX functions you may use in this REXX        */
  42. /* procedure which are described in the online help under Script     */
  43. /* programming. A summary of those functions is shown below:         */
  44. /*                                                                   */
  45. /* IrcRexxDisplay(text,win)          Display text in a window.       */
  46. /* IrcRexxCommand(text,win)          Send text or /comamnd to IRC    */
  47. /* IrcRexxSend(text,win)             Send raw text to server.        */
  48. /* IrcRexxVariable(win,name[,value]) Query or set an IRC variable.   */
  49. /* IrcRexxWildCard(wildcard,string)  Check for wildcard match.       */
  50. /*                                                                   */
  51. /*********************************************************************/
  52. Parse Upper Arg WinHandle WinName OurNick Verb Parm1 Parms
  53.  
  54. Pool = 'OS2ENVIRONMENT'
  55.  
  56. /*********************************************************************/
  57. /* If this is the "/boot" command we format and execute a /kick and  */
  58. /* then suppress the original /boot command.                         */
  59. /*                                                                   */
  60. /* To activate this command you must enter /var $Boot,yes            */
  61. /*                                                                   */
  62. /*********************************************************************/
  63.  
  64. if (Verb = '/BOOT' & Parm1 <> '' & IrcRexxVariable(WinHandle,"$Boot") = "yes") then do
  65.    OutStr = "/KICK" Parm1 "Get out you lamer"
  66.    IrcRexxCommand(OutStr,WinHandle)
  67.    Return ""
  68. end
  69.  
  70. /*********************************************************************/
  71. /* The /WHOM command simply executes a /VERSION and /USERINFO on the */
  72. /* specified nickname.                                               */
  73. /*                                                                   */
  74. /* Syntax:  /WHOM nickname                                           */
  75. /*                                                                   */
  76. /*********************************************************************/
  77.  
  78. if (Verb = '/WHOM') then do
  79.    if (Parm1 <> '') then do
  80.       OutStr = "/VERSION "  Parm1
  81.       IrcRexxCommand(OutStr,WinHandle)
  82.       OutStr = "/USERINFO " Parm1
  83.       IrcRexxCommand(OutStr,WinHandle)
  84.    end
  85.  
  86.    else do
  87.       IrcRexxDisplay("Syntax error",WinHandle)
  88.    end
  89.  
  90.    Return ""
  91. end
  92.  
  93. /*********************************************************************/
  94. /* This isn't a command we care about so we pass a non-null string   */
  95. /* so that it will be processed normally.                            */
  96. /*********************************************************************/
  97.  
  98. Return "OK"
  99.  
  100.