home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
ezirc12o.zip
/
install.zip
/
alias
/
type_it.cmd
< prev
Wrap
OS/2 REXX Batch file
|
1997-12-26
|
3KB
|
86 lines
/* TYPE_IT.CMD */
/* PLACEMENT: this is a ALIAS Script and should go in \ezirc\alias */
/* This script will take an incoming command and type the */
/* text in the file that matches the command. */
/* IE if you type /type greet, it will type the text in */
/* the file greet.txt, as if you had typed it your self. */
/* These files can contain commands like /me /join etc. */
/* But must not rely on any Parameters. */
/* The txt files can contain multiple lines if your msg */
/* is long. Just place files with the extension of .txt */
/* in the same path as this file. */
/* Make sure TXT files contain no blank lines after your text lines */
/* inbound message will look like */
/* /type command */
/* where command it the filename part of a txt file in */
/* the same path as the type_it.cmd */
parse arg window cmdfile strin
/* window = channel or private name, or irc server name */
/* depending on whether the script is run from a */
/* channel window, private window, or main window */
/* cmdfile = next parameter , filename of filename.txt */
/* the .txt is added by the script. */
/* str2 = third parameter, the rest of the string (NOT USED) */
lines.0=0
source='x:\alias\'||cmdfile||'.txt'
/* open file for read */
resultCode = stream( source , 'C', 'OPEN READ')
if resultCode \= 'READY:' then
do
say 'stream open of 'source' returned "'resultCode'"'
exit
end
/* load each line and store in array lines */
do while lines( source )
newline = linein( source )
/* Store lines in Array LINES */
count= lines.0 + 1
lines.0 = count
lines.count=newline
end
/* close file */
resultCode = stream( source, 'C', 'CLOSE')
if resultCode \= 'READY:' then
do
say 'stream close returned "'resultCode'"'
exit
end
/* construct string */
linecount=lines.0
counttemp= linecount - 1
str = ""
divider ='|'
do i=1 to counttemp
Str = str||lines.i||divider
end
Str = str||lines.linecount
say str
return str
end:
/* This TYPE_IT.CMD was written to enhance the use of EZirc I */
/* take no responsibility for how it acts on your system. I */
/* have made every attempt to document it carefully, so that */
/* you can easily understand it. I am not a REXX guru, I just */
/* used the online help in OS/2 to find the functions that */
/* would do the things I want. I am sure there are REXX gurus */
/* out there that can probably do better. If so your welcome */
/* to do so. This code is free for your use and modification. */
/* But please do not share modified versions of this script */
/* with this notice attached. */
/* Have fun */
/* Phillip Catt */
/* prcatt@netrover.com */
/* I am often on Efnet IRC as Number99 */