Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ General ➜ Folder tree style editing of aliases/triggers

Folder tree style editing of aliases/triggers

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Gore   (207 posts)  Bio
Date Fri 03 Aug 2007 10:28 AM (UTC)
Message
Is there anychance someone has worked on an external executable that can do something like this?
Top

Posted by Shadowfyr   USA  (1,788 posts)  Bio
Date Reply #1 on Sat 04 Aug 2007 12:49 AM (UTC)
Message
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:

|----------------------------|
|+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? ;)
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #2 on Sat 04 Aug 2007 03:50 AM (UTC)
Message
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.

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Nick Gammon   Australia  (23,120 posts)  Bio   Forum Administrator
Date Reply #3 on Sat 04 Aug 2007 04:29 AM (UTC)
Message
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.


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)


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


17,949 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.