home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / ircii30.zip / script / tabkey < prev    next >
Text File  |  1995-04-10  |  3KB  |  95 lines

  1. # @(#) $Id: tabkey,v 1.2 1995/04/09 13:15:24 mrg Exp $
  2. #------------------------------------------------------------------------------#
  3. # updated for 2.2.2
  4. # This keeps track of the nicks of people you MSG.  You can then
  5. # just hit the tab key ^I to flip through the list of people
  6. # you sent MSGs to.  
  7. # Assign tk.msgmax to the number of nicknames you wish to store
  8. # Modified by Chetnik (s902211@yallara.cs.rmit.oz.au)
  9. #         and Daemon  (frechett@spot.colorado.edu)
  10. # It will now keep unique nicknames in the list ordered from the most recent
  11. # message received or sent to the oldest message received or sent.
  12. # Ctrl R will flip thru the list backwards (Reverse).
  13. # Crtl-X Ctrl-X deletes the currently displayed or current nick from the list.
  14. # /addnick <nickname list>    will add the nicknames to the list.
  15. # /nicklist             will show the current list of names
  16. # If a nickname which has 'never' existed is messaged, it will not be added to
  17. # the list.
  18.  
  19. # searches thru list forwards (tab) or backwards (ctrl R)
  20. bind ^I parse_command ^tk.getmsg 1 $tk.msglist
  21. bind ^R parse_command ^tk.getmsg -1 $tk.msglist
  22. # Delete current nickname or currently displayed nickname from list
  23. bind ^X^X parse_command tk.delnick
  24. # shows all the current nicknames in the list.
  25. alias nicklist echo *** Nickname List: $tk.msglist
  26. # Adds nicknames to the list.. 
  27. alias addnick if ([$1]) { addnick $1- };tk.addmsg $0 $tk.msglist
  28. # Set this to the max number of nickname you want on the list at a time
  29. @ tk.msgmax = 10
  30.  
  31. # From here down are internal aliases and 'ON's.
  32. # This script uses SERIAL NUMBER  #55
  33. # keeps list of unique nicks from newest message to oldest message.
  34. alias tk.addmsg {
  35.     @ tk.matched = rmatch($0 $^\1-)
  36.     if (tk.matched)
  37.     {
  38.         @ tk.msglist = [$(0-${tk.matched-1}) $(${tk.matched+1}-)]
  39.     }
  40.     #else
  41.     {    @ tk.msglist = [$(0-${tk.msgmax-1})] }
  42.     @ tk.msgcnt = 0
  43.     ^assign -tk.matched
  44. }
  45. # searches thru list forwards or backwards. ($0==1==forward),($0==-1==back)
  46. alias tk.getmsg {
  47.     @ tk.msgcnt = tk.msgcnt + [$0]
  48.     if ( #tk.msglist < tk.msgcnt ) {@ tk.msgcnt = 1}
  49.     if (tk.msgcnt <= 0) {@ tk.msgcnt =  #tk.msglist}
  50.     @ tk.junk = K ## [msg]
  51.     type ^U$tk.junk $^\^^{[$($tk.msgcnt)]} 
  52. }
  53. # some initialisation.  You can comment these out if you want to.
  54. # ^on #-401 55 * if ([$AUTO_WHOWAS] != [ON]) { ^whowas $1 }
  55. # ^on ^406 * {
  56. #    ^assign tk.msglist $notword($rmatch($1 $tk.msglist) $tk.msglist)
  57. #    if ([$AUTO_WHOWAS] == [ON]) { echo *** $1- }
  58. #}
  59.     
  60.  
  61. # Adds nick to list when message is sent or received. Doesn't effect output.
  62. on #-send_msg 55 * ^tk.addmsg $0 $tk.msglist
  63. on #-msg 55 * ^tk.addmsg $0 $tk.msglist
  64. on #-send_dcc_chat 55 * ^tk.addmsg \=$0 $tk.msglist
  65. on #-dcc_chat 55 * ^tk.addmsg \=$0 $tk.msglist
  66.  
  67. # deletes current nick from list
  68. alias tk.delnick {
  69.     if (tk.msgcnt == 0)
  70.     {
  71.         echo *** Nickname: $word(0 $tk.msglist) removed.
  72.         @ tk.msglist = [$notword(1 $tk.msglist)]
  73.     }
  74.     {
  75.         echo *** Nickname: $word(${tk.msgcnt-1} $tk.msglist) removed.
  76.         @ tk.msglist = [$notword($tk.msgcnt $tk.msglist)]
  77.     }
  78.     type ^U
  79. }
  80. # The $notword() function.  
  81. alias notword {
  82.     if ([$0] > 0)
  83.     {
  84.     if (([$0] > 1) && ([$0] < rmatch($~ $1-)))
  85.         { @ nw.sep = [ ] }
  86.         { @ nw.sep = [] }
  87.         
  88.     @ function_return = [$(1-${[$0]-1})] ## [$nw.sep] ## [$(${[$0]+1}-)]
  89.     }
  90.     {
  91.         @ function_return = [$1-]
  92.     }
  93. }
  94. #------------------------------------------------------------------------------#
  95.