@program OOCSayPose.muf 1 9999 d i ( OOCSayPose.muf by Wog An Out of Charactor Pose/Say program. Uses Warwick's say _say/def/osay and _say/def/say or _say//say and _say//osay, but prefixes string with Will not evaluate Warwick's say filters, or ,, splitting, however. {Hey, I'm not re-writing the whole say program!} Other props: /on trigger:/ _cmd/: Controls what does; 'p' to pose, 's' to say, 'a' determines what to do automatically. {Poses on ':' or ';', otherwise say}. --- Change History ---------------------------------- v 1.0 02/24/00 Initial Release. v 1.0.1 06/28/00 Fix problem with captilized command names. v 1.1 10/08/00 Allowed actions which are ``automatic'' as to whether to say or pose. v 1.1.1 18 Nov 2000 Typo fix. --- Distrubution Information ------------------------ Copyright {C} Charles "Wog" Reiss This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or {at your option} any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. For a copy of the GPL: a> see: http://www.gnu.org/copyleft/gpl.html b> write to: the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ) : format ( s -- s' ) " " swap strcat ; : charSub ( s -- s' ) "sl" "/" subst "co" ":" subst "tw" "~" subst "at" "@" subst ; : findSayPropdir ( s -- s i ) (Returnsnot string if none) ( i = 1 if there is some special setting for first char. ) (Takes first char of say and finds the propdir to get props from.) charSub "_say/" swap strcat dup me @ swap propdir? not if pop me @ "_say/def" propdir? if "_say/def/" 0 else "" 0 then else "/" strcat 1 then ; : mePropDefault ( prop default -- string ) swap me @ swap getpropstr dup if swap pop else pop then ; : takeCareOfComma ( s -- s' ) (Adds comma to end of string.) dup dup strlen 1 - strcut swap pop "," strcmp (as in doesn't match) if "," strcat then ; lvar tmp1 lvar tmp2 : sayize ( s -- osay say ) (Returns 'says, "...."' string ) dup 1 strcut pop findSayPropdir if (Special setting....?) swap 1 strcut swap pop swap then dup "quotes" strcat "\"%m\"" mePropDefault rot "%m" subst ( propdir quoted ) over "osay" strcat "says" mePropDefault takeCareOfComma " " strcat me @ name " " strcat swap strcat over strcat format tmp1 ! over "say" strcat "say" mePropDefault takeCareOfComma " " strcat "You " swap strcat over strcat format tmp2 ! pop pop tmp1 @ tmp2 @ ; : doSay ( s -- ) sayize .tell .otell ; : doPose ( s -- ) "':!-? .,;" over 1 strcut pop instr not if " " swap strcat then me @ name swap strcat format me @ location #-1 rot notify_except ; : actionType ( returns 1 -> say; 2 -> pose; or 0 -> auto ) command @ tolower command ! trigger @ "_cmd/" command @ strcat getpropstr dup if dup "s" 1 strncmp not if pop 1 exit then dup "p" 1 strncmp not if pop 2 exit then else pop command @ "p" instr if 2 exit then command @ "s" instr if 1 exit then then 0 ; : doHelp "--[ OOCSay/Pose by Wog v1.1.1 ]-----------------------------------------" .tell " This is just a simple program to do saying and posing prefixed" .tell "with on the line." .tell " Okie, maybe it's not so simple, it will take care of Warwick's" .tell "say style quotes and says and osays, even if they aren't the default" .tell " But, it will not do Warwick's say style splitting, or adhoc verbs." .tell "--[ What does this command do? ]----------------------------------------" .tell actionType dup not if pop "This command will do a say unless you give it something starting with" .tell "a ':' or a ';' in which case it will do a pose." .tell else 1 = if "This particular command will do an OOC say." .tell else "This particular command will do an OOC pose." .tell then then "------------------------------------------------------------------------" .tell ; : main ( s -- ) "me" match me ! (No posing for others!) dup not over "#help" stringpfx or if doHelp exit then actionType dup not if pop dup ":" 1 strncmp not over ";" 1 strncmp not or if 1 strcut swap pop 2 (pose) else 1 (say) then then dup if 1 = if doSay else doPose then exit then ; . c q @set OOCSayPose.muf=VIEWABLE