Userscripts/usecase

Look in Userscripts/basic as well.

Here is the use case of JS in parsing JSON. Basically you don't need to know JS for that or any regex.

What we have (got all abilities from console. How? The console option, not websocket, abilities instead of items):

How to get Text
Here should be the code to retrieve all abilities + description how to add the info from there as a global variable + how to use copy(temp1) to copy that variable.

But in this case the following code helps to get info needed to work with (we hope you know what the console is and how to copy that with ctlr+shift+k or ctrl+shilt+j, and then with ctrl+v): copy(Meteor.connection._mongo_livedata_collections.abilities.find.fetch)

Text
{       "abilityId": "berserk", "level": 5, "equipped": false, "slot": "head", "currentCooldown": -776.404, "description": "\n       +70% damage and attack speed. (+5% per lvl) \n        +35% damage taken. (+3% per lvl) \n        You lose 1.4hp per second. (+0.1 per lvl) \n        Duration 10s ", "name": "Berserk (5)", "icon": "berserk.svg", "cooldown": 120, "id": "berserk", "target": "self" },       {         "abilityId": "earth_dart", "level": 1, "equipped": false, "currentCooldown": -15.824, "isSpell": true, "casts": 1290, "slot": "head", "description": "\n       Deals 2 + (110% of MP) as physical damage. \n        At a cost of 2 + (20% of MP) health", "name": "earth dart (1)", "icon": "earthDart.svg", "cooldown": 10, "id": "earth_dart", "target": "currentEnemy" },       {         "abilityId": "penetrating_slash", "level": 2, "equipped": true, "currentCooldown": 4.25, "slot": "head", "description": "\n       Slash for 120% damage. Ignores 80% of targets armor. \n        (+20% damage per lvl)", "name": "penetrating slash (2)", "icon": "penetratingSlash.svg", "cooldown": 10, "id": "penetrating_slash", "target": "currentEnemy" },       {         "abilityId": "blade_spin", "level": 5, "equipped": false, "currentCooldown": -24.162, "slot": "head", "description": "Deals 80% weapon damage to all enemies. (+5% per lvl)", "name": "blade spin (5)", "icon": "bladeSpin.svg", "cooldown": 15, "id": "blade_spin", "target": "allEnemies" },       {         "abilityId": "shield_bash", "level": 2, "equipped": true, "currentCooldown": 13.25, "slot": "chest", "description": "Deal 110% of your defense as damage. (+10% per lvl)", "name": "shield bash (2)", "icon": "shieldBash.svg", "cooldown": 15, "id": "shield_bash", "target": "currentEnemy", "requires": [ {            "type": "weaponType", "weaponTypes": [ "shield" ]           }          ]        },        {         "abilityId": "water_dart", "level": 1, "equipped": false, "isSpell": true, "casts": 1739, "currentCooldown": -203.202, "slot": "chest", "description": "\n       Heals target for 3 + (100% of MP). \n        At a cost of 5 + (15% of MP) health", "name": "water dart (1)", "icon": "waterDart.svg", "cooldown": 10, "id": "water_dart", "targettable": true, "target": "singleFriendly", "requires": [ {            "type": "weaponType", "weaponTypes": [ "staff", "wand" ]           }          ]        },        {         "abilityId": "iron_will", "level": 5, "equipped": false, "currentCooldown": -358.386, "slot": "legs", "description": "\n       Increase defense by 10 - 60. (+5 per lvl) \n        Based on your missing health. Lasts for 15s. ", "name": "iron will (5)", "icon": "ironWill.svg", "cooldown": 90, "id": "iron_will", "target": "self" },       {         "abilityId": "armor_up", "level": 5, "equipped": false, "currentCooldown": -273.3860000000001, "slot": "head", "description": "Increase armor by 350 for 10s.\n      (+50 per lvl)", "name": "armor up (5)", "icon": "armorUp.svg", "cooldown": 180, "id": "armor_up", "target": "self" },       {         "abilityId": "fire_dart", "level": 1, "equipped": false, "isSpell": true, "casts": 1494, "currentCooldown": -32.172, "slot": "offHand", "description": "\n       Deals 2 + (200% of MP) as magic damage. \n        At a cost of 3 + (20% of MP) health", "name": "fire dart (1)", "icon": "fireDart.svg", "cooldown": 10, "id": "fire_dart", "target": "currentEnemy" },       {         "abilityId": "execute", "level": 5, "equipped": false, "currentCooldown": -269.254, "slot": "legs", "description": "\n       Execute enemies below 30% hp for up to 450% damage. (+50% per lvl) \n        Based on your targets missing health.", "name": "execute (5)", "icon": "execute.svg", "cooldown": 10, "id": "execute", "target": "currentEnemy" },       {         "abilityId": "bleed", "level": 5, "equipped": false, "currentCooldown": -1799.84, "slot": "offHand", "description": "Deals 22% of your accuracy as physical damage every second. (+3% per lvl) \n     For 12s.", "name": "bleed (5)", "icon": "bleed.svg", "cooldown": 30, "id": "bleed", "target": "currentEnemy" },       {         "abilityId": "ice_dart", "level": 1, "equipped": false, "isSpell": true, "casts": 1333, "currentCooldown": 0, "slot": "chest", "description": "\n       Freezes current target, dealing (100% MP) damage \n        And slowing attack speed by 15%. \n        Lasts for 3s. \n        At a cost of 5 + (20% of MP) health", "name": "ice dart (1)", "icon": "iceDart.svg", "cooldown": 10, "id": "ice_dart", "target": "currentEnemy" },       {         "abilityId": "air_dart", "level": 1, "equipped": false, "isSpell": true, "casts": 114, "currentCooldown": -53.29, "slot": "offHand", "description": "\n       Reduces enemy armor by (2 + 110% of MP) for 5s \n        At a cost of 3 + (10% of MP) health", "name": "air dart (1)", "icon": "airDart.svg", "cooldown": 10, "id": "air_dart", "target": "currentEnemy" },       {         "abilityId": "taunt", "level": 1, "equipped": true, "currentCooldown": 0, "slot": "mainHand", "description": "Force the target to attack you", "name": "taunt (1)", "icon": "taunt.svg", "cooldown": 10, "id": "taunt", "target": "currentEnemy" },       {         "abilityId": "ignite", "level": 1, "equipped": false, "isSpell": true, "casts": 227, "currentCooldown": -679.87, "slot": "head", "description": "\n       Damages target for 1 + (40% of MP) every second. \n        At a cost of 5 + (10% of MP) health. \n        Lasts for 25s", "name": "ignite (1)", "icon": "ignite.svg", "cooldown": 180, "id": "ignite", "target": "currentEnemy" },       {         "abilityId": "defensive_stance", "level": 5, "equipped": false, "currentCooldown": -58354.982, "slot": "chest", "description": "\n       Reduce damage taken by 62%, damage dealt by 52%. \n        Last for 10s. (+3% per lvl), (+3% per lvl)", "name": "defensive stance (5)", "icon": "defensiveStance.svg", "cooldown": 180, "id": "defensive_stance", "target": "self" },       {         "abilityId": "evasive_maneuvers", "level": 5, "equipped": false, "currentCooldown": -48.29, "slot": "mainHand", "description": "\n       Dodges all attacks for 3.5s.\n         (+0.5s per lvl)", "name": "evasive maneuvers (5)", "icon": "evasiveManeuvers.svg", "cooldown": 40, "id": "evasive_maneuvers", "target": "self" },       {         "abilityId": "lightning_dart", "level": 1, "equipped": false, "isSpell": true, "casts": 1259, "currentCooldown": -49.494, "slot": "offHand", "description": "\n       Strikes the target with lightning, dealing (100% MP) damage. \n        And reducing their armor by (2 + 90% of MP) for 3s \n        At a cost of 3 + (10% of MP) health", "name": "lighting dart (1)", "icon": "lightningDart.svg", "cooldown": 10, "id": "lightning_dart", "target": "currentEnemy" },       {         "abilityId": "attack_up", "level": 2, "equipped": true, "currentCooldown": 0, "slot": "legs", "description": "\n       Increases attack by 15%. \n        (+5% per lvl) ", "name": "attack up (2)", "icon": "attack.svg", "cooldown": 0, "id": "attack_up", "target": "self" },       {         "abilityId": "mending_water", "level": 1, "equipped": false, "isSpell": true, "casts": 1074, "currentCooldown": 0, "slot": "chest", "description": "\n       Heals target for 2 + (50% of MP) every 4 seconds. \n        At a cost of 25 + (30% of MP) health. \n        Lasts for 20s", "name": "mending water (1)", "icon": "mendingWater.svg", "cooldown": 30, "id": "mending_water", "targettable": true, "target": "singleFriendly" },       {         "abilityId": "elemental_shield", "level": 1, "equipped": false, "isSpell": true, "casts": 6, "currentCooldown": -19.560000000000006, "slot": "legs", "description": "\n       Apply a (50 + 70%MP) health shield to the target. \n        Target gains 25% damage while the shield is active. \n        At a cost of 50 + (30% of MP) health. ", "name": "elemental_shield (1)", "icon": "elementalShield.svg", "cooldown": 300, "id": "elemental_shield", "targettable": true, "target": "singleFriendly" },       {         "abilityId": "health_up", "level": 2, "equipped": false, "currentCooldown": 0, "slot": "chest", "description": "\n       Increases health by 8%. \n        (+2% per lvl) ", "name": "health up (2)", "icon": "health.svg", "cooldown": 0, "id": "health_up", "target": "self" },       {         "abilityId": "accuracy_up", "level": 2, "equipped": false, "currentCooldown": 0, "slot": "mainHand", "description": "\n       Increases accuracy by 14. \n        (+6 accuracy per lvl) ", "name": "accuracy up (2)", "icon": "accuracy.svg", "cooldown": 0, "id": "accuracy_up", "target": "self" },       {         "abilityId": "water_ball", "level": 1, "equipped": false, "isSpell": true, "casts": 80, "currentCooldown": -208.702, "slot": "head", "description": "\n       Heals target for 10 + (125% of MP). \n        At a cost of 10 + (13% of MP) health", "name": "water ball (1)", "icon": "waterBall.svg", "cooldown": 10, "id": "water_ball", "targettable": true, "target": "singleFriendly", "requires": [ {            "type": "weaponType", "weaponTypes": [ "staff", "wand" ]           }          ]        },        {         "abilityId": "fire_ball", "level": 1, "equipped": false, "isSpell": true, "casts": 246, "currentCooldown": -32.172, "slot": "mainHand", "description": "\n       Deals 20 + (250% of MP) as magic damage. \n        At a cost of 2 + (15% of MP) health", "name": "fire ball (1)", "icon": "fireBall.svg", "cooldown": 10, "id": "fire_ball", "target": "currentEnemy" },       {         "abilityId": "mud_armor", "level": 1, "equipped": false, "isSpell": true, "casts": 127, "currentCooldown": -42.452, "slot": "legs", "description": "\n       Increases targets armor by 25 + (200% of MP). \n        At a cost of 15 + (25% of MP) health. \n        Lasts for 15s", "name": "mud armor (1)", "icon": "mudArmor.svg", "cooldown": 180, "id": "mud_armor", "targettable": true, "target": "singleFriendly" },       {         "abilityId": "earth_ball", "level": 1, "equipped": false, "isSpell": true, "casts": 132, "currentCooldown": -82.722, "slot": "head", "description": "\n       Deals 10 + (200% of MP) as physical damage. \n        At a cost of 2 + (15% of MP) health", "name": "earth ball (1)", "icon": "earthBall.svg", "cooldown": 10, "id": "earth_ball", "target": "currentEnemy" },       {         "abilityId": "defense_up", "level": 2, "equipped": false, "currentCooldown": 0, "slot": "offHand", "description": "\n       Increases defense by 10. \n        (+4 defense per lvl) ", "name": "defense up (2)", "icon": "defense.svg", "cooldown": 0, "id": "defense_up", "target": "self" },       {         "abilityId": "poison_dart", "level": 1, "equipped": false, "isSpell": true, "casts": 99, "currentCooldown": -679.546, "slot": "mainHand", "description": "\n       Poisons the enemy dealing (40% MP) damage every 5 seconds. \n        Lasts 3 minutes.", "name": "poison dart (1)", "icon": "poisonDart.svg", "cooldown": 180, "id": "poison_dart", "target": "currentEnemy", "requires": [ {            "type": "weaponType", "weaponTypes": [ "staff", "wand" ]           }          ]        },        {         "abilityId": "slash", "level": 2, "equipped": true, "currentCooldown": 4.25, "slot": "offHand", "description": "\n       Slash for 120% damage. \n        (+20% damage per lvl)", "name": "slash (2)", "icon": "slash.svg", "cooldown": 10, "id": "slash", "target": "currentEnemy" },       {         "abilityId": "air_ball", "level": 1, "equipped": false, "isSpell": true, "casts": 59, "currentCooldown": -206.202, "slot": "mainHand", "description": "\n       Reduces enemy armor by (10 + 160% of MP) for 7s \n        At a cost of 10 + (10% of MP) health", "name": "air ball (1)", "icon": "airBall.svg", "cooldown": 10, "id": "air_ball", "target": "currentEnemy" },       {         "abilityId": "blade_frenzy", "level": 5, "equipped": false, "currentCooldown": -28.04, "slot": "chest", "description": "\n       Increases attack speed by 200% for 3s.\n         (+25% per lvl)", "name": "blade frenzy (5)", "icon": "bladeFrenzy.svg", "cooldown": 60, "id": "blade_frenzy", "target": "self" },       {         "abilityId": "magic_wisdom", "level": 1, "equipped": false, "isSpell": true, "casts": 4, "currentCooldown": -223.22599999999997, "slot": "legs", "description": "\n       Increases your magic power by 50% \n        Lasts for 600s", "name": "magic wisdom (1)", "icon": "magicWisdom.svg", "cooldown": 600, "id": "magic_wisdom", "target": "self", "requires": [ {            "type": "weaponType", "weaponTypes": [ "staff", "wand" ]           }          ]        },        {         "abilityId": "affliction", "level": 1, "equipped": false, "isSpell": true, "casts": 1, "currentCooldown": 0, "description": "\n       Deals (150% of MP) damage at the start and end of affliction. \n        Reduces enemy magic armor by (35 + 110% of MP) for 3s \n        At a cost of 10 + (10% of MP) health", "name": "affliction (1)", "icon": "affliction.svg", "cooldown": 180, "id": "affliction", "target": "currentEnemy", "requires": [ {            "type": "weaponType", "weaponTypes": [ "staff", "wand" ]           }          ]        },        {         "abilityId": "spiked_armor", "level": 1, "equipped": false, "currentCooldown": 0, "slot": "head", "description": "\n       Reflect (35% of attack damage taken) + 10 as magic damage. \n        (+5% per lvl) ", "name": "spiked armor (1)", "icon": "spikedArmor.svg", "cooldown": 0, "id": "spiked_armor", "target": "self" },       {         "abilityId": "scream", "level": 1, "equipped": false, "currentCooldown": -14.268, "slot": "offHand", "description": "Force the target to attack you", "name": "scream (1)", "icon": "scream.svg", "cooldown": 60, "id": "scream", "target": "allEnemies" },       {         "abilityId": "frenzied_winds", "level": 1, "equipped": false, "isSpell": true, "casts": 89, "currentCooldown": -31.994, "slot": "offHand", "description": "\n       Increases targets attack speed by 25% + (20% of MP). \n        Decrease your attack speed by the same amount \n        At a cost of 15 + (20% of MP) health. \n        Lasts for 15s", "name": "frenzied winds (1)", "icon": "frenziedWinds.svg", "cooldown": 180, "id": "frenzied_winds", "targettable": true, "target": "singleFriendly" },       {         "abilityId": "vampirism", "level": 1, "equipped": false, "currentCooldown": -2236.91, "slot": "legs", "description": "Heal for 20% of auto attack damage. \n       Lasts 2 minutes.", "name": "vampirism (1)", "icon": "vampirism.svg", "cooldown": 150, "id": "vampirism", "target": "self" },       {         "abilityId": "earthen_fist", "level": 1, "equipped": false, "isSpell": true, "casts": 1, "currentCooldown": 0, "description": "\n       Strikes the target with earth, dealing (100% MP) damage. \n        And stunning them for 3s. \n        At a cost of 3 + (10% of MP) health", "name": "earthen fist (1)", "icon": "earthenFist.svg", "cooldown": 25, "id": "earthen_fist", "target": "currentEnemy" },       {         "abilityId": "phantom_strikes", "level": 2, "equipped": false, "currentCooldown": 0, "slot": "chest", "description": "20% chance to attack twice. \n       Extra attack deals 120.00000000000001% damage (+20% per lvl) ", "name": "phantom strikes (2)", "icon": "phantomStrikes.svg", "cooldown": 0, "id": "phantom_strikes", "target": "self" },       {         "abilityId": "poisoned_blade", "level": 2, "equipped": false, "currentCooldown": 0, "slot": "offHand", "description": "7.0% chance to poison the enemy. \n       Deals 23.0% physical damage every 5 seconds. (+3% per lvl). \n        Lasts 5 minutes.", "name": "poisoned blade (2)", "icon": "poisonedBlade.svg", "cooldown": 0, "id": "poisoned_blade", "target": "self" },       {         "abilityId": "thirsty_fangs", "level": 1, "equipped": false, "currentCooldown": 0, "slot": "legs", "description": "When the target is bleeding \n       Deal 20% extra damage. \n        While below 60% hp, heal for the same amount.", "name": "thirsty fangs (1)", "icon": "thirstyFangs.svg", "cooldown": 0, "id": "thirsty_fangs", "target": "self" },       {         "abilityId": "frost_armor", "level": 1, "equipped": false, "currentCooldown": 0, "slot": "chest", "description": "20% chance to freeze your attacker. \n       Lowers enemy attack speed by 35% for 10s. (+1s per lvl). ", "name": "frost armor (1)", "icon": "frostArmor.svg", "cooldown": 0, "id": "frost_armor", "target": "self" },       {         "abilityId": "meteor_strike", "level": 1, "equipped": false, "isSpell": true, "casts": 0, "currentCooldown": -575.728, "slot": "legs", "description": "\n       Deals 20 + (800% of MP) as magic damage. \n        At a cost of 20 + (80% of MP) health", "name": "meteor strike (1)", "icon": "meteorStrike.svg", "cooldown": 300, "id": "meteor_strike", "target": "currentEnemy", "requires": [ {            "type": "weaponType", "weaponTypes": [ "staff", "wand" ]           }          ]        },        {         "abilityId": "furied_defense", "level": 1, "equipped": false, "currentCooldown": -21.23599999999999, "slot": "offHand", "description": "Counter attack for 100% attack damage. \n       Lasts for 25 seconds. ", "name": "furied defense (1)", "icon": "furiedDefense.svg", "cooldown": 90, "id": "furied_defense", "target": "self", "requires": [ {            "type": "weaponType", "weaponTypes": [ "shield" ]           }          ]        },        {         "abilityId": "volcanic_shield", "level": 1, "equipped": false, "currentCooldown": -42.472, "slot": "offHand", "description": "Increases armor & magic armor by 100. \n       After 10 seconds, erupts dealing 250% weapon damage to all enemies", "name": "volcanic shield (1)", "icon": "volcanicShield.svg", "cooldown": 40, "id": "volcanic_shield", "target": "self", "requires": [ {            "type": "weaponType", "weaponTypes": [ "shield" ]           }          ]        },        {         "abilityId": "sixth_sense", "level": 1, "equipped": false, "currentCooldown": 0, "slot": "mainHand", "description": "Dodge rate from defense cannot go below 20%", "name": "sixth sense (1)", "icon": "sixthSense.svg", "cooldown": 0, "id": "sixth_sense", "target": "self" },       {         "abilityId": "twin_blades", "level": 1, "equipped": false, "currentCooldown": 0, "slot": "mainHand", "description": "\n       Auto attacks hit enemies adjacent to your target (applies on hit effects). \n        Consumes one stack when triggered. Stacks generated every 3 seconds (caps at 20). ", "name": "twin blades (1)", "icon": "twinBlades.svg", "cooldown": 0, "id": "twin_blades", "target": "self", "requires": [ {            "type": "weaponType", "weaponTypes": [ "dagger" ]           }          ]        },        {         "abilityId": "healing_shield", "level": 1, "equipped": false, "isSpell": true, "casts": 1, "currentCooldown": 0, "description": "\n       Heals target for 3 + (120% of MP). \n        Increases targets armor by 20 + (70% of MP) for 15s. \n        At a cost of 5 + (15% of MP) health", "name": "healing shield (1)", "icon": "healingShield.svg", "cooldown": 25, "id": "healing_shield", "targettable": true, "target": "singleFriendly", "requires": [ {            "type": "weaponType", "weaponTypes": [ "staff", "wand" ]           }          ]        },        {         "abilityId": "furied_winds", "level": 1, "equipped": false, "isSpell": true, "casts": 1, "currentCooldown": 0, "description": "\n       Increases targets attack speed by 25% + (60% of MP). \n        For 10 auto attacks. \n        At a cost of 10 + (10% of MP) health. ", "name": "furied winds (1)", "icon": "furiedWinds.svg", "cooldown": 90, "id": "furied_winds", "targettable": true, "target": "singleFriendly" },       {         "abilityId": "fire_wave", "level": 1, "equipped": false, "isSpell": true, "casts": 1, "currentCooldown": 0, "description": "\n       Deals 2 + (150% of MP) as magic damage to all enemies. \n        At a cost of 3 + (10% of MP) health per enemy.", "name": "fire wave (1)", "icon": "fireWave.svg", "cooldown": 30, "id": "fire_wave", "target": "allEnemies" },       {         "abilityId": "angels_touch", "level": 1, "equipped": false, "isSpell": true, "casts": 1, "currentCooldown": 0, "description": "\n       Heals target for 50 + (400% of MP). \n        At a cost of 50 + (50% of MP) health", "name": "angels touch (1)", "icon": "angelsTouch.svg", "cooldown": 120, "id": "angels_touch", "targettable": true, "target": "singleFriendly", "requires": [ {            "type": "weaponType", "weaponTypes": [ "staff", "wand" ]           }          ]        },        {         "abilityId": "double_edged_sword", "level": 1, "equipped": false, "currentCooldown": -17.782, "slot": "legs", "description": "\n       Attack for 500% of your max damage. (+50% per lvl) \n        Deal half of this damage to yourself.", "name": "doubled edged sword (1)", "icon": "doubleEdgedSword.svg", "cooldown": 90, "id": "double_edged_sword", "target": "currentEnemy" },       {         "abilityId": "bleeding_spin", "level": 1, "equipped": false, "currentCooldown": 0, "slot": "head", "description": "Deals 10% of your accuracy as physical damage every second. (+3% per lvl) \n     For 12s.", "name": "bleeding spin (1)", "icon": "bleedingSpin.svg", "cooldown": 60, "id": "bleeding_spin", "target": "allEnemies", "requires": [ {            "type": "weaponType", "weaponTypes": [ "battleAxe" ]           }          ]        }        {         "abilityId": "mending_spring", "level": 1, "equipped": false, "isSpell": true, "casts": 1, "currentCooldown": 0, "description": "\n       Heals all allies for 2 + (25% of MP) every 4 seconds. \n        At a cost of 15 + (10% of MP) health per ally. \n        Lasts for 20s", "name": "mending spring (1)", "icon": "mendingSpring.svg", "cooldown": 90, "id": "mending_spring", "target": "allAllies", "requires": [ {            "type": "weaponType", "weaponTypes": [ "staff", "wand" ]           }          ]       }

How to get only lines both with " abilityId " and " description "?

No Javascript
(That is the goal! To be able to solve problems with knowing less)

1) Extract lines with those words

http://textmechanic.com/text-tools/basic-text-tools/remove-lines-containing/

a) Enable regular expression search: tick.

b) Search lines for:

(abilityId|description)

c) Click button "Not containing..."

Result: you get them!

2) Refine the result

Copy the result there:

http://textmechanic.com/text-tools/basic-text-tools/find-and-replace-text/

a)

"description": " for nothing

b)

"abilityId": " for one line (make one line in replace with)

c)

", for nothing

d)

\n for one line (make one line in replace with)

e)

\n for nothing

f)

for nothing

g)

two spaces for one space (make that several times)

h)

one line and one space after for one line (make one line in replace with)

That's it! You got some pretty text.

One Line Javascript
(does practically the same. You might refine it, but still useful. Thx aessedai!)

(as a rule, you Can do anything you do manually with automation. The question is whether writting automation would save you more time? In comp. do doing it manually?)

(For reference: xkcd: 1205: Is It Worth the Time?)

Example one: copy(Meteor.connection._mongo_livedata_collections.abilities.find.fetch[0].learntAbilities.reduce(function(acc, ability) { return acc + "\n\n" + ability.id + "\n" + ability.description.replace(/  /g, "").replace(/\s\s+/g, "").replace(/[.](\S)/g, ". $1");}, "")) Example two (with ability name to upper case, no _): copy(Meteor.connection._mongo_livedata_collections.abilities.find.fetch[0].learntAbilities.reduce(function(acc, ability) { return acc + "\n\n" + ability.id.replace(/_/g, " ").replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase + txt.substr(1).toLowerCase;}) + "\n" + ability.description.replace(/  /g, "").replace(/\s\s+/g, "").replace(/[.](\S)/g, ". $1");}, "")) That is not totally difficult, really.

Javascript Line By Line
We will do the manual steps above line by line. var finalText = '' //the variable that will be refined

finalText = Meteor.connection._mongo_livedata_collections.abilities.find.fetch[0].learntAbilities.map(function(ability) { return {abilityId: ability.abilityId, description: ability.description};}); // variable has abilityId and abilityDescription

var localText = '' //variable for local use //looping to get .abilityId and .description for (i=0; i/g, '') //replacing for nothing Maybe that is not totally fair / totally the same how we tried to refine the text without JS. But you can be sure, the same "replace" function might be used for some other text.

And sometimes if it takes less time and you do not expect to do this on a regular basis, no-js method might be appear to be easier.

And, please, make sure you understand the mere concept of No Javascript section above!

Result
berserk +70% damage and attack speed. (+5% per lvl) +35% damage taken. (+3% per lvl) You lose 1.4hp per second. (+0.1 per lvl) Duration 10s earth_dart Deals 2 + (110% of MP) as physical damage. At a cost of 2 + (20% of MP) health penetrating_slash Slash for 120% damage. Ignores 80% of targets armor. (+20% damage per lvl) blade_spin Deals 80% weapon damage to all enemies. (+5% per lvl) shield_bash Deal 110% of your defense as damage. (+10% per lvl) water_dart Heals target for 3 + (100% of MP). At a cost of 5 + (15% of MP) health iron_will Increase defense by 10 - 60. (+5 per lvl) Based on your missing health. Lasts for 15s. armor_up Increase armor by 350 for 10s. (+50 per lvl) fire_dart Deals 2 + (200% of MP) as magic damage. At a cost of 3 + (20% of MP) health execute Execute enemies below 30% hp for up to 450% damage. (+50% per lvl) Based on your targets missing health. bleed Deals 22% of your accuracy as physical damage every second. (+3% per lvl) For 12s. ice_dart Freezes current target, dealing (100% MP) damage And slowing attack speed by 15%. Lasts for 3s. At a cost of 5 + (20% of MP) health air_dart Reduces enemy armor by (2 + 110% of MP) for 5s At a cost of 3 + (10% of MP) health taunt Force the target to attack you ignite Damages target for 1 + (40% of MP) every second. At a cost of 5 + (10% of MP) health. Lasts for 25s defensive_stance Reduce damage taken by 62%, damage dealt by 52%. Last for 10s. (+3% per lvl), (+3% per lvl) evasive_maneuvers Dodges all attacks for 3.5s. (+0.5s per lvl) lightning_dart Strikes the target with lightning, dealing (100% MP) damage. And reducing their armor by (2 + 90% of MP) for 3s At a cost of 3 + (10% of MP) health attack_up Increases attack by 15%. (+5% per lvl) mending_water Heals target for 2 + (50% of MP) every 4 seconds. At a cost of 25 + (30% of MP) health. Lasts for 20s elemental_shield Apply a (50 + 70%MP) health shield to the target. Target gains 25% damage while the shield is active. At a cost of 50 + (30% of MP) health. health_up Increases health by 8%. (+2% per lvl) accuracy_up Increases accuracy by 14. (+6 accuracy per lvl) water_ball Heals target for 10 + (125% of MP). At a cost of 10 + (13% of MP) health fire_ball Deals 20 + (250% of MP) as magic damage. At a cost of 2 + (15% of MP) health mud_armor Increases targets armor by 25 + (200% of MP). At a cost of 15 + (25% of MP) health. Lasts for 15s earth_ball Deals 10 + (200% of MP) as physical damage. At a cost of 2 + (15% of MP) health defense_up Increases defense by 10. (+4 defense per lvl) poison_dart Poisons the enemy dealing (40% MP) damage every 5 seconds. Lasts 3 minutes. slash Slash for 120% damage. (+20% damage per lvl) air_ball Reduces enemy armor by (10 + 160% of MP) for 7s At a cost of 10 + (10% of MP) health blade_frenzy Increases attack speed by 200% for 3s. (+25% per lvl) magic_wisdom Increases your magic power by 50% Lasts for 600s affliction Deals (150% of MP) damage at the start and end of affliction. Reduces enemy magic armor by (35 + 110% of MP) for 3s At a cost of 10 + (10% of MP) health spiked_armor Reflect (35% of attack damage taken) + 10 as magic damage. (+5% per lvl) scream Force the target to attack you frenzied_winds Increases targets attack speed by 25% + (20% of MP). Decrease your attack speed by the same amount At a cost of 15 + (20% of MP) health. Lasts for 15s vampirism Heal for 20% of auto attack damage. Lasts 2 minutes. earthen_fist Strikes the target with earth, dealing (100% MP) damage. And stunning them for 3s. At a cost of 3 + (10% of MP) health phantom_strikes 20% chance to attack twice. Extra attack deals 120.00000000000001% damage (+20% per lvl) poisoned_blade 7.0% chance to poison the enemy. Deals 23.0% physical damage every 5 seconds. (+3% per lvl). Lasts 5 minutes. thirsty_fangs When the target is bleeding Deal 20% extra damage. While below 60% hp, heal for the same amount. frost_armor 20% chance to freeze your attacker. Lowers enemy attack speed by 35% for 10s. (+1s per lvl). meteor_strike Deals 20 + (800% of MP) as magic damage. At a cost of 20 + (80% of MP) health furied_defense Counter attack for 100% attack damage. Lasts for 25 seconds. volcanic_shield Increases armor & magic armor by 100. After 10 seconds, erupts dealing 250% weapon damage to all enemies sixth_sense Dodge rate from defense cannot go below 20% twin_blades Auto attacks hit enemies adjacent to your target (applies on hit effects). Consumes one stack when triggered. Stacks generated every 3 seconds (caps at 20). healing_shield Heals target for 3 + (120% of MP). Increases targets armor by 20 + (70% of MP) for 15s. At a cost of 5 + (15% of MP) health furied_winds Increases targets attack speed by 25% + (60% of MP). For 10 auto attacks. At a cost of 10 + (10% of MP) health. fire_wave Deals 2 + (150% of MP) as magic damage to all enemies. At a cost of 3 + (10% of MP) health per enemy. angels_touch Heals target for 50 + (400% of MP). At a cost of 50 + (50% of MP) health double_edged_sword Attack for 500% of your max damage. (+50% per lvl) Deal half of this damage to yourself. bleeding_spin Deals 10% of your accuracy as physical damage every second. (+3% per lvl) For 12s. mending_spring Heals all allies for 2 + (25% of MP) every 4 seconds. At a cost of 15 + (10% of MP) health per ally. Lasts for 20s