Help - Search - Members - Calendar
Full Version: Ih Mxp Script
Achaea's Forums > Off-Topic > Tech Support > Curing Systems and Scripts
Jonathin
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
^(\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
Ahh, sweet. Thanks. I'll change that around.
Jonathin
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
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
Well, all I'd need is to match the names from who here.
Sena
I'd go with either ^([\w, ]+)$ or ^((?:\w+, )*\w+)$ then.
Kateb
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
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
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.
Invision Power Board © 2001-2009 Invision Power Services, Inc.