Jonathin
Sep 9 2009, 03:46 AM
CODE
#CLASS {InfoHere}
#ALIAS ih {~ih;#t+ ihtrig1}
#REGEX "ihtrig1" {^([a-zA-Z,'-]+\d+)\s+([\w ,'-]+)$} {#sub {<send "probe %1%2|get %1%2|t %1%2" "Probe It|Get it|Target it">%1%2</send>%3%4}} "" {disable}
#REGEX {^Number of objects\: (\d+)$} {#t- ihtrig1}
#CLASS 0
Left click is to probe it, right click for more options.
The only way it works is if you use IH, not info here.
Sena
Sep 9 2009, 03:58 AM
^(\a+)(\d+)(\s+)(.+?)$ won't match everything, there are a few items and denizens that use special characters in the ID. What I use is ^([a-zA-Z,'-]+\d+)\s+([\w ,'-]+)$
Jonathin
Sep 9 2009, 03:59 AM
Ahh, sweet. Thanks. I'll change that around.
Jonathin
Sep 9 2009, 04:18 AM
Okay, I still don't get this.
How do I make a trigger match a list that may be singular
Onething
or plural
onething, onething, onething
Sena
Sep 9 2009, 04:25 AM
It depends on the context, really. ^((?:onething, )*onething)$ will match "onething", "onething, onething", "onething, onething, onething", etc.. If you don't care about actually capturing it, and you just want to match it:
CODE
^(?:(:, )?onething)+$
should work. Or you could just use .+ to match anything, and sort out the list in the script.
Jonathin
Sep 9 2009, 04:29 AM
Well, all I'd need is to match the names from who here.
Sena
Sep 9 2009, 04:34 AM
I'd go with either ^([\w, ]+)$ or ^((?:\w+, )*\w+)$ then.
Kateb
Sep 9 2009, 04:48 AM
I changed the IH to what Sena said originally, and it screwed up the underlining and underlined everything and squished the ID number and name together. Any suggestions?
Sena
Sep 9 2009, 04:56 AM
Oops, sorry about that. If you use the pattern I gave without changing the script, it won't work properly. My pattern captures it into two groups, instead of four. ^([a-zA-Z,'-]+)(\d+)(\s+)([\w ,'-]+)$ should match the original script.
Jonathin
Sep 9 2009, 11:34 PM
This one is for messages.
CODE
#CLASS {Messages}
#REGEX {^\*{30}\[ Message Summary \]\*{30}$} {#t+ messagetrig1;#t+ messagetrig2}
#REGEX "messagetrig1" {^(p|)(\s+)(\d+)(\*|)(\s+)(\a+)(\s+)(.+?)(\s+)(.*)$} {#sub {%1%repeat(" ",%eval(6-%len(%3)-%len(%1)))<send "rmsg %3|delmsg %3|msg preserve %3|msg unpreserve %3" "Read it|Delete it|Preserve it|Unpreserve it">%3%4%5%6</send>%7%8%9%10}} "" {disable}
#REGEX "messagetrig2" {\*{79}} {#t- messagetrig1;#t- messagetrig2} "" {disable}
#CLASS 0
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.