Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ Programming
➜ General
➜ Multi-Line-Capture
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| ZPY
(1 post) Bio
|
Date
| Tue 19 Apr 2005 10:59 PM (UTC) |
Message
| 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) (.*), "rockers (.*)\"$\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) (.*), "(.*)\"$\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>
| Top |
|
Posted by
| Mastarck
Poland (2 posts) Bio
|
Date
| Reply #1 on Wed 12 Mar 2008 10:59 PM (UTC) |
Message
| what can I do to use both of:
omit_from_output="y"
multi_line="y"
lines_to_match="2"
match="^(?:> )?(?:([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:
| Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #2 on Thu 13 Mar 2008 05:00 AM (UTC) Amended on Thu 13 Mar 2008 05:01 AM (UTC) by Nick Gammon
|
Message
| 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="^(?:> )?(?:([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
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
11,510 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top