Mercurial > hg > batmud > ggrtf
changeset 342:8f82c9f61ae5
v0.5.10.8: Added command for listing all defined bindings, "/binds".
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 10 Mar 2006 00:49:03 +0000 |
parents | 141124235c3c |
children | 02fbd1028a27 |
files | ggrtf.tf |
diffstat | 1 files changed, 36 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/ggrtf.tf Fri Mar 10 00:18:57 2006 +0000 +++ b/ggrtf.tf Fri Mar 10 00:49:03 2006 +0000 @@ -1,8 +1,8 @@ ;; -;; GgrTF v0.5.10.7-svn - TinyFugue script for BatMUD +;; GgrTF v0.5.10.8-svn - TinyFugue script for BatMUD ;; (C) Copyright 2004-2006 Matti Hämäläinen (Ggr Pupunen) ;; -/set ggrtf_ver=0.5.10.7-svn +/set ggrtf_ver=0.5.10.8-svn ;; ;; This triggerset is Free Software distributed under ;; GNU General Public License version 2. @@ -471,6 +471,9 @@ /def -i prdefgbind =\ /if (!getopts("s:c:m", "")) /gerror Invalid bind creation command!%;/break%;/endif%;\ /if (!prlist_insert("lst_bindings", opt_s)) /gwarning Binding for '%{opt_s}' already defined!%;/endif%;\ + /set bind_%{opt_s}_n=2%;\ + /set bind_%{opt_s}_t=G%;\ + /set bind_%{opt_s}_c=%{opt_c}%;\ /if (opt_m) /let _qmatch=-mregexp%;/else /let _qmatch=%;/endif%;\ /eval /def -i %{_qmatch} -h"SEND {%{bind_prefix}%{opt_s}}" bind_%{opt_s} = %{opt_c} @@ -482,13 +485,17 @@ ; -d"<message>" Use non-default message for reporting ; -q Quiet (no reporting) /def -i prdefsbind =\ - /if (!getopts("s:c:d:nq", "")) /gerror Invalid bind creation command!%;/break%;/endif%;\ + /if (!getopts("s:c:m:d:nq", "")) /gerror Invalid bind creation command!%;/break%;/endif%;\ /if (!prlist_insert("lst_bindings", opt_s)) /gwarning Binding for '%{opt_s}' already defined!%;/endif%;\ + /set bind_%{opt_s}_t=S%;\ + /set bind_%{opt_s}_c=%{opt_c}%;\ /let _qs=$[tolower(opt_c)]%;\ /if (opt_d!~"") /let _qm=%{opt_d}%;/else /let _qm=%{opt_c}%;/endif%;\ /if (opt_n)\ + /set bind_%{opt_s}_n=0%;\ /let _qw=%{_qm} ...%;\ /else \ + /set bind_%{opt_s}_n=1%;\ /let _qw=%{_qm} -> %%%2%;\ /let _qs='%{_qs}' %%%2%;\ /endif%;\ @@ -506,11 +513,15 @@ /def -i prdefcbind =\ /if (!getopts("s:c:d:nq", "")) /gerror Invalid bind creation command!%;/break%;/endif%;\ /if (!prlist_insert("lst_bindings", opt_s)) /gwarning Binding for '%{opt_s}' already defined!%;/endif%;\ + /set bind_%{opt_s}_t=C%;\ + /set bind_%{opt_s}_c=%{opt_c}%;\ /let _qs=$[tolower(opt_c)]%;\ /if (opt_d!~"") /let _qm=%{opt_d}%;/else /let _qm=%{opt_c}%;/endif%;\ /if (opt_n)\ + /set bind_%{opt_s}_n=0%;\ /let _qw=%{_qm} ...%;\ /else \ + /set bind_%{opt_s}_n=1%;\ /let _qw=%{_qm} -> %%%2%;\ /let _qs='%{_qs}' %%%2%;\ /endif%;\ @@ -523,11 +534,30 @@ /endif +;; List bindings +/def -i gbindings_dolist =\ +/while ({#})\ + /eval /set qtval_t=$$[bind_%{1}_t]%;\ + /eval /set qtval_c=$$[bind_%{1}_c]%;\ + /eval /set qtval_n=$$[bind_%{1}_n]%;\ + /if (qtval_n==0) /let _ttc=Cred%;/let _tt=No%;\ + /elseif (qtval_n==1) /let _ttc=Cgreen%;/let _tt=Yes%;\ + /else /let _ttc=Ccyan%;/let _tt=?%;/endif%;\ + /if (qtval_t=~"G") /let _tc=BCred%;\ + /elseif (qtval_t=~"S") /let _tc=BCgreen%;\ + /elseif (qtval_t=~"C") /let _tc=BCcyan%;\ + /else /let _tc=%{BCwhite}%;/endif%;\ + /msw | @{BCyellow}$[prsubipad({1},14)]@{n} | @{%{_tc}}%{qtval_t}@{n} | @{BCmagenta}$[prsubipad(qtval_c,40)]@{n} | @{%{_ttc}}$[pad(_tt,3)]@{n} |%;\ + /shift%;\ +/done + + /def -i binds =\ -/msw ,------------------.%;\ +/msw ,----------------.%;\ /msw | @{BCgreen}GgrTF@{n} @{Cyellow}Bindings@{n} |%;\ -/msw +------------------+-------------------------------------------------.%;\ -/msw `--------------------------------------------------------------------' +/msw +---------------------------------------------------------------------.%;\ +/gbindings_dolist %{lst_bindings}%;\ +/msw `---------------------------------------------------------------------' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;