home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
coders
/
arexx
/
parnet
/
gpc.rexx
Wrap
OS/2 REXX Batch file
|
1997-03-30
|
4KB
|
165 lines
/* GiGA Parnet Chatter ©1996 by Fini 'Warp' Alring of GiGA Productions...
**
** Start the server task in you ParNET-startup.:
** Run >NIL: Rx GPC.rexx Delay ; (I use a delay of 100, 2 secs).
**
** Assign the following line to a HOTKEY or alike...:
** Run >NIL: Rx GPC.rexx * Username ; (I use Warp as Username)
**
** Note: Both machines MUST have the server task started.
**
** BUGS: None, he! he!
** BUT GPC can only cope with one message at a time, so no mega flaming OK!
** Coz then you'll lose the previous message.
** It sometimes doesn't work, but maybe it was set up incorrectly. ;-D
**
** HINT: Set delay lower, to make GPC respond faster, thus more flaming!
** Also I think it's a good idea to set each delay approx. equal...
**
** Future:
** When I try out a networking facility with more computers on, I will
** make a version to chat with the different users, and maybe all!!! :·)
**
** Required libraries:
**
** reqtools.library, rexxreqtools.library, rexxsupport.library.
**
** They should all be available at AmiNET, if you don't have them.
*/
Xver = 'v1.2'
Parse arg D Username
if length(D) = 0 then do
say ''
say ' The GiGA Parnet Chatter ' Xver '©-1996 by Fini 'Warp' Alring of GiGA Prod...'
say ' Type "Run >NIL: Rx GPC.rexx Delay" to start the server task.'
say ' Type "Run >NIL: Rx GPC.rexx * Username" to bring up, a string requester...'
say " Do this on both computers, and you'll be able to send messages over the net!!!"
say ''
say 'Delay = 50th/Sec. - Choose how often the mailbox should be examined...'
Say 'Username = e.g. Warp - The username will pop up with the notes you send...'
say 'Read top of source, for more info...'
say ''
exit
end
call initlibs
if D = '*' then do
if show('p','GPC') then do
Str1 = rtgetstring('',,'GiGA Parnet Chatter v1.0',"_Send|_Abort","rtgs_flags = gsreqf_centertext|gsreqf_highlighttext rt_reqpos = reqpos_centerscr")
if rtresult = 1 then do
Username = centre(Username,60)
Address command "C:Echo "Username" >Net:ram/Parnet.chat"
Address command "C:Echo "Str1" >>Net:ram/Parnet.chat"
/*
Address command "C:Echo "Username" >ram:Parnet.chat"
Address command "C:Echo "Str1" >>ram:Parnet.chat"
*/
end
end
else do
call popreq('Please start the server first...','GiGA')
end
exit 0
end
Boot = 1
do forever
if boot = 1 then do
Success = Openport('GPC')
if Success ~= 1 then do
Call Popreq(centre('GPC is already running on your Amiga!',60),'The GiGA Parnet Chatter 'Xver)
exit 10
end
Call Popreq(centre('GPC is now running on your Amiga!',60),'The GiGA Parnet Chatter 'Xver)
Boot = 0
end
do while exists('ram:Parnet.chat') ~= 1
Call Delay(D)
end
success = open(FILE,'ram:Parnet.chat','r')
Username = readln(FILE)
Str1 = readln(FILE)
call popreq(Str1,Username)
Call close(File)
Address command "C:Delete ram:Parnet.chat quiet"
end
/* Functions() ***************************************************************/
Initlibs:
a=0
If exists('LIBS:rexxreqtools.library') ~= 1 then do
Say 'Unable to open rexxreqtools.library'
a=1
end
If exists('LIBS:reqtools.library') ~= 1 then do
Say 'Unable to open reqtools.library'
a=1
end
If exists('LIBS:rexxsupport.library') ~= 1 then do
Say 'Unable to open rexxsupport.library'
a=1
end
if a=1 then do
say 'Unable to run:'
say Title
say 'Get the libraries listed above, you will need them/it...'
exit 20
end
call addlib("rexxsupport.library", 0, -30, 0)
call addlib("rexxreqtools.library", 0, -30, 0)
/* ^- Libs R found, now we link the reqtools.lib via rexxreqtools.lib */
Return
/*
** ^- Check for needed libraries, and react upon...
*/
PopReq: Parse arg MESS, USERNAME
s = 'Message from ' USERNAME
Call RTezrequest(MESS,'Done!',s,"rt_reqpos =reqpos_centerscr")
return 0
/*
** ^- Pop a requester, with a message...
*/