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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Suggestions ➜ Plugin editor dialog

Plugin editor dialog

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


Posted by Twisol   USA  (2,257 posts)  Bio
Date Tue 21 Jul 2009 07:40 PM (UTC)

Amended on Tue 21 Jul 2009 07:54 PM (UTC) by Twisol

Message
I think it would be incredibly useful to have a dedicated dialog for editing plugins, rather than having to edit its XML file. It would be much easier to add/modify elements; for example, I often find myself making a dummy trigger with the options I want just so I can copy it into my plugin.

I imagine it would be similar to the current configuration dialog, except limited to sections pertaining to the plugin. It would also be really nice to have a script section where you can modify the script segment.


Uhh, I'm not really running at full speed here, so I'll leave it there. I'll probably respond a bit more adequately to later questions/comments/rebukes. :P


EDIT: Couldn't the Plugin Wizard dialog be modified to allow this kind of editing? =/

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 22 Jul 2009 03:52 AM (UTC)

Amended on Wed 22 Jul 2009 03:53 AM (UTC) by Nick Gammon

Message
Good idea in principle. :)

One problem is that plugins can use MXP entities at the start, for example:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient [
  <!ENTITY socials_command "socials" > 
  <!ENTITY end_socials_regexp "\&gt;" > 
  <!ENTITY timer_interval "30" > 
]>



Now if the code that read in the plugin interpreted those entities, then they are effectively thrown away when you save again (eg. &timer_interval; would be replaced by 30, and then 30 gets saved and not &timer_interval;).

However if they are *not* interpreted, then something like this wouldn't load:


<timers>
  <timer 
	  name="RandomSocial" 
	  script="DoRandomSocial" 
	  enabled="y" 
	  second="&timer_interval;" 
	>
  </timer>
</timers>


It would complain that "second field is not numeric" or some such thing.

I agree it would make modifying things like triggers easier, however most stuff is pretty simple (eg. you can easily tell which is the "match" field).

For more complicated things I usually do what you have said, make a trigger in any world window, copy it, delete it, and then paste the resulting XML code into my plugin.

It could be done, I just don't know if I have the energy to do it.

What you might be able to do, which would dummy-up most of that functionality, would be to have some script that:



  • Takes a requested plugin file

  • Strips out the <plugin> .. </plugin> stuff (and saves it somewhere, eg. in a SQLite database)

  • Adds in some <world> .. </world> stuff so that it looks like a world file.

  • Copies the <script> .. </script> stuff into a separate file.

  • Saves the resulting file.


This resulting file would look like a world file (with the script in the script file). You could then open that under a new copy of MUSHclient, and edit everything in the GUI interface in the usual way.

Then you would either simply make a new plugin with the plugin wizard, or have another script to reverse the process, effectively doing what the plugin wizard does anyway.

- 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.


7,547 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.