I was trying to write a trigger for coloring noob chat earlier and it seems that it doesn't like to detect angle braces. I tried standard
<Newbie>
and regex
\<Newbie\>
but I had no luck with either.
Later on I was coloring health reports and noticed that "is at death's door." was not being colored. I changed it to "is at death" and it started working.
So it looks like there may be some issues with triggers parsing non alphanumeric characters?
Not a huge issue, but kind of annoying.
Alias/Trigger non alphanum character issue
Moderator: Eowul
Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Re: Alias/Trigger non alphanum character issue
Currently the trigger receives the text as the html string that will be displayed in a <div>
This means that using html encoding is currently required.
Google html encoding for a full list of characters that will be changed.
This means that using html encoding is currently required.
Code: Select all
' = '
> = >
< = <
at death's door = at death's door
<Newbie> = <Newbie>
Re: Alias/Trigger non alphanum character issue
The info is appreciated. I do hope that it gets resolved soon though.
Re: Alias/Trigger non alphanum character issue
Okay, I'm running into this again.
I wrote this thing:
And it works in general, but I noticed that it wasn't triggering in battle on lines like this:
I wrote this thing:
Code: Select all
Name: <knife and coin>
Type: regexp
Pattern: .*?(kni|dirk|dagger|stiletto|coin).*
Execute the following javascript:
var str = args[0].replace(/(knife|knives|dirks|dirk|daggers|dagger|stilettos|stiletto)/gi, '<span style="background-color: rgb(40,40,40); color: magenta;">$1</span>');
str = str.replace(/(coins|coin)/g, '<span style="background-color: rgb(64,64,64); color: yellow;">$1</span>');
gwc.output.replace(args[0], str, true);
So I tested by repeating the line and it's the apostrophe that's causing the failure.You cut the watching small male orc's body with your jagged sharp knife.
Re: Alias/Trigger non alphanum character issue
That's some pretty funky alias writing.
Here's mine where I highlight newbie messages based on the user talking and add a timestamp instead of the "newbie" tab. Keep in mind this isn't going to be plug and play because I have base things saved in my userdata that you're obviously not going to have.
Pattern:
Code:
Here's mine where I highlight newbie messages based on the user talking and add a timestamp instead of the "newbie" tab. Keep in mind this isn't going to be plug and play because I have base things saved in my userdata that you're obviously not going to have.
Pattern:
Code: Select all
Newbie> (\w+).*:.*
Code: Select all
if ( args[1] !== undefined ){
//gwc.output.append( args.slice(1) );
if ( gwc.userdata.newbie_messenger_list === undefined ){
//Create the dictionary if it doesn't exist to house players:colors
gwc.userdata.newbie_messenger_list = {};
}
if ( gwc.userdata.newbie_messenger_list[ args[1] ] === undefined ){
//Add the person to the list and assign them a color after randomly selecting an unused one
gwc.userdata.newbie_messenger_list[ args[1] ] = gwc.userdata.random(gwc.userdata.colors);
}
//Now finally color the message accordingly
gwc.output.color( gwc.userdata.newbie_messenger_list[ args[1] ] );
}
var currentTime = new Date();
gwc.output.replace('Newbie', currentTime.getHours() + ':' + ( currentTime.getMinutes().toString().length > 1 ? '' : '0' ) + currentTime.getMinutes(), true);
if ( gwc.userdata.music.enabled ){
gwc.userdata.music.ding.play();
}
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/