home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / fibstf0b.zip / tf.lib < prev    next >
Text File  |  1994-12-10  |  7KB  |  192 lines

  1. ;;;; TinyFugue version 2.1
  2. ;;;; standard macro library
  3.  
  4. ;;;; The commands in this file are essential to the correct operation of TF.
  5. ;;;; This library is as much a part of TF 2.1 as the executable file.  The
  6. ;;;; library is designed so that it can be used by one or many users.  If
  7. ;;;; you wish to modify any of the defaults defined here, you should do
  8. ;;;; so in your $HOME/.tfrc (note that "/redef on" may be necessary first).
  9. ;;;; Exception:  administrators of a public TF copy may wish to modify some
  10. ;;;; definitions of general interest (e.g., a site specific HELPFILE, or
  11. ;;;; the name of the compression program).
  12.  
  13. ;;; HELPFILE is defined during installation.  If you have not yet installed,
  14. ;;; do not edit this macro.  Edit this only if you decided to move the
  15. ;;; helpfile after installation.
  16. /def -i HELPFILE    = tf.hlp
  17. ;;; file compression
  18. ;;; COMPRESS_READ should contain a command that take a filename as an
  19. ;;; argument, and prints its output on stdout.
  20.  
  21. /def -i COMPRESS_SUFFIX = .Z
  22. /def -i COMPRESS_READ = zcat
  23. ;; /def -i COMPRESS_SUFFIX = .z
  24. ;; /def -i COMPRESS_READ = pcat
  25.  
  26. ;;;; --------------------------------------------- ;;;;
  27. ;;;; You should not edit anything below this point ;;;;
  28. ;;;; --------------------------------------------- ;;;;
  29.  
  30. ;;; default bindings
  31. ;; TF is almost useless without these.
  32.  
  33. /def -i -b"^J"    = /DOKEY NEWLINE
  34. /def -i -b"^P"    = /DOKEY RECALLB
  35. /def -i -b"^N"    = /DOKEY RECALLF
  36. /def -i -b"^[b"   = /DOKEY SOCKETB
  37. /def -i -b"^[f"   = /DOKEY SOCKETF
  38. /def -i -b"^D"    = /DOKEY DCH
  39. /def -i -b"^L"    = /DOKEY REDRAW
  40. /def -i -b"^[[A"  = /DOKEY UP
  41. /def -i -b"^[[B"  = /DOKEY DOWN
  42. /def -i -b"^[[C"  = /DOKEY RIGHT
  43. /def -i -b"^[[D"  = /DOKEY LEFT
  44. /def -i -b"^A"    = /DOKEY HOME
  45. /def -i -b"^E"    = /DOKEY END
  46. /def -i -b"^B"    = /DOKEY WLEFT
  47. /def -i -b"^F"    = /DOKEY WRIGHT
  48. /def -i -b"^K"    = /DOKEY DEOL
  49. /def -i -b"^[v"   = /DOKEY INSERT
  50. /def -i -b"^I"    = /DOKEY PAGE
  51. /def -i -b"^[h"   = /DOKEY HPAGE
  52. /def -i -b"^[l"   = /DOKEY LINE
  53. /def -i -b"^[j"   = /DOKEY FLUSH
  54.  
  55. ;;; default filenames
  56.  
  57. /def -i MACROFILE    = ~/tiny.macros
  58. /def -i HILITEFILE    = ~/tiny.hilite
  59. /def -i GAGFILE        = ~/tiny.gag
  60. /def -i TRIGFILE    = ~/tiny.trig
  61. /def -i BINDFILE    = ~/tiny.bind
  62. /def -i HOOKFILE    = ~/tiny.hook
  63. /def -i WORLDFILE    = ~/tiny.world
  64. /def -i LOGFILE        = ~/tiny.log
  65.  
  66. ;;; list macros
  67.  
  68. /def -i listdef        = /list %*
  69. /def -i listhilite    = /list -h- -b- -t"%*" -aurfdhb
  70. /def -i listgag        = /list -h- -b- -t"%*" -ag
  71. /def -i listtrig    = /list -h- -b- -t"%*" -an
  72. /def -i listbind    = /list -h- -b"%*"
  73. /def -i listhook    = /list -h"%*"
  74.  
  75. ;;; purge macros
  76.  
  77. /def -i purgedef    = /purge -h- -b- %{1-?*}
  78. /def -i purgehilite    = /purge -h- -b- -t"%*" -aurfdhb
  79. /def -i purgegag    = /purge -h- -b- -t"%*" -ag
  80. /def -i purgetrig    = /purge -h- -b- -t"%*" -an
  81. /def -i purgedeft    = /purge -h- -b- -t"%*" ?*
  82. /def -i purgebind    = /purge -h- -b"%*"
  83. /def -i purgehook    = /purge -h"%*"
  84.  
  85.  
  86. ;;; Set up load* and save* macros with default filenames.
  87.  
  88. ;; Can't use %%{1-$%3FILE$} because '/'s in filename will be interpreted at
  89. ;; intermediate level.  (We really need quoted arguments).  Used %%L to get
  90. ;; around this.
  91.  
  92. /def -i _def_file_command = \
  93.     /def -i %1%2 = \
  94.         //def -i _do_file_command = \
  95.             ///%1 %%%L %{-3}%%;\
  96.         //_do_file_command $$%3FILE$$ %%1%%;\
  97.         //undef _do_file_command
  98.  
  99. /_def_file_command  load  def     MACRO
  100. /_def_file_command  load  hilite  HILITE
  101. /_def_file_command  load  gag     GAG
  102. /_def_file_command  load  trig    TRIG
  103. /_def_file_command  load  bind    BIND
  104. /_def_file_command  load  hook    HOOK
  105. /_def_file_command  load  world   WORLD
  106.  
  107. /_def_file_command  save  def     MACRO   -h- -b- -t- ?*
  108. /_def_file_command  save  hilite  HILITE  -h- -b- -t -aurfdhb
  109. /_def_file_command  save  gag     GAG     -h- -b- -t -ag
  110. /_def_file_command  save  trig    TRIG    -h- -b- -t -an
  111. /_def_file_command  save  bind    BIND    -h- -b
  112. /_def_file_command  save  hook    HOOK    -h
  113.  
  114.  
  115. ;;; /keys simulation
  116. ;; For backward compatibilty only.
  117. ;; Supports '/keys <mnem> = <key>' and '/keys' syntax.
  118. ;; Trigger kluge needed to check syntax.
  119.  
  120. /def -i keys =\
  121. ;   error message for unsupported '/keys [<mnem> =] <key>,<key>[,<key>...]'
  122.     /def -i1 -t"keys: *,*" -p2147483646 _keys_comma =\
  123.         //echo %%% The ///keys comma syntax is no longer supported.%%;\
  124.         //echo %%% See ///help bind, ///help dokey.%;\
  125. ;   error message for unsupported '/keys <mnem>=<key>'
  126.     /def -i1 -t"keys: *=*" -p2147483644 _keys_space =\
  127.         //echo %%% ///keys is a macro.  '=' must be surrounded by spaces.%%;\
  128.         //echo %%% See ///help bind, ///help dokey.%;\
  129. ;   error message for bad syntax
  130.     /def -i1 -t"keys: *" -p214783643 _keys_error =\
  131.         //echo %%% Bad ///keys syntax.%;\
  132. ;   list /dokey bindings for '/keys'
  133.     /def -i1 -t"keys:" -p2147483647 _keys_list =\
  134.         //list -Ib%;\
  135. ;   define a dokey binding for '/keys <mnem> = <key>'
  136.     /def -i1 -t"keys: {*} = ?*" -p2147483645 _keys_def =\
  137.         //def -ib"%{-2}" = ///dokey %1%;\
  138.     /trigger keys: %*%;\
  139.     /purge -I _keys_*
  140.  
  141.  
  142. ;;; Default login format
  143. ;; With /login on, sends TinyMUD-style connect command upon connection.
  144.  
  145. /def -i -h"LOGIN" = connect %2 %3
  146.  
  147.  
  148. ;;; Retry connections
  149.  
  150. ;; /retry <world> [<delay>]
  151. ;; Try to connect to <world>.  Repeat every two minutes until successful.
  152.  
  153. /def -i retry = \
  154.     /def -h"CONFAIL %1 *" _retry_fail_%1 = \
  155.         //repeat -120 1 ///world %1%;\
  156.     /def -1 -h"CONNECT %1" _retry_succ_%1 = \
  157.         //undef _retry_fail_%1%;\
  158.     /world %1
  159.  
  160. ;; /retry_off [<world>]
  161. ;; Cancels "/retry <world>" (default: all worlds)
  162.  
  163. /def -i retry_off = /purge {_retry_fail_%{1-*}|_retry_succ_%{1-*}}
  164.  
  165.  
  166. ;;; Hilites for pages and whispers
  167. ;; Simulates "/hilite page" and "/hilite whisper" in earlier versions
  168.  
  169. /def -i hilite_whisper = \
  170.   /def -i -p2 -ah -t"{*} whispers, \"*\"" hilite_whisper1%;\
  171.   /def -i -p2 -ah -t"{*} whispers \"*\"" hilite_whisper2
  172.  
  173. /def -i hilite_page = \
  174.   /def -i -p2 -ah -t"{*} pages from *: *" hilite_page1%;\
  175.   /def -i -p2 -ah -t"You sense that {*} is looking for you in *" hilite_page2%;\
  176.   /def -i -p2 -ah -t"The message was: *" hilite_page3%;\
  177.   /def -i -p2 -ah -t"{*} pages: *" hilite_page4
  178.  
  179. /def -i nohilite_whisper =    /purge -I hilite_whisper[1-2]
  180. /def -i nohilite_page =        /purge -I hilite_page[1-4]
  181.  
  182.  
  183. ;;; backward compatible macros
  184.  
  185. /def -i nolog        = /log   off
  186. /def -i nologin        = /login off
  187. /def -i noquiet        = /quiet off
  188. /def -i nowrap        = /wrap  off
  189.  
  190. /def -i reply        = /borg %*
  191. /def -i act        = /trig %*
  192.