@prog infix.filter.MUF 1 99999 d 1 i ( Random infix v2 By Warwick on FurryMUCK 30/7/93. ------------ Shoves ',,' into anywhere appropriate it can find in the message. Firstly just after '!', then '?', '.', ':', ';', ',' in order. At no time will a later punctuation mark {say ','} split in preference to an earlier one {eg '.'} unless the earlier one ends a message ` sayfilter split [prob] {maximum desired probability as a %age} ) : makeprop ( n db ch "prop/ch/n/" -- n db ch db "prop//" ) over "ch" subst 4 pick intostr "n" subst 3 pick swap ; : do-split ( message ", " -- message 0 ) ( -- message' 1 ) over over instr not if pop 0 exit then 0 swap 3 pick begin over over swap instr swap over if over 1 + strcut swap pop 4 pick 1 + 4 put then swap not until pop swap random swap 1 + % 1 + rot 3 pick explode begin dup 1 = not while dup 2 + pick over = if swap dup strlen if over 3 + pick 1 strcut pop dup "," strcmp not if pop "" then ",," strcat else swap over 3 + pick then strcat rot strcat swap 1 - else swap over 3 + pick strcat rot strcat swap 1 - then repeat pop swap pop swap pop dup ",," instr not if ",," strcat then 1 ; : start ( n db ch message -- n db ch message 0 ) ( -- n notify "" 1 ) command @ "sayfilter" stringcmp not if dup "split" 5 strncmp not if dup " " instr dup not if pop pop "_say/ch/n/split" makeprop getpropstr "RandomSplit: Split probability is nnn%" swap "nnn" subst 2 put pop else strcut swap pop atoi intostr -4 rotate "_say/ch/n/split" makeprop 6 rotate 0 addprop pop pop "RandomSplit: Split probability set." then "" 1 else 0 then exit then ( n db ch mess ) dup ",," instr if 0 exit then -4 rotate "_say/ch/n/split" makeprop getpropstr atoi dup not if pop 35 then 5 rotate random 100 % rot > if 0 exit then ( Will almost definitely split somewhere ) "! " do-split if 0 exit then "? " do-split if 0 exit then ". " do-split if 0 exit then ": " do-split if 0 exit then "; " do-split if 0 exit then ", " do-split if 0 exit then random 2 % if ",," strcat then 0 ; 71 lines displayed. . c q @register #me infix.filter.MUF=tmp/prog1 @set $tmp/prog1=L @set $tmp/prog1=2 @propset $tmp/prog1=int:/.debug/errcount:1 @propset $tmp/prog1=int:/.debug/lastcrash:855947973 @propset $tmp/prog1=str:/.debug/lasterr:infix.filter.MUF(#3971), line 31; +: Invalid argument type. @propset $tmp/prog1=str:/_/de:A scroll containing a spell called infix.filter.MUF @propset $tmp/prog1=str:/_help/1#:15 @propset $tmp/prog1=str:/_help/1#/1:------------------------------------------------------------------------- @propset $tmp/prog1=str:/_help/1#/10: You can increase the probability of a split occurring with: @propset $tmp/prog1=str:/_help/1#/11:` @propset $tmp/prog1=str:/_help/1#/12: sayfilter split @propset $tmp/prog1=str:/_help/1#/13:` @propset $tmp/prog1=str:/_help/1#/14:Enjoy. - Warwick. @propset $tmp/prog1=str:/_help/1#/15:` @propset $tmp/prog1=str:/_help/1#/2:` @propset $tmp/prog1=str:/_help/1#/3: Searches your speech for punctuation and sometimes inserts ',,' next to it @propset $tmp/prog1=str:/_help/1#/4: to split your text in a sensible place. @propset $tmp/prog1=str:/_help/1#/5:` @propset $tmp/prog1=str:/_help/1#/6: It prefers '?'s to '!'s, '!'s to '.'s, '.' to ':', ':' to ';', ';' to ',' @propset $tmp/prog1=str:/_help/1#/7: (Hope that's vaguely clear. Essentially, it tries to split at the stronger @propset $tmp/prog1=str:/_help/1#/8: punctuation more than at the weaker punctuation.) @propset $tmp/prog1=str:/_help/1#/9:`