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