Mix of the new Multi-line triggers w/Partial Line plugin

Posted by Gore on Mon 31 May 2004 11:59 PM — 2 posts, 14,268 views.

#0
Hello, I'm trying to mix up the partial line plugin with the new multi-line triggers. here's what I have so far:


<?xml version="1.0" encoding="US-ASCII"?>

<!DOCTYPE muclient [
  <!ENTITY regexp_match_ginseng 
   "You eat a ginseng root\.\n(.*?)h\, (.*?)m (.*?)\-\n$" 
  > 
]>

<muclient>
<plugin
   name="Status_Bar_Prompt"
   author="Nick Gammon (original), Modified by Matt"
   id="ff9331b06c15ab21046be001"
   language="VBscript"
   purpose="Testing the use of multi-line triggers including a prompt"
   date_written="2004-02-13 16:41:24"
   requires="3.50"
   version="1.0"
   >

</plugin>
<script>
<![CDATA[
sub OnPluginPartialLine (sText)
  Dim regEx, Matches, Match
  Set regEx = New RegExp
]]>

  regEx.Pattern = "&regexp_match_ginseng;"

<![CDATA[
  Set Matches = regEx.Execute (sText)
  If Matches.Count = 0 then  
    Set regEx = Nothing
    Set Matches = Nothing
	exit sub
  End If
  Set Match = Matches.Item (0)
  Set regEx = Nothing
  Set Matches = Nothing
  World.Send "say it's just an illusion!"
  Set Match = Nothing
end sub
]]>
</script>
</muclient>



The output will be:

1983h, 2054m ex-

Then when I eat the ginseng, it'll be

1983h, 2054m ex-You eat a ginseng root.
1983h, 2054m ex-

Any suggestions?
Australia Forum Administrator #1
It isn't clear what you are asking.

You talk about the multi-line triggers but don't appear to be using them. To get the recent lines (eg. for a multi-line trigger) you want world.GetRecentLines.

Why do you want multi-line triggers, and in what way is what you have not working?