Trying to implement INCLUDE file.

Posted by Magnum on Wed 03 Jul 2002 06:58 PM — 4 posts, 19,399 views.

Canada #0
What am I doing wrong here?
Main .MCL file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>
<!-- Saved on Wednesday, July 03, 2002, 2:46 PM -->
<!-- MuClient version 3.23 -->
<!-- Written by Nick Gammon  -->
<!-- Home Page: http://www.muclient.com/ -->
<muclient>
<include name="E:\User\Magnum\MUSHclient\Worlds\- Defaults -\Magnum Script Tools.xml" />
<world
   muclient_version="3.23"
   world_file_version="15"
   date_saved="2002-07-03 14:46:52"

yadda, yadda

Include file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient []>

<!--	===============================================================
		SCRIPT TOOLS

		This include file is a library of assorted script subroutines
		that are general purpose, and may be called from a variety of
		plugins.

		=========================================================== -->

<muclient>
<script>
<![CDATA[

My old script file in here.

]]>
</script>
</muclient>

Error window:

Line   14: Tag not used: <script> (muclient)

How am I supposed to arrange the tags so this will work?
Amended on Wed 24 Sep 2003 02:00 AM by Nick Gammon
Australia Forum Administrator #1
This would not work even without the include directive.

The main problem here is that a world file does not have a <script> tag associated with it (scripts have to be in the external script file).

To achieve the basic idea you need to make a "general subs" plugin, then the script tag will be accepted as part of the plugin.

Then you need to ensure that the 'general' plugin is there when the plugins that rely on it are installed. For instance, in the "install" sub you could check it was there, or simply load it.
Canada #2
Ack, Ok this doesn't help me. It's basically the same as making the script a plugin itself, which doesn't work well because calling subroutines in a plugin is not practical. I'll have to resort to copying the script I want to each plugin that will use it.
Australia Forum Administrator #3
Quote:

I'll have to resort to copying the script I want to each plugin that will use it.


Well, that is only one line in each plugin that needs it, that isn't too bad.