;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; destlist.tf ;; Written by: Hair@BatMUD /REQUIRE textutil.tf ;; Change this path to reflect the location of the db file /SET DESTFILE=/home/hair/tf-dir/destlist.txt ;; Read in any string, check its color, if monster colored, look it up ;; Then report /DEF -F -i -mregexp -t"^([A-Za-z,. \'-\(\)!]+)$" dester_substitution = \ /LET _mobName=%{P1} %;\ /LET _mobColor=$[encode_attr({P1})] %; \ ;; Change the colors here to reflect your own aggro/passive mob colors /IF (!regmatch("^@{B?C(green|red)}.+@{n}$", %{_mobColor} ) ) \ /return 0 %; \ /ELSE \ /LET _mobNameSearch=$[replace(" ", "_", %{_mobName})] %; \ /LET _mobNameSearch=$[replace("(", "\(", %{_mobNameSearch})] %; \ /LET _mobNameSearch=$[replace(")", "\)", %{_mobNameSearch})] %; \ /LET _mobFull=$(/readfile %{DESTFILE} %| /FGREP %{_mobNameSearch}) %; \ /IF (!(%{_mobFull} =~ "") ) \ /LET _destType=$(/nth 2 %{_mobFull}) %; \ /SUBSTITUTE -p %{_mobName} @{BCbgred,Cwhite}%{_destType}@{n} %; \ /ENDIF %; \ /ENDIF