Closed rigrig closed 1 year ago
That's not possible since I handle the default lists in a generic manner. One option is:
#info configs save
#list info[CONFIGS] indexate arg1
#list info[CONFIGS] filter {SCREEN READER}
#var screen_reader $info[CONFIGS][1][arg2]
I've updated the beta to save the MTTS bitvector with #info session save.
https://tintin.mudhalla.net/protocols/mtts/
#info session save
#math screen_reader $info[SESSION][MTTS] & 64
Will set $screen_reader to 0 if disabled, 64 if enabled.
Thanks, I'm handling it in the script now, just figured it'd be easier if TinTin++ stored it in that format right away, but no need to mess up generic code for it ;-)
I'm not sure why I'd want the MTTS bitvector? It's really to check if the user of my script has enabled screenreader mode, so I can disable e.g. updating some status counters every second (as the screenreader would announce every update)
In case anybody else stumbles on this, I'm doing this now:
#info configs save;
#local configs {};
#foreach {*info[CONFIGS][]} num {
#local config $info[CONFIGS][$num];
#local key {$config[arg1]};
#local val {$config[arg2]};
#var configs[$key] {$val};
};
#var info[CONFIGS] $configs;
#unvar configs;
Giving
#var info;
#VARIABLE {info}
{
{CONFIGS}
{
{AUTO TAB} {5000}
{BUFFER SIZE} {10000}
{CHARSET} {UTF-8}
{COLOR MODE} {TRUE}
{COLOR PATCH} {OFF}
{COMMAND COLOR} {\e[0;37m}
{COMMAND ECHO} {ON}
{CONNECT RETRY} {0.0}
{HISTORY SIZE} {1000}
{LOG MODE} {RAW}
{MOUSE} {OFF}
{PACKET PATCH} {AUTO OFF}
{RANDOM SEED} {459926859}
{REPEAT CHAR} {!}
{REPEAT ENTER} {OFF}
{SCREEN READER} {OFF}
{SCROLL LOCK} {ON}
{SPEEDWALK} {OFF}
{TAB WIDTH} {8}
{TELNET} {ON}
{TINTIN CHAR} {#}
{VERBATIM} {OFF}
{VERBATIM CHAR} {\}
{VERBOSE} {OFF}
{WORDWRAP} {ON}
}
}
Alternatively:
#info configs save
#loop 1 &info[CONFIGS][] index #var info[CONFIGS][$info[CONFIGS][$index][arg1]] $info[CONFIGS][$index][arg2]
#unvar info[CONFIGS][%+1..d]
As for the MTTS bitvector, it contains whether #config screen_reader is on or off, as well as a few other things. I may add an event for #config calls so it's possible to maintain an up to date table.
Currently
#info configs save
stores configs as a numbered list:Could it maybe work just like
#info system save
?I'd like to check if
SCREEN READER
is enabled. I can loop over$info[CONFIGS]
, but it would be easier if$info[CONFIGS][SCREEN READER]
just worked.