gui interface for plugin xml

Posted by Victorious on Fri 13 Dec 2013 01:18 PM — 2 posts, 13,636 views.

#0
Hi Nick

How difficult will it be to port the gui that you see when editing a trigger/alias/timer etc in world files so that it can edit plugin files?
Australia Forum Administrator #1
I've thought about this a few times, but the answer is that there is a problem. Plugins can have XML entities in them, like this:


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



These are substituted into things like triggers, aliases, timers at load time, for example:


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


So by the time the client sees that timer it would read:


<timers>
  <timer 
	  name="RandomSocial" 
	  script="DoRandomSocial" 
	  enabled="y" 
	  second="30" 
	>
  </timer>
</timers>
<script>


Now if that got saved back after editing it no longer uses "&timer_interval;" but uses "30" instead as the number of seconds to wait.

If this aspect doesn't bother you, a work-around would be to copy the thing you want to edit back into the main world (eg. between <timers> ... </timers> ) and then edit it in the GUI, then copy that timer, and paste back over the one in the plugin.

Failing that, the source code is publicly available, if you want to write your own. The format is pretty straight-forward (XML like above). You could write your own editor using whatever GUI interface you like.