@program ansi-pose.muf 1 9999 d i ( ansi-pose.muf -- Wog@SPR This is a program that will process ansi escape codes and then poses them. Can be called from MPI, etc. For property info run with the argument #help. SETUP FOR NON-MPI USE: @action = me, NOTE: For those who do not want to see ansi-poses in there colors, they can '@set me=_prefs/apose/no_color?:yes'. --- Change History ---------------------------------- v 1.0 02/24/00 Assignment of version number to programs. v 1.1 Mar 05 2000 Modified program too prevent people from posing the escape sequence ~&B. Instead the message: just tried to make an annoying beep sound using ansi-pose. will posed. *evil grin* v 1.2 Mar 12 2000 Modified program to notify room too for _listeners. v 1.3 Mar 20 2000 Modified proggie to only do notifies on objects that are: - an awake player, or - a thing that is set _puppet?:yes, or ZOMBIE, or X_FORCEABLE, or a VEHICLE v 1.4 May 25 2000 Modified proggie to allow %n names. First 3 letters of %n name must match player name. v 1.5 7 May 2006 Add extra security to %n. First word cannot match a real player's name. {Thanks to Scribbles@SPR.} --- 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 ) $include $lib/ansi $undef .tell $def .tell ansi-tell : doHelp "~&120ansi-pose.muf -- by Wog@Sociopolitical Ramifications~&R" ansi-tell "~&150Options:" .tell "~&170 #help ~&060 this screen" .tell "~&150Properties: (on you)" .tell "~&170 _prefs/apose/%n-name?: ~&060 Set to 'yes' to use %n name. First three" .tell "~&060 letters must be the same as your 'real' name," .tell "~&060 and the first word cannot be the name of a " .tell "~&060 real player." .tell "~&170 _prefs/apose/namecolor:~&060 color of name" .tell "~&170 _prefs/apose/msgcolor:~&060 default (escape code changable) color" .tell "~&060 for the part of the pose after the name" .tell "~&160 Use the number part of an ansi-escape code to select that color " .tell "~&160 (Example: @set me=_prefs/apose/namecolor:060 to select Cyan for name)" .tell "~&160 Otherwise you can just pose ansi-escapes (like '~~&160&010')" .tell "~&060This program (#" prog intostr strcat ") can be called from MPI.~&R" strcat .tell ; (This will ansi_notify everything at location d, except for things who's owners are set _prefs/apose/no_color?:yes.) : notify-loop ( s d -- ) over over swap ansi-strip notify contents begin dup ok? while dup thing? if dup "Z" flag? over "X" flag? or over "_puppet?" getpropstr .yes? or over "V" flag? or else dup player? if dup awake? else 0 then then if dup dup owner "_prefs/apose/no_color?" getpropstr .yes? over owner "_prefs/apose/no_color?/" me @ owner strcat getpropstr .yes? if 3 pick ansi-strip notify else 3 pick ansi_notify then then next repeat ; : get-name me @ "_prefs/apose/%n-name?" getpropstr .yes? if me @ "%n" getpropstr dup not if pop me @ name exit then dup " " .split pop ansi_strip .pmatch if pop me @ name exit then tolower me @ name tolower 3 strncmp not if me @ "%n" getpropstr exit then then me @ name ; : main dup "~&B" instr if me @ name " just tried to make an annoying beep sound using ansi-pose." strcat me @ #-1 rot notify_except exit then dup not over "#help" strcmp not or if doHelp exit then me @ "/_prefs/apose/namecolor" getpropstr dup strlen 0 > if dup "~&" 2 strncmp if "~&" swap strcat then dup ansi-strlen 0 = not if "Error: namecolor prop invalid! Ignored." .tell pop "" then get-name strcat "~&R" strcat else pop get-name then swap ". ,':!?-" over 1 strcut pop instr not if " " swap strcat then (This stolen from cmd-newpose.muf by Raven) me @ "/_prefs/apose/msgcolor" getpropstr dup strlen 0 > if dup "~&" 2 strncmp if "~&" swap strcat then dup ansi-strlen 0 = not if "Error: msgcolor prop invalid! Ignored." .tell pop "" then else pop "" then swap strcat strcat "~&R" strcat me @ location notify-loop ; . c q