|
1 |
| -// ChatSetAttr version 1.2.1 |
2 |
| -// Last Updated: 2017-01-30 |
| 1 | +// ChatSetAttr version 1.2.2 |
| 2 | +// Last Updated: 2017-03-28 |
3 | 3 | // A script to create, modify, or delete character attributes from the chat area or macros.
|
4 | 4 | // If you don't like my choices for --replace, you can edit the replacers variable at your own peril to change them.
|
| 5 | + |
5 | 6 | var chatSetAttr = chatSetAttr || (function () {
|
6 | 7 | 'use strict';
|
7 |
| - const version = '1.2', |
| 8 | + const version = '1.2.2', |
8 | 9 | schemaVersion = 3,
|
9 | 10 | replacers = [
|
10 | 11 | ['<', '[', /</g, /\[/g],
|
@@ -486,12 +487,12 @@ var chatSetAttr = chatSetAttr || (function () {
|
486 | 487 | // an expression of the form key|value or key|value|maxvalue
|
487 | 488 | // replace - true if characters from the replacers array should be replaced
|
488 | 489 | // Output: Object containing key|value for all expressions.
|
489 |
| - let setting = args.map(str => str.split(/(\\?(?:#|\|))/g)) |
490 |
| - .map(function (split) { |
491 |
| - return split.reduce(function (m, str) { |
492 |
| - if ((str === '#' || str === '|')) m[m.length] = ''; |
493 |
| - else if ((str === '\\#' || str === '\\|')) m[m.length - 1] += str.slice(-1); |
494 |
| - else m[m.length - 1] += str; |
| 490 | + let setting = args.map(function (str) { |
| 491 | + return str.split(/(\\?(?:#|\|))/g) |
| 492 | + .reduce(function (m, s) { |
| 493 | + if ((s === '#' || s === '|')) m[m.length] = ''; |
| 494 | + else if ((s === '\\#' || s === '\\|')) m[m.length - 1] += s.slice(-1); |
| 495 | + else m[m.length - 1] += s; |
495 | 496 | return m;
|
496 | 497 | }, ['']);
|
497 | 498 | })
|
|
0 commit comments