Escaper

From Gwen Morse's Wiki
Jump to: navigation, search
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;----------------------------------------------------------------------
;;; TF stuff, by Tiercel/JBB, batzel at cceb dot med dot upenn dot edu
;;;----------------------------------------------------------------------
;;; MUSHcode escaper. If you've typed a long line of code (or grabbed
;;; it with /fuguedit), you don't want to have to go through by hand to
;;; escape out all those characters MUSH will eat. Instead, with this
;;; loaded, just hit esc-e, and it escapes all the odd characters in
;;; what you've just typed (or /redit'd).
;;; RATING: **** (Very useful for heavy coders or for teaching people code)

/def -ib'^[e' = /test kbgoto(kblen() + 1) %;\
  /grab $(/escape %%[]{}\ $[kbhead()])

/def -i -F eschelp = %;/echo%;/echo *** Tiercel's MUSHcode Escaper Help %;\
   /echo If you've typed a long line of code (or grabbed it with Fuguedit), %;\
   /echo you don't want to have to go through by hand to escape out all those %;\
   /echo characters MUSH will eat. Instead, with this loaded, just hit esc-e, %;\
   /echo and it escapes all the odd characters in the command line. %;\
   /echo %;/