Thanks for your input. It helped me understand what those functions were there for ;-)
I didnt get it to work as I wanted. I did it like this:
Trigger(regexp):
\*(.*) (.*)\*(.*)has arrived from the (west|north|south|east)(.*)
And a script called OnArrive:
function OnArrive (strTriggerName, trig_line, wildcardsVB)
{
wildcards = VBArray(wildcardsVB).toArray();
race = wildcards[1]
from = wildcards[3]
from2 = from
if (race == "Elf") {
// change color inside * * to green
} else if (race == "Half-Elf") { // change color inside * * to green
} else if (race == "Man") {
// change color inside * * to blue
} else if (race == "Hobbit") {
// change color inside * * to cyan
} else if (race == "Dwarf") {
// change color inside * * to brown
}
// For all dirs change color ro bold red
if (from == "west")
from2 = "<<< WEST <<<";
else if (from == "east")
from2 = ">>> EAST >>>";
else if (from == "north")
from2 = "^^^ NORTH ^^^";
else if (from == "south")
from2 = "vvv SOUTH vvv";
else from2 = from;
world.note("*" + wildcards[0] + " " + race + "*" +
wildcards[2] + "has arrived from the " +
from2 + wildcards[4]);
}
So if I get "a man has arrived from the west" it just looks like the triggered line.
And if its "*an Elf* has arrived from the west" that is changed to "*an Elf* has arrived from the <<< WEST <<<"
But.. Now the tricky part. I included if parts for the different races because I like to color *an Elf* green, *a Man* blue and so on, AND the text showing where they went in high red. How can I in Jscript set colors for the different variables/strings? Can it be done?
Its a pk mud where the 'enemies' are surrounded by stars
For example: *an Elf* has arrived from the north.
or: *a noble Elf* has arrived from the north.
Because of the spam many enemies make I made a regexp trigger that triggers on that line looking like this:
\*(.*) Elf\* has arrived from the (.*).$
Now I only highlight elves in green, but I'd also like the
last argument to be parsed. My idea is to gag the oroginal line, and replace it with the follwing(in Green):
*an Elf* has arrived from the <<< WEST <<<
Can that be done? I'd like to use jscript for it if any script is needed.
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.