home *** CD-ROM | disk | FTP | other *** search
- /* Arexx script for StrICQ triggered by the notify event that will use
- the Amiga's narrator.device to inform you who sent you the last msg.
-
- $VER:release v0.5 july-6th-1998 by Eric Giroux (eric_giroux@videotron.ca)
-
- PLay16 by Thomans Wenzel (http://linux.rz.fh-hannover.de/~wenzel/programming.html)
- and translator.library are required.
-
- Simply put that script in StrICQ's "settings/prefs/stricq/message notify command & online"
- rx rexx/notify_stricq.rexx %ld msg"
- rx rexx/notify_stricq.rexx %ld online"
- rx rexx/notify_stricq.rexx 0 system"
-
- Put contacts.prefs in the same drawer as notify_stricq.rexx and modify
- it to reflect your contact list. The first argument is the UIN and
- the second, after the comma, is the name you want the translator to
- speak.
-
- You'll have to change 6 variables in notify_stricq.prefs
-
- TALKTO variable to your first name.
- SAY_COMMAND variable to reflect the path on your system.
- SAMPLE_MSG variable to the sample you want to hear as general notification.
- SAMPLE_ONLINE variable to the sample you want to hear when someone is online.
- SAMPLE_SYSTEM variable to the sample you want to hear when there's a system message.
- PLAYER variable to reflect the one you use.
- */
-
- options results
-
-
- if show(P,'STRICQ_NOTIFICATION_REXX') then do
- DO WHILE Show('p','STRICQ_NOTIFICATION_REXX') = 0
- Call Delay 120
- End
- end
- else
- msg_port=openport('STRICQ_NOTIFICATION_REXX')
-
- found="0"
- port=address()
-
- curdir=pragma('d')
- if right(curdir,1) ~= ":" then prefs=curdir"/rexx/Contacts.prefs"
- else prefs=curdir"rexx/Contacts.prefs"
-
- stricq.prefs_file=curdir"/rexx/notify_stricq.prefs"
-
- if exists(stricq.prefs_file)=1 then
- open('prefs_file',stricq.prefs_file,r)
- do while ~eof('prefs_file')
- line=readln('prefs_file')
- if index(line,'/*') =0 & if index(line,'=') ~=0 & index(line,'*/') =0 then
- interpret line
- else
- iterate
- end
-
- say_command=center(say_command,length(say_command)+2,'"')
-
- if ~show('L','rexxsupport.library') then
- if addlib('rexxsupport.library',0,-30,0)=0 then exit
-
- if ~exists('libs:translator.library') then exit
-
- options results
-
- parse upper arg UIN " " NOTIFICATION
-
- if UIN="" then exit
-
-
-
- if exists(sample_msg)=1 & exists(player)=1 & exists(sample_online) then do
- select
- when upper(notification)='MSG' then do
- address command player ' <>nil: ' sample_msg
- say_nick(MSG)
- end
- when upper(notification)='ONLINE' then do
- address command player ' <>nil: ' sample_online
- say_nick(ONLINE)
- end
- when upper(notification)='SYSTEM' then
- address command player ' <>nil: ' sample_system
-
- otherwise
- break
- end
- end
-
- if show(P,'STRICQ_NOTIFICATION_REXX') then
- msg_port=closeport('STRICQ_NOTIFICATION_REXX')
-
- exit
-
-
- say_nick:
- parse arg notify_type
-
- if exists(prefs)=1 then do
- if open(notify_prefs_file,prefs,r) = "0" then exit
- nlines="1"
- do while ~eof(notify_prefs_file)
- nick.nlines=readln(notify_prefs_file)
- if nick.nlines="" then iterate
- else do
- if index(nick.nlines,UIN) >= 1 then do
- if exists(compress(SAY_COMMAND,'"'))=1 then do
- select
- when upper(notify_type)='MSG' then
- address command say_command d2c(34) talkto ',,,you have a message from,' spoken_nick(nick.nlines) ',on I see cue.' d2c(34)
-
- when upper(notify_type)='ONLINE' then
- address command say_command d2c(34) talkto ',,,' spoken_nick(nick.nlines) ',is online.' d2c(34)
- end
- end
- found=found+1
- end
- nlines=nlines+1
- end
- if found="1" then leave
- end
- nick.0=nlines-1
- close(notify_prefs_file)
- end
- return notify_type
-
- spoken_nick:
- parse arg new_nick
- new_nick=substr(new_nick,lastpos(',',new_nick)+1)
- return new_nick
-
- PubScreen:
- If show('p', port) = 1 then do
- address value port
- INFO SCREEN
- PubScreen = result
- end
- else
- PubScreen = 'Workbench'
- return pubscreen
-