[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Folder tree style editing of aliases/triggers
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Folder tree style editing of aliases/triggers

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


Posted by Gore   (207 posts)  [Biography] 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?
[Go to top] top

Posted by Shadowfyr   USA  (1,783 posts)  [Biography] 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? ;)
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] 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
[Go to top] 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.


5,405 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]