@prog Replace.Filter 1 99999 d 1 i ( Filter: Subsitution filter for extended say 3.10 filter system. ` Find property Replace prop Old style properties: filter subst New style properties: _say/ch/n/s _say/ch/n/r ` Conversion is upon demand [and yes, it's horribly messy]. ` sayfilter add find replace - Add a filter item to the list take n n=1 2 3... - Remove the given item list - List the filter list ) : list-shuffle ( db "_say/ch/n/filter" m -- db ) (Shuffle list onto m) begin 3 pick 3 pick 3 pick intostr strcat over 5 pick 5 pick 1 + dup 6 put intostr strcat getpropstr dup while 0 addprop repeat pop remove_prop pop pop ; : add-item ( n db ch params add -- n "" "" 1 ) pop strip "" "\\\\" subst dup dup strlen 1 - strcut swap pop "\\" strcmp not if " " strcat then "" "\\ " subst dup " " instr dup 2 < if pop "Replace: 'add' needs two parameters. (" swap strcat ")" strcat 2 put pop "" 1 exit then 1 - strcut 1 strcut swap pop "\\" "" subst " " "" subst swap "\\" "" subst " " "" subst 4 pick "_say/" 5 pick strcat "/" strcat 7 pick intostr strcat "/" strcat over over 1 -3 rotate 1 begin intostr "s" swap strcat strcat getpropstr while 1 + 3 pick 3 pick 3 pick repeat over over "s" swap intostr strcat strcat 4 pick swap 7 rotate 0 addprop "r" swap intostr strcat strcat rot 0 addprop pop pop "" "" 1 ; : take-item ( n db ch itemnumber take ) pop atoi "_say/" 3 pick strcat "/" strcat 5 pick intostr strcat "/" strcat 4 pick over "s" strcat 4 pick list-shuffle swap "r" strcat rot list-shuffle pop pop pop "" "" 1 ; : show-list ( n db ch params list ) pop pop over "_say/" 3 pick strcat "/" strcat 5 pick intostr strcat "/" strcat 1 begin 3 pick 3 pick "s" strcat 3 pick intostr strcat getpropstr dup while 4 pick 4 pick "r" strcat 4 pick intostr strcat getpropstr swap "\"" strcat "\" -> \"" swap strcat strcat 3 pick 3 pick intostr strcat ": \"" strcat swap strcat me @ swap notify 1 + repeat pop pop pop pop pop pop "" "" 1 ; : list-move ( db "filterch" "_say/ch/n/filter" -- db ) 1 begin 4 pick 4 pick 3 pick intostr strcat over over getpropstr dup while -3 rotate remove_prop 5 pick 4 pick 4 pick intostr strcat rot 0 addprop 1 + repeat pop pop pop pop pop pop ; : filtration ( db _say/ch/n/ message -- message' ) 1 swap begin 4 pick 4 pick "s" 5 pick intostr strcat strcat getpropstr dup while 5 pick 5 pick "r" 6 pick intostr strcat strcat getpropstr subst swap 1 + swap repeat pop 3 put pop pop ; : lynx-filter ( n db ch message -- n db ch message' 0 ) command @ "sayfilter" strcmp if "_say/ch/n/" 5 pick intostr "n" subst 3 pick "ch" subst 4 pick over "s1" strcat getpropstr if 4 pick swap 3 pick ( Filter is okay ) else 3 pick dup "sp" strcmp not if pop " " then dup "def" strcmp not if pop "" then 5 pick "filter" 3 pick "1" strcat strcat getpropstr if 5 pick "filter" 3 pick strcat 4 pick "s" strcat list-move "subst" rot strcat 3 pick "r" strcat list-move swap 3 pick else dup not if pop pop 0 exit (filter was default and not there) else pop pop 3 pick "_say/def/n/" 6 pick intostr "n" subst over over "s1" strcat getpropstr if (use default in absense of ch) 3 pick else over "filter1" getpropstr if swap "filter" 3 pick "s" strcat list-move () "subst" 3 pick "r" strcat list-move () swap 3 pick else (No old and no default) pop pop 0 exit then then then then then filtration swap pop 0 else dup " " instr dup if 1 - strcut 1 strcut swap pop else pop "" then swap dup "add" strcmp not if add-item exit then dup "take" strcmp not if take-item exit then dup "list" strcmp not if show-list exit then swap dup if " " swap else dup then strcat strcat 0 then ; 119 lines displayed. . c q @register #me Replace.Filter=tmp/prog1 @set $tmp/prog1=L @set $tmp/prog1=2 @propset $tmp/prog1=int:/.debug/errcount:1 @propset $tmp/prog1=int:/.debug/lastcrash:928863626 @propset $tmp/prog1=str:/.debug/lasterr:Replace.Filter(#70315), line 23; STRCUT: Argument must be a positive integer. @propset $tmp/prog1=str:/_/de:A scroll containing a spell called nothertest @propset $tmp/prog1=str:/_help/1#:1 @propset $tmp/prog1=str:/_help/1#/1:For full details, see sayhelp 4.