Shadowfyr made a suggestion in this thread: http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=6468
Basically it was to have a method of filtering the entries shown in trigger (etc.) lists in the MUSHclient GUI.
I have added that capability into version 3.75. It is especially intended for users that have hundreds of items, and under some circumstances it can be tedious to locate a particular item (eg. a single trigger that has a missing subroutine in the script file).
For example, he wanted to find triggers that did a "send to script". He suggested some sort of dialog box with lots of options on it, but I couldn't see how that could work in more complex examples (eg. send to script *and* enabled) so I thought it would be easier if you could simply script the condition.
How it works is you provide a filter function written in Lua (regardless of whatever your scripting language for your main world file is, if any). This is provided the key for each item (eg. trigger name). You then do GetTriggerInfo (GetAliasInfo etc.) to find details about that item and decide whether or not to show it. For example, to find all triggers that did a "send to script" ...
This returns true if "send to" field is 12 (script).
Now you can make more complex checks by using a longer "if" statement. For example, this will show items which are send to script AND enabled:
In the variables list you might filter out by name or content. Here is an example of only displaying MXP variables:
Another example, this filters out so that only aliases which had a bad script name are shown:
Basically it was to have a method of filtering the entries shown in trigger (etc.) lists in the MUSHclient GUI.
I have added that capability into version 3.75. It is especially intended for users that have hundreds of items, and under some circumstances it can be tedious to locate a particular item (eg. a single trigger that has a missing subroutine in the script file).
For example, he wanted to find triggers that did a "send to script". He suggested some sort of dialog box with lots of options on it, but I couldn't see how that could work in more complex examples (eg. send to script *and* enabled) so I thought it would be easier if you could simply script the condition.
How it works is you provide a filter function written in Lua (regardless of whatever your scripting language for your main world file is, if any). This is provided the key for each item (eg. trigger name). You then do GetTriggerInfo (GetAliasInfo etc.) to find details about that item and decide whether or not to show it. For example, to find all triggers that did a "send to script" ...
function filter (s)
return GetTriggerInfo (s, 15) == 12
end -- filter
This returns true if "send to" field is 12 (script).
Now you can make more complex checks by using a longer "if" statement. For example, this will show items which are send to script AND enabled:
function filter (s)
return GetTriggerInfo (s, 15) == 12 and -- send to script
GetTriggerInfo (s, 8) -- enabled
end -- filter
In the variables list you might filter out by name or content. Here is an example of only displaying MXP variables:
function filter (s)
return string.find (s, "^mxp_") ~= nil
end -- filter
Another example, this filters out so that only aliases which had a bad script name are shown:
function filter (s)
return not GetAliasInfo (s, 27) and -- script not found
GetAliasInfo (s, 3) ~= "" -- but name given
end -- filter