Multi-Line-Capture

Posted by ZPY on Tue 19 Apr 2005 10:59 PM — 3 posts, 15,916 views.

#0
Hi, im new in using Mushclient.
Great Client though.

Well Here's my problem.
I wanna capture my 'tells' in a specific window.
I gotta Plugin from a friend, but its only captureing single line tells.

Like this: (the tells looks exactly like this in the mud)
Dronur tells you, "I really don't know"

But if its a long tell it becomes two lines, and then its not working

Like this:
Dronur tells you, "I really don't know, ye gotta find that
out somehow by yer self, sorry can't
help you"

And I want it to Caputre the whole tell.
I really hope someone can help me with this.

My plugin looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>
<!-- Saved on Saturday, November 01, 2003, 3:12 PM -->
<!-- MuClient version 3.42 -->

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

<muclient>
<plugin
name="Tell_Capture"
author="Pavo"
id="59d5bca4fb67f61c54534a4f"
language="VBscript"
purpose="Capture your tells and put it in a notepad window"
save_state="y"
date_written="2003-11-01 15:09:40"
requires="3.42"
version="1.0"
>

</plugin>


<!-- Get our standard constants -->

<include name="constants.vbs"/>

<!-- Triggers -->

<triggers>
<trigger
enabled="y"
lines_to_match="3"
match="^(.+) (say|says|tells|asks|tell|ask) (.*), &quot;rockers (.*)\&quot;$\Z"
multi_line="n"
name="lblTells"
omit_from_output="y"
regexp="y"
script="doRockers"
sequence="1"
other_text_colour="black"
other_back_colour="black"
>
</trigger>
<trigger
enabled="y"
lines_to_match="2"
match="^(.+) (tells|asks|tell|ask) (.*), &quot;(.*)\&quot;$\Z"
multi_line="n"
omit_from_output="n"
regexp="y"
script="dotell"
sequence="2"
other_text_colour="black"
other_back_colour="black"
>
</trigger>
</triggers>

<!-- Script -->


<script>
<![CDATA[
sub OnWorldOpen
'world.note "---------- World Open ------------"
end sub

sub OnWorldClose
'world.note "---------- World Close ------------"
end sub

sub OnWorldConnect
'world.note "---------- World Connect ------------"
end sub

sub OnWorldDisconnect
'world.note "---------- World Disconnect ------------"
end sub

sub OnWorldGetFocus
'world.note "---------- World Got Focus ------------"
end sub

sub OnWorldLoseFocus
'world.note "---------- World Lose Focus ------------"
end sub

'------------------------------------------------------------
'
'------------------------------------------------------------
sub DoRockers (name, output, argv)

Dim teller

teller = argv(1)

if (teller = "You") then
teller = "Koodongan"

end if
world.ColourTell "silver", "", "["
world.ColourTell "gray", "", "Rockers"
world.ColourTell "silver", "", "]"
world.ColourTell "yellow", "", " "& teller &":"
world.ColourTell "red", "", " "& argv(4) &"" + vbcrlf
world.AppendToNotepad "Tells", FormatDateTime (Now, vbShortTime) & " : " & "[Rockers] "& teller &": "& argv(4) &"" + vbcrlf
end sub
'------------------------------------------------------------
'
'------------------------------------------------------------
sub DoTell (name, output, argv)
world.AppendToNotepad "Tells", FormatDateTime (Now, vbShortTime) & ": " & ""& argv(1) &" "& argv(2) &" "& argv(3) &": "& argv(4) &" "& argv(5) &"" + vbcrlf
End sub
'------------------------------------------------------------
'
'------------------------------------------------------------

]]>
</script>


</muclient>


Poland #1
what can I do to use both of:

omit_from_output="y"
multi_line="y"

lines_to_match="2"
match="^(?:&gt; )?(?:([A-Z][a-z]*(?: \w*){0,3})\.\n)?(?:Sa|Jest) tutaj (.*) widoczn(?:e|ych) wyjsc(?:ia|ie)?\: (.*)\.\Z"

i cannot gag location name and exits
(first line: location name starting with [A-Z] ending with \.) and no more than 4 words
and second line is much better for capture:

Australia Forum Administrator #2
Multi-line triggers cannot directly omit from output, however you can do it with a bit of scripting.

First, make the trigger call a script in your script file (which you need to create if you don't have one in the Scripting configuration), like this:



<triggers>
  <trigger
   enabled="y"
   lines_to_match="2"
   match="^(?:&gt; )?(?:([A-Z][a-z]*(?: \w*){0,3})\.\n)?(?:Sa|Jest) tutaj (.*) widoczn(?:e|ych) wyjsc(?:ia|ie)?\: (.*)\.\Z"

   multi_line="y"
   regexp="y"
   script="mytrigger"
   sequence="100"
  >
  </trigger>
</triggers>


Now in your script file you can delete two lines (which hopefully will be the ones that just matched), like this:


function mytrigger (name, line, wildcards)
  DeleteLines (2)
end -- mytrigger 


See: http://www.gammon.com.au/scripts/doc.php?function=DeleteLines