{"name":"lootpet","enabled":true,"description":"Auto-loot mob drops","type":"group","id":1,"items":[{"type":"function","name":"Read_Me","enabled":true,"id":43,"code":"/* \n\nLootpet v1.0.3\nby: Zahan of Achaea\n\n\nYour very own lootpet! This \"pet\" will follow you around and pick up your loot!\nName it. Describe it. Show it off!\nIt tracks your gold and will even split what you've picked up with friends!\n\n\nUse LOOTPET in-game for options, settings, and syntaxes.\n\nExamples of the split command: \n LOOTPET SPLIT ZAHAN\n LOOTPET SPLIT ZAHAN THOTH PHAESTUS\n\n\nIf you have any problems or questions, send me a msg in the game or on the forum.\n\n\nThis plugin is provided for free but donations to Zahan (achaea) are always appreciated, no matter how small!\n\n\n\n\n\nVersion notes:\n- converted variable to object\n- fixed false settings defaulting to true\n- == to ===\n\n*/","items":[]},{"type":"alias","name":"","enabled":true,"id":32,"matching":"exact","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"// for some reason, nexus doesn't run onLoad when you install. so, load if needed\nif (typeof lootpet === \"undefined\")\n send_command(\"lootpet reload\");\n\nvar version = \"1.0.3\"\n\nvar overall = 75;\n\nvar check_on = function (setting) {\n var status;\n if (!lootpet[setting])\n status = \"off\";\n else\n status = \"on\";\n return status;\n}\n\n\nlootpet.help = {\n Main: {\n \"ON|OFF\": \"= \"+check_on(\"on\")+\"; turn on/off\",\n \"CONTAINER \": \"= \"+lootpet.container+\"; set container\",\n RELOAD: \"- reload package\",\n DEFAULT: \"- restore default settings\",\n },\n \"Pet Info\": {\n \"NAME \": \"= \"+lootpet.name+\"\",\n \"DESCRIBE \": \"- set description\",\n \"LOOK\": \"- look at your lootpet\",\n \"SHOWOFF [channel]\": \"- share your pet's description\"\n },\n Options: {\n \"SHOW_PET ON|OFF\": \"= \"+check_on(\"show_pet\")+\"; turn off to loot yourself\",\n \"MY_KILL_ONLY ON|OFF\": \"= \"+check_on(\"my_kill_only\")+\"; loot only your kills\",\n \"INP_GOLD ON|OFF\": \"= \"+check_on(\"inp_gold\")+\"; put acquired gold in container\",\n \"STAT_BAR ON|OFF\": \"= \"+check_on(\"stat_bar\")+\"; display tracking on stat bar\",\n \"OUTPUT_MSG OFF|ON\": \"= \"+check_on(\"output_msg\")+\"; display settings messages\",\n },\n Tracking: {\n \"TRACK ON|OFF\": \"= \"+check_on(\"on\")+\"; turn on/off the gold tracker\",\n \"SHOW\": \"= \"+lootpet.tracked+\"; show tracked gold\",\n \"SET <#>\": \"- set tracked gold\",\n \"ADD <#>\": \"- add to tracked gold\",\n \"SUB <#>\": \"- subtract from tracked gold\",\n \"SPLIT \": \"- split tracked gold\",\n \"CLEAR/RESET\": \"- reset tracked gold\",\n }\n};\n\n\nlootpet.note(\n \"+-----------------------\", \"#aaa\", \"\",\n \" Lootpet v\"+version+\" \", \"#808000\", \"\",\n \" by Zahan \", \"#4B4B4B\", \"\",\n \"------------------------+\", \"#aaa\", \"\"\n);\n\n\nfor (var header in lootpet.help) {\n var spaces = overall - header.length - 4;\n var space = \"\";\n for (i=0; i| \" + header + \":\"+space+\"|

\");\n for (var command in lootpet.help[header]) {\n var spaces = 23 - command.length;\n var space = \"\";\n for (i=0; i/g, \">\");\n ow_Write(\"#output_main\", \"

|\" + line + endsp + \"|

\");\n }\n var spaces = overall - 2;\n var space = \"\";\n for (i=0; i|\" + space + \"|

\");\n}\n\now_Write(\"#output_main\", \"

+-------------------------------------------------------------------------+

\");\nprint(\" \");"}],"text":"lootpet"},{"type":"group","name":"Functions","enabled":true,"id":42,"items":[{"type":"function","name":"onLoad","enabled":true,"id":3,"code":"// initiate table\nif (typeof lootpet === \"undefined\") {\n lootpet = {\n old: {},\n aff: [],\n grab: [],\n gold: parseInt(0),\n };\n}\n\n\nlootpet.stoppers = [\n \"aeon\",\n \"amnesia\",\n \"bound\",\n \"clumsiness\",\n \"confusion\",\n \"dizziness\",\n \"disrupted\",\n \"entangled\",\n //\"frozen\",\n \"hindered\",\n \"impaled\",\n \"paralysis\",\n //\"prone\",\n \"stupidity\",\n \"transfixation\",\n \"unconsciousness\",\n \"webbed\",\n];\n\n\n// default settings - don't change these (change settings with LOOTPET alias in-game)\nlootpet.settings = {\n name: \"a smart-looking pug\",\n desc: \"This tiny pug, quite literally, looks really smart. His fur is mostly off-white, but fades to black around his adorable pug nose. Adorning his stout frame is a fitted black business suit complete with a stark white undershirt, and a black silken tie. He has on his face a pair of round, black-rimmed spectacles, and around his neck is a thick silver chain. Hanging from the chain is a talisman containing the letters 'LP'.\",\n on: true,\n show_pet: true,\n my_kill_only: true,\n inp_gold: true,\n container: \"pack\",\n output_msg: true,\n stat_bar: true,\n track: true,\n tracked: parseInt(0),\n};\n\n\nlootpet.save_settings = function () {\n var settings = {};\n for (let key in lootpet.settings)\n settings[key] = lootpet[key];\n set_variable(\"lootpet\", settings);\n};\n\n\nlootpet.set_defaults = function () {\n for (let key in lootpet.settings)\n lootpet[key] = lootpet.settings[key];\n};\nlootpet.set_defaults();\n\n\n// load settings\nlootpet.saved = get_variable(\"lootpet\");\nif (lootpet.saved) {\n if (typeof lootpet.saved === \"string\") {\n // break apart variable if old string\n var lootpet_set = lootpet.saved.split(\"|\");\n for (i = 0; i < lootpet_set.length; i++) {\n lootpet_set[i] = lootpet_set[i].split(\":\");\n lootpet[lootpet_set[i][0]] = lootpet_set[i][1];\n }\n lootpet.save_settings();\n }\n else { \n // set from variable\n for (let key in lootpet.saved)\n lootpet[key] = lootpet.saved[key];\n }\n\n // turn off gmcp, if off\n if (!lootpet.on) {\n var gmcp = client.reflex_find_by_name(\"function\", \"onGMCP\", true, false, \"Lootpet\");\n reflex_disable(gmcp);\n }\n}\n\n\nlootpet.msg = function (text) {\n if (!lootpet.output_msg)\n return;\n ow_Write(\"#output_main\", \"

[Lootpet]: \"+text+\"

\");\n print(\" \");\n};\n\n\nlootpet.note = function () {\n var args = arguments;\n var divi = args.length / 3;\n if (divi % 1 != 0) {\n display_notice(\"Invalid cnote(\\\"\"+args[0]+\"\\\"...)\", \"red\");\n display_notice(\"Paramaters must be in sets of 3!\", \"red\");\n return;\n }\n\n var line = \"\";\n for (var i=0; i\" + txt + \"\";\n }\n ow_Write(\"#output_main\", \"

\"+line+\"

\");\n send_command(\" \");\n};\n\n\n// pick up stuff\nlootpet.pickup = function() {\n // run checks\n if (!lootpet.grab || !lootpet.on || lootpet.looting)\n return;\n if (!lootpet.bal || !lootpet.eq)\n return;\n for (var i = 0; i < lootpet.stoppers.length; i++) {\n if (lootpet.aff[lootpet.stoppers[i]])\n return;\n }\n\n // send command\n for (var key in lootpet.grab) {\n ws_send(\"get \"+key + \"\\r\\n\");\n last_send = new Date().getTime();\n lootpet.getting = key;\n lootpet.looting = lootpet.grab[key];\n break\n }\n\n // turn off\n if (!lootpet.looting && !lootpet.packing) {\n var looting = client.reflex_find_by_name(\"group\", \"Looting\", true, false, \"Lootpet\");\n reflex_disable(looting);\n }\n};\n\n\n// put gold away\nlootpet.inp = function () {\n // run checks\n if (!lootpet.gold_out || !lootpet.inp_gold || lootpet.packing)\n return;\n if (!lootpet.bal || !lootpet.eq)\n return;\n for (var i = 0; i < lootpet.stoppers.length; i++) {\n if (lootpet.aff[lootpet.stoppers[i]])\n return;\n }\n\n // send command\n ws_send(\"put sovereigns in \"+lootpet.container + \"\\r\\n\");\n last_send = new Date().getTime();\n lootpet.packing = true;\n};\n\n//////////////////////\n\n// update_status_bar\nif (lootpet.old.update_status_bar)\n update_status_bar = lootpet.old.update_status_bar;\nelse\n lootpet.old.update_status_bar = update_status_bar;\n\nupdate_status_bar = (function() {\n var cached_function = update_status_bar;\n return function() {\n\n var result = cached_function.apply(this, arguments);\n\n if (!lootpet.stat_bar) {\n // hide it because IRE re-shows it\n $(\"#footer #status-tracked\").hide();\n return;\n }\n\n var tracked = lootpet.tracked;\n if (tracked > 0)\n tracked = \"+\"+tracked;\n\n // create div\n if (!lootpet.inserted) {\n $('#footer #status-target').after('
');\n var div = $(\"#footer #status-tracked\");\n if (lootpet.track)\n div.css(\"color\", \"#3D670C\");\n else\n div.css(\"color\", \"#83210C\");\n div.html(tracked);\n lootpet.inserted = true;\n }\n\n // populate div\n if (lootpet.diff == 0 && !lootpet.redraw)\n return;\n $(\"#footer #status-tracked\").html(tracked);\n delete lootpet.redraw;\n };\n})();","items":[]},{"type":"function","name":"onGMCP","enabled":true,"id":18,"code":"// Target slain\nif (args.gmcp_method === \"IRE.Misc.Achievement\") {\n if (args.gmcp_args.name !== \"TotalCreaturesKilled\")\n return;\n lootpet.my_kill = true;\n}\n\n\n// Item dropped\nif (args.gmcp_method === \"Char.Items.Add\") {\n if (args.gmcp_args.location !== \"room\")\n return;\n if (args.gmcp_args.item.attrib !== \"t\")\n return;\n if (!lootpet.on)\n return;\n if (lootpet.my_kill_only && !lootpet.my_kill)\n return;\n\n var id = args.gmcp_args.item.id;\n var name = args.gmcp_args.item.name;\n if (!lootpet.grab)\n lootpet.grab = {};\n lootpet.grab[id] = name;\n\n var looting = client.reflex_find_by_name(\"group\", \"Looting\", true, false, \"Lootpet\");\n reflex_enable(looting);\n}\n\n\n// Gold acquired\nif (args.gmcp_method === \"Char.Status\") {\n if (!args.gmcp_args.gold)\n return;\n \n var gold = Number(args.gmcp_args.gold);\n if (gold == 0)\n return;\n \n if (lootpet.gold == 0) {\n lootpet.gold = gold;\n return;\n }\n \n lootpet.diff = gold - lootpet.gold;\n if (lootpet.diff == 0)\n return;\n \n lootpet.gold = gold;\n if (lootpet.track) {\n lootpet.tracked = Number(lootpet.tracked);\n lootpet.tracked += lootpet.diff;\n }\n \n if (lootpet.diff > 0) {\n lootpet.gold_out = true;\n if (lootpet.splitting)\n return;\n var looting = client.reflex_find_by_name(\"group\", \"Looting\", true, false, \"Lootpet\");\n reflex_enable(looting);\n }\n}\n\n\n// Vitals\nif (args.gmcp_method === \"Char.Vitals\") {\n if (lootpet.my_kill)\n delete lootpet.my_kill;\n\n if (args.gmcp_args.bal === \"1\")\n lootpet.bal = 1;\n else\n delete lootpet.bal;\n\n if (args.gmcp_args.eq === \"1\")\n lootpet.eq = 1;\n else\n delete lootpet.eq;\n\n if (!jQuery.isEmptyObject(lootpet.grab))\n lootpet.pickup();\n if (lootpet.gold_out && !lootpet.splitting)\n lootpet.inp();\n}\n\n\n// Item picked up\nif (args.gmcp_method === \"Char.Items.Remove\") {\n if (args.gmcp_args.location !== \"room\")\n return;\n var id = args.gmcp_args.item.id;\n if (lootpet.grab[id])\n delete lootpet.grab[id];\n}\n\n\n// Afflictions\nif (args.gmcp_method === \"Char.Afflictions.Add\") {\n var aff = args.gmcp_args.name;\n lootpet.aff[aff] = 1;\n}\n\nif (args.gmcp_method === \"Char.Afflictions.Remove\") {\n var aff = String(args.gmcp_args);\n delete lootpet.aff[aff];\n}"}],"actions":[]},{"type":"group","name":"Aliases","enabled":true,"id":41,"items":[{"type":"alias","name":"lootpet on|off","enabled":true,"id":31,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"var suffix = args[1];\nvar gmcp = client.reflex_find_by_name(\"function\", \"onGMCP\", true, false, \"Lootpet\");\nif (suffix === \"on\") {\n lootpet.on = true;\n reflex_enable(gmcp);\n}\nelse {\n lootpet.on = false;\n reflex_disable(gmcp);\n}\nlootpet.msg(\"You turn \"+suffix+\" the lootpet.\");\nlootpet.save_settings();"}],"text":"^lootpet (on|off)$"},{"type":"alias","name":"lootpet container <#>","enabled":true,"id":36,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"lootpet.container = args[1];\nlootpet.msg(\"You set your loot container to \"+args[1]+\".\");\nlootpet.save_settings();"}],"text":"^lootpet container (.*?)$"},{"type":"alias","name":"","enabled":true,"id":2,"matching":"exact","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"function","fn":"onLoad"}],"text":"lootpet reload","items":[]},{"type":"alias","name":"","enabled":true,"id":33,"matching":"exact","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"lootpet.set_defaults();\nlootpet.msg(\"You revert all settings to lootpet defaults.\");\nlootpet.save_settings();"}],"text":"lootpet default"},{"type":"alias","name":"lootpet name ","enabled":true,"id":35,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"lootpet.name = args[1];\nlootpet.msg(\"You change your companion to \\\"\"+args[1]+\"\\\".\");\nlootpet.save_settings();"}],"text":"^lootpet name (.*?)$"},{"type":"alias","name":"lootpet describe ","enabled":true,"id":38,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"lootpet.desc = args[1];\nlootpet.msg(\"You set the description for your lootpet to: \"+lootpet.desc);\nlootpet.save_settings();"}],"text":"^lootpet describe (.*?)$"},{"type":"alias","name":"lootpet look","enabled":true,"id":37,"matching":"exact","whole_words":false,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"var lpet = lootpet.name.charAt(0).toUpperCase()+lootpet.name.slice(1);\n\nclient.print(lootpet.desc);\nclient.print(lpet+\" almost glows with nearly god-like power.\");\nclient.print(\"It has 100% health remaining.\");\nclient.print(\"It weighs about 0 pounds.\");\nclient.print(lpet+\" is holding:\");\nclient.print(\"Nothing.\");\ndisplay_notice(\"It will reset to you.\");"}],"text":"lootpet look"},{"type":"alias","name":"lootpet showoff ","enabled":true,"id":45,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"if (args[1])\n var channel = args[1];\nelse\n var channel = \"say\";\nvar line = channel+\" If only you could see it... \"+lootpet.desc;\nsend_command(line);"}],"text":"^lootpet showoff\\s?(.*?)$"},{"type":"alias","name":"lootpet show_pet on|off","enabled":true,"id":39,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"var suffix = args[1];\nif (suffix === \"on\")\n lootpet.show_pet = true;\nelse\n lootpet.show_pet = false;\nlootpet.msg(\"You turn \"+suffix+\" the show_pet illusions.\");\nlootpet.save_settings();"}],"text":"^lootpet show_pet (on|off)$"},{"type":"alias","name":"lootpet my_kill_only on|off","enabled":true,"id":30,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"var suffix = args[1];\nif (suffix === \"on\")\n lootpet.my_kill_only = true;\nelse\n lootpet.my_kill_only = false;\nlootpet.msg(\"You turn \"+suffix+\" my_kill_only looting.\");\nlootpet.save_settings();"}],"text":"^lootpet my_kill_only (on|off)$"},{"type":"alias","name":"lootpet inp_gold on|off","enabled":true,"id":29,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"var suffix = args[1];\nif (suffix === \"on\")\n lootpet.inp_gold = true;\nelse\n lootpet.inp_gold = false;\nlootpet.msg(\"You turn \"+suffix+\" gold packing.\");\nlootpet.save_settings();"}],"text":"^lootpet inp_gold (on|off)$"},{"type":"alias","name":"lootpet stat_bar on|off","enabled":true,"id":28,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"var suffix = args[1];\nif (suffix === \"on\") {\n lootpet.stat_bar = true;\n $(\"#footer #status-tracked\").show();\n var tracked = lootpet.tracked;\n if (tracked > 0)\n tracked = \"+\"+tracked;\n $(\"#footer #status-tracked\").html(tracked);\n}\nelse {\n lootpet.stat_bar = false;\n $(\"#footer #status-tracked\").hide();\n}\nlootpet.msg(\"You turn \"+suffix+\" the stat_bar display.\");\nlootpet.save_settings();"}],"text":"^lootpet stat_bar (on|off)$"},{"type":"alias","name":"lootpet output_msg on|off","enabled":true,"id":44,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"var suffix = args[1];\nif (suffix === \"on\")\n lootpet.output_msg = true;\nelse\n lootpet.output_msg = false;\nlootpet.msg(\"You turn \"+suffix+\" the output messages.\");\nlootpet.save_settings();"}],"text":"^lootpet output_msg (on|off)$"},{"type":"alias","name":"lootpet track on|off","enabled":true,"id":26,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"var suffix = args[1];\nvar div = $(\"#footer #status-tracked\");\nif (suffix === \"on\") {\n lootpet.track = true;\n div.css(\"color\", \"#3D670C\");\n}\nelse {\n lootpet.track = false;\n div.css(\"color\", \"#83210C\");\n}\nlootpet.msg(\"You turn \"+suffix+\" the loot tracker.\");\nlootpet.save_settings();"}],"text":"^lootpet track (on|off)$"},{"type":"alias","name":"","enabled":true,"id":21,"matching":"exact","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"if (typeof lootpet.tracked === \"undefined\") {\n lootpet.msg(\"Tracker is not activated.\");\n return;\n}\nlootpet.msg(\"You have collected \"+lootpet.tracked+\" gold.\");"}],"text":"lootpet show"},{"type":"alias","name":"lootpet set <#>","enabled":true,"id":24,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"if (typeof lootpet.tracked === \"undefined\") {\n lootpet.msg(\"Tracker is not activated.\");\n return;\n}\nvar set = Number(args[1]);\nvar tracked_old = Number(lootpet.tracked);\nlootpet.tracked = set;\nlootpet.redraw = true;\nlootpet.msg(\"You set your tracked gold to \"+set+\" sovereigns, from \"+tracked_old+\".\");\nlootpet.save_settings();"}],"text":"^lootpet set (\\d+)$"},{"type":"alias","name":"lootpet add <#>","enabled":true,"id":22,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"if (typeof lootpet.tracked === \"undefined\") {\n lootpet.msg(\"Tracker is not activated.\");\n return;\n}\nvar add = Number(args[1]);\nlootpet.tracked = Number(lootpet.tracked);\nlootpet.tracked += add;\nlootpet.redraw = true;\nlootpet.msg(\"You add \"+add+\" to the tracker, for a total of \"+lootpet.tracked+\" gold.\");\nlootpet.save_settings();"}],"text":"^lootpet add (\\d+)$"},{"type":"alias","name":"lootpet sub <#>","enabled":true,"id":23,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"if (typeof lootpet.tracked === \"undefined\") {\n lootpet.msg(\"Tracker is not activated.\");\n return;\n}\nvar sub = Number(args[1]);\nlootpet.tracked = Number(lootpet.tracked);\nlootpet.tracked -= sub;\nlootpet.redraw = true;\nlootpet.msg(\"You subtract \"+sub+\" from the tracker, for a total of \"+lootpet.tracked+\" gold.\");\nlootpet.save_settings();"}],"text":"^lootpet sub (\\d+)$"},{"type":"alias","name":"lootpet split ","enabled":true,"id":46,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"lootpet.split = args[1].split(\" \");\n\nlootpet.split_off = function () {\n if (lootpet.splitting)\n clearTimeout(lootpet.splitting);\n delete lootpet.splitting;\n delete lootpet.split;\n var splitting = client.reflex_find_by_name(\"group\", \"Splitting\", true, false, \"Lootpet\");\n reflex_disable(splitting);\n};\n\nvar splitting = client.reflex_find_by_name(\"group\", \"Splitting\", true, false, \"Lootpet\");\nreflex_enable(splitting);\nclearTimeout(lootpet.splitting);\nlootpet.splitting = setTimeout(function(){lootpet.split_off();}, 3000);\n\nws_send(\"curing off\" + \"\\r\\n\");\nlast_send = new Date().getTime();"}],"text":"^lootpet split (.*?)$"},{"type":"alias","name":"lootpet reset/clear","enabled":true,"id":25,"matching":"regexp","whole_words":true,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"var tracked_old;\nif (typeof lootpet.tracked === \"undefined\")\n tracked_old = 0;\nelse\n tracked_old = lootpet.tracked;\nlootpet.tracked = parseInt(0);\nlootpet.redraw = true;\nlootpet.msg(\"You reset your tracked gold to 0, from \"+tracked_old+\" sovereigns.\");\nlootpet.save_settings();"}],"text":"^lootpet (reset|clear)$"}],"actions":[]},{"type":"group","name":"Looting","enabled":false,"id":16,"items":[{"type":"trigger","name":"pick up thing","enabled":true,"id":11,"matching":"regexp","whole_words":false,"case_sensitive":false,"text":"^You pick up (.*?)\\.$","actions":[{"action":"script","script":"if (lootpet.looting) {\n delete lootpet.looting;\n lootpet.pickup();\n \n if (!lootpet.show_pet)\n return;\n gag_current_line();\n var thing = args[1];\n var lpet = lootpet.name;\n lpet = lpet.charAt(0).toUpperCase()+lpet.slice(1);\n if (thing.match(/sovereigns/) && lootpet.inp_gold)\n display_notice(lpet+\" picks up \"+thing+\".\");\n else\n display_notice(lpet+\" picks up \"+thing+\", which it promptly hands to you.\");\n}"}]},{"type":"trigger","name":"put gold away","enabled":true,"id":55,"matching":"regexp","whole_words":false,"case_sensitive":false,"text":"^You put (\\d+) gold sovereigns in (.*?)\\.$","actions":[{"action":"script","script":"delete lootpet.gold_out;\ndelete lootpet.packing;\n\n// turn off\nif (!lootpet.looting) {\n var looting = client.reflex_find_by_name(\"group\", \"Looting\", true, false, \"Lootpet\");\n reflex_disable(looting);\n}\n\n// replace message\nvar amount = args[1];\nvar storage = args[2];\nif (lootpet.show_pet) {\n gag_current_line();\n var lpet = lootpet.name;\n lpet = lpet.charAt(0).toUpperCase()+lpet.slice(1);\n display_notice(lpet+\" puts your \"+amount+\" gold sovereigns in \"+storage+\".\");\n}"}]},{"type":"trigger","name":"no eq","enabled":true,"id":12,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You must regain equilibrium first.","actions":[{"action":"script","script":"if (lootpet.looting)\n delete lootpet.looting;\nif (lootpet.packing)\n delete lootpet.packing;"}]},{"type":"trigger","name":"no bal","enabled":true,"id":13,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You must regain balance first.","actions":[{"action":"script","script":"if (lootpet.looting)\n delete lootpet.looting;\nif (lootpet.packing)\n delete lootpet.packing;"}]},{"type":"trigger","name":"missing item","enabled":true,"id":14,"matching":"regexp","whole_words":false,"case_sensitive":false,"text":"^I see no \\\"(\\d+)\\\" to take\\.$","actions":[{"action":"script","script":"if (lootpet.looting) {\n if (lootpet.show_pet) {\n gag_current_line();\n var lpet = lootpet.name.charAt(0).toUpperCase()+lootpet.name.slice(1);\n display_notice(lpet+\" cannot seem to find \"+lootpet.looting+\" and quickly gives up.\");\n }\n var id = args[1];\n delete lootpet.grab[id];\n delete lootpet.looting;\n lootpet.pickup();\n}"}]},{"type":"trigger","name":"cannot take","enabled":true,"id":15,"matching":"begins","whole_words":false,"case_sensitive":false,"text":"You cannot pick up","actions":[{"action":"script","script":"if (lootpet.looting) {\n if (lootpet.show_pet) {\n gag_current_line();\n var lpet = lootpet.name.charAt(0).toUpperCase()+lootpet.name.slice(1);\n display_notice(lpet+\" cannot pick up \"+lootpet.looting+\" and quickly gives up.\");\n }\n delete lootpet.grab[lootpet.getting];\n delete lootpet.looting;\n lootpet.pickup();\n}"}]},{"type":"trigger","name":"stunned","enabled":true,"id":20,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You are no longer stunned.","actions":[{"action":"script","script":"if (lootpet.looting) {\n delete lootpet.looting;\n lootpet.pickup();\n}\nif (lootpet.packing)\n delete lootpet.packing;"}]},{"type":"trigger","name":"paralyzed","enabled":true,"id":40,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Paralysed as you are, your body is not able to pick up anything.","actions":[{"action":"script","script":"if (lootpet.looting) {\n delete lootpet.looting;\n lootpet.pickup();\n}\nif (lootpet.packing)\n delete lootpet.packing;"}]}],"actions":[]},{"type":"group","name":"Splitting","enabled":false,"id":47,"items":[{"type":"trigger","name":"curing off","enabled":true,"id":48,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Curing disabled.","actions":[{"action":"script","script":"gag_current_line();\n\nws_send(\"get \"+lootpet.tracked+\" sovereigns from \"+lootpet.container + \"\\r\\n\");\nlast_send = new Date().getTime();\nws_send(\"generosity\" + \"\\r\\n\");\nlast_send = new Date().getTime();"}]},{"type":"trigger","name":"get gold out","enabled":true,"id":27,"matching":"regexp","whole_words":false,"case_sensitive":false,"text":"^You get (\\d+) gold sovereigns from (.*?)\\.$","actions":[{"action":"script","script":"// replace message\nvar amount = args[1];\nvar storage = args[2];\nif (lootpet.show_pet) {\n gag_current_line();\n var lpet = lootpet.name;\n lpet = lpet.charAt(0).toUpperCase()+lpet.slice(1);\n display_notice(lpet+\" gets your \"+amount+\" gold sovereigns from \"+storage+\".\");\n}"}]},{"type":"trigger","name":"gold already out","enabled":true,"id":51,"matching":"begins","whole_words":false,"case_sensitive":true,"text":"You cannot batch more than","actions":[{"action":"script","script":"gag_current_line();"}]},{"type":"trigger","name":"generosity","enabled":true,"id":53,"matching":"exact","whole_words":false,"case_sensitive":true,"text":"A feeling of generosity spreads throughout you.","actions":[{"action":"script","script":"gag_current_line();"}]},{"type":"trigger","name":"selfishness off","enabled":true,"id":49,"matching":"regexp","whole_words":false,"case_sensitive":true,"text":"^(You have recovered equilibrium|No worries\\. You're not a selfish bastard as is)\\.","actions":[{"action":"script","script":"gag_current_line();\n\nvar people = lootpet.split;\n\nif (people[people.length-1] == \"\") {\n var index = people.indexOf(\"\");\n if (index > -1) people.splice(index, 1);\n}\n\nvar each = Math.floor(lootpet.tracked / (people.length+1));\n\nfor (var i=0; i