Beginner coding help...

Posted by Keoke on Sat 01 Jan 2005 07:01 AM — 7 posts, 24,661 views.

#0
Ok, I haven't done much with scripts, so be gentle...

On Nodeka for a quest I was to collect several "souls", this involved killing MANY mobs. I wrote several triggers to "detect" when the mob was there and attack. Then I could just walk through the rooms.

Ok, so now I've moved all the triggers into a plugin using the plugin wizard, but how do I...make it work? I walk through the rooms, and the triggers no longer trigger. I'm sure this is simple, and I apologize the stupid question, but thanks in advance! :)

Keoke
#1
Have you loaded the plugin in the world via File->Plugins?
#2
Yes, loaded the plugin, message at the bottom said plugin loaded, and if I: File -> plugins, it's in the list.

I think I need some kind of "onsubload" type thing that tells it to go...

I thought it would be easier to move groups of triggers into various plugins that I could load/unload as I needed, instead of having a list of 50 triggers...

Keoke
#3
Here's the plugin:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Friday, December 31, 2004, 9:55 PM -->
<!-- MuClient version 3.64 -->

<!-- Plugin "Druid_Plugin" generated by Plugin Wizard -->

<muclient>
<plugin
name="Druid_Plugin"
author="*******"(edited)
id="*******"(edited)
language="VBscript"
purpose="To kill druids"
date_written="2004-12-31 21:51:28"
requires="3.64"
version="1.0"
>
<description trim="y">
<![CDATA[
This is for the druid area above Ruushii
]]>
</description>

</plugin>


<!-- Triggers -->

<triggers>
<trigger
enabled="y"
match="A human druid is examining some mold growing on the wall."
sequence="100"
>
<send>c 'mag arr' druid</send>
</trigger>
<trigger
enabled="y"
match="An academy druid falls to the ground! He is dead!"
sequence="100"
>
<send>c 'mag arr' druid</send>
</trigger>
<trigger
enabled="y"
match="An academy druid is here maintaining the courtyard."
sequence="100"
>
<send>c 'mag arr' druid</send>
</trigger>
<trigger
enabled="y"
match="*Three*"
sequence="100"
>
<send>c 'magic arrow' druid</send>
</trigger>
<trigger
enabled="y"
match="*[ Four ]*"
sequence="100"
>
<send>c 'magic arrow' druid</send>
</trigger>
<trigger
enabled="y"
match="*[ Two ]*"
sequence="100"
>
<send>c 'magic arrow' druid
</send>
</trigger>
</triggers>


<script>
<![CDATA[
Sub OnHelp (sName, sLine, wildcards)
world.Note world.GetPluginInfo (world.GetPluginID, 3)
End Sub
]]>
</script>

</muclient>
USA #4
You dont need anything that tells it to go. Being loaded is enough. You can load and unload it from the plugin screen. Obviously however, this takes a couple of clicks, so if you do need to enable/disable it quickly, you might think about adding an alias to do just that.

Do you have other triggers that match on these things?
If so, do they have 'keep evaluating' checked?
You might also want to add it to all of these (that way if you need to match on them later on, you still can).

Do you have scripting enabled? It shouldn't matter, but your plugin looks like everything should be working.

Do you have triggers enabled in your world? I dont think this matters either, but can't hurt to ask (It's on the bottom of the trigger page).
Australia Forum Administrator #5
I tried it and it seemed to work, for example:


A human druid is examining some mold growing on the wall.
c 'mag arr' druid


As Flannel said, make sure some other trigger isn't interfering. You can turn on Trace mode (Game menu) and then you should see something like this:


A human druid is examining some mold growing on the wall.
TRACE: Matched trigger "A human druid is examining some mold growing on the wall."
c 'mag arr' druid


This confirms what triggers are firing. If some other trigger got in first, you would see that.

And no, you don't need to "enable" plugins, installing them is enough.
#6
Thanks Guys, it works now!

Somehow during the process I disabled the triggers...didn't even think to check that! Thanks for the tip on the trace, I'll try that in the future as I work on things. :)

Keoke