Is there anychance someone has worked on an external executable that can do something like this?
Folder tree style editing of aliases/triggers
Posted by Gore on Fri 03 Aug 2007 10:28 AM — 4 posts, 23,170 views.
Well, there are some issue with that. The least being that once loaded into memory its not too easy to get the data, change it, put it back, then save it. Not mind you impossible, but you would have to step through the entire list of aliases and triggers, store them in the external application, send back any you made changes to, so they can be re-imported, then trigger a save of the world. It would probably be a whole lot easier to dispense with the external application and just add code to the existing client to support tree based lists. lol
Mind you, if someone did, it might be useful to allow different ways to reorder the tree, i.e., existing behavior, by group, or even by "type", as in ones that send to script, or omit, etc. After all, why take half measures if adding tree support could give you more than two ways to sort them? Well, other than that it takes some extra code, but since the method to do the sort would be nearly the same, just on a different field/setting, changing how sub categories are listed would be much easier once the initial tree function is available.
In any case, as I said, recoding the "internal" system is going to be just as hard as coding an external solution, probably harder, since Mushclient doesn't have any direct method to export an entire alias or trigger list to such an application, or get it back in. The only reason I can possibly see using one is if it *also* let you use the GUI to edit aliases, triggers and such *in plugins*, for which there currently is no decent editor to do that. And there isn't much reason to not, if you made the tree internal, to also add better support for plugins as well. Something like:
Mind you, working out how to handle saving the plugins, which Mushclient also doesn't support doing at the moment, would need to be solved, but its not any *worse* than trying to get a external application to do it, via one of the same plugins, or the main script file. Someone still has to write all the code to make it work, and its a bit silly, when the source is available, to do 2-3 times the work to make some external method of doing that. Or am I wrong for some reason? ;)
Mind you, if someone did, it might be useful to allow different ways to reorder the tree, i.e., existing behavior, by group, or even by "type", as in ones that send to script, or omit, etc. After all, why take half measures if adding tree support could give you more than two ways to sort them? Well, other than that it takes some extra code, but since the method to do the sort would be nearly the same, just on a different field/setting, changing how sub categories are listed would be much easier once the initial tree function is available.
In any case, as I said, recoding the "internal" system is going to be just as hard as coding an external solution, probably harder, since Mushclient doesn't have any direct method to export an entire alias or trigger list to such an application, or get it back in. The only reason I can possibly see using one is if it *also* let you use the GUI to edit aliases, triggers and such *in plugins*, for which there currently is no decent editor to do that. And there isn't much reason to not, if you made the tree internal, to also add better support for plugins as well. Something like:
|----------------------------|
|+Chat |
| |-group1 |
| |-^I saw fudge$ |
|----------------------------|
[|Plugins|v] [Edit]
|World |
|-------|Mind you, working out how to handle saving the plugins, which Mushclient also doesn't support doing at the moment, would need to be solved, but its not any *worse* than trying to get a external application to do it, via one of the same plugins, or the main script file. Someone still has to write all the code to make it work, and its a bit silly, when the source is available, to do 2-3 times the work to make some external method of doing that. Or am I wrong for some reason? ;)
I beg to differ about how difficult it would be to do this. If you are doing this for a file that isn't being used, it's a simple matter of reading and writing to the .mcl file. triggers and aliases are stored neatly in xml format.
For live editing, a plugin could be made to either put all the triggers and aliases into the clipboard for easy transfering, or speak to a plugin through COM.
For live editing, a plugin could be made to either put all the triggers and aliases into the clipboard for easy transfering, or speak to a plugin through COM.
Quote:
The least being that once loaded into memory its not too easy to get the data, change it, put it back, then save it.
The least being that once loaded into memory its not too easy to get the data, change it, put it back, then save it.
This code will get all triggers into XML format, same as in the MUSHclient world file:
tl = GetTriggerList ()
t = {}
if tl then
for k, v in ipairs (tl) do
table.insert (t, ExportXML (0, v))
end -- for
end -- at least one trigger
result = table.concat (t, "\n")
print (result)