Thank you all for the help. i ended up changing it again so that it matches on any scroll anywhere that is spelled correctly. I also had to change the data a bit so that I could match a, an, A, and An. didn't realize mush was so case-sensitive. here is the final
(?:.*|)\b(?:an|a|A|An)\b\s*\b(.*? scroll)\b
for the entire updated Materia Magica Scroll to Spell Translator please go here:
Amended on Wed 07 Jul 2010 04:51 AM (UTC) by Deacla
Message
Thinking on this further I found I could make it much simpler. I'm trying to get it to match on basically any string with the word scroll in it and match it against the database. this is what i got.
^(.*?)\s*((a|an)\s*(.*?))\s*scroll(.*)$
This still works in the inventory screen, and in bags as it did originally but no where else. How can I describe the following:
^(anything) ((a|an)scrolltype) scroll(anything)$
edit: it does work in some other strings, bot not all other strings.
@Nick: It is firing the trigger but I don't think the correct data is being sent to the ScrollTypes variable. so it doesn't append anything to the end.
Is that line wrapped/split into two lines when you see it in MUSHclient? If it is, do you know if the server is splitting it, or if MUSHclient is doing the wrapping?
If the server is splitting the line and sending it out that way, then MUSHclient gets it as two separate lines, meaning you need two separate triggers (or one multiline trigger) to match it. If possible, disable the server-side wrapping (you can always configure client-side wrapping in Game -> Configure -> Output) so MUSHclient gets it as one line.
Deacla said: If it would make it easier to keep the styles by appending the spellname all the way to the end as in this example:
A gnomish miner's bag contains:
( 7) a copper-colored scroll (new) IDENTIFY
( 20) a blackjack voucher notated with a little '500' (new)
a glossy lime scroll (new) ARMOR
( 2) an unusual swamp flower
a nightshade mushroom
an ivory-yellow papyrus scroll (new) BLINDNESS
a charcoal lambskin scroll (new) REVEAL
Yeah, that makes it much easier:
<triggers>
<trigger
enabled="y"
match="^((?:\(\s*\d+\))?\s*(.*?)\s*scroll)\s*(\(new\))$"
omit_from_output="y"
regexp="y"
send_to="14"
sequence="100"
>
<send>ScrollTypes = {
["a glossy lime"] = "ARMOR",
["an ivory-yellow papyrus"] = "BLINDNESS",
["a charcoal lambskin"] = "REVEAL",
["a copper-colored"] = "IDENTIFY",
}
for _,v in ipairs(TriggerStyleRuns) do
ColourTell(RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), v.text)
end
if ScrollTypes["%2"] then
ColourTell("silver", "black", "\t" .. ScrollTypes["%2"])
end
Note() -- finish the line</send>
</trigger>
</triggers>
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.