/
Nexsys Package.nxs
1 lines (1 loc) · 259 KB
/
Nexsys Package.nxs
1
{"name":"system","enabled":true,"description":"","type":"group","id":1,"items":[{"type":"function","name":"onBlock","enabled":true,"id":272,"code":"client.eventStream.raiseEvent('PromptEvent');"},{"type":"trigger","name":"","enabled":true,"id":358,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Your current separator is\\: (.+)$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CommandSeparatorSetOnStartup', args[1]);"}]},{"type":"group","name":"systemStartup","enabled":true,"id":263,"items":[{"type":"function","name":"onLoad","enabled":true,"id":56,"code":"client.system_loaded = false;\n\nclient.sysLogging = {\n locations: 'console',\n logEvents: false\n};\n\nclient.sysLog = function(text) {\n if(client.sysLogging.locations == 'console') {\n console.log(text);\n }\n};\n\nclient.sysLoggingToggle = function(enable) {\n client.sysLogging.logEvents = enable == \"on\";\n};\n\nrun_function('systemBootstrap', {}, 'System');"},{"type":"function","name":"systemBootstrap","enabled":true,"id":257,"code":"run_function('jsHelpers', {}, 'ALL');\n\nrun_function('eventStream', {}, 'ALL');\n\nrun_function('echoClasses', {}, 'ALL');\nrun_function('echoEvents', {}, 'ALL');\nrun_function('echoService', {}, 'ALL');\n\nrun_function('clientOverrides', {}, 'ALL');\nrun_function('promptOverride', {}, 'ALL');\n\nrun_function('system', {}, 'ALL');\n\nrun_function('countableClass', {}, 'ALL');\nrun_function('priorityClass', {}, 'ALL');\nrun_function('timerClass', {}, 'ALL');\nrun_function('trackableClass', {}, 'ALL');\nrun_function('priorityQueueClass', {}, 'ALL');\n\nrun_function('systemSettings', {}, 'ALL');\nrun_function('balanceClass', {}, 'ALL');\nrun_function('affClass', {}, 'ALL');\nrun_function('defClass', {}, 'ALL');\nrun_function('cureClass', {}, 'ALL');\nrun_function('cacheClass', {}, 'ALL');\n\nrun_function('affTable', {}, 'ALL');\nrun_function('balanceTable', {}, 'ALL');\nrun_function('cureTable', {}, 'ALL');\nrun_function('defTable', {}, 'ALL');\nrun_function('cacheTable', {}, 'ALL');\nrun_function('commonTables', {}, 'ALL');\n\nrun_function('systemEvents', {}, 'ALL');\nrun_function('affEvents', {}, 'ALL');\nrun_function('balanceEvents', {}, 'ALL');\nrun_function('defEvents', {}, 'ALL');\nrun_function('cacheEvents', {}, 'ALL');\n\nrun_function('systemService', {}, 'ALL');\nrun_function('affService', {}, 'ALL');\nrun_function('balanceService', {}, 'ALL');\nrun_function('cureService', {}, 'ALL');\nrun_function('defService', {}, 'ALL');\nrun_function('cacheService', {}, 'ALL');\nrun_function('lust', {}, 'ALL');\n\nrun_function('gmcpHandler', {}, 'ALL');\nrun_function('gmcpRaiseEvents', {}, 'ALL');\n\nrun_function('utilityFunctions', {}, 'ALL');\n\nrun_function('systemOutput', {}, 'ALL');\nrun_function('serversideEvents', {}, 'ALL');\nrun_function('ServersidePrioritySwapping', {}, 'ALL');\nrun_function('PrioSwapTrackables', {}, 'ALL');\n\nrun_function('queueing', {}, 'ALL');\nrun_function('doRepeat', {}, 'ALL');\nrun_function('doCommandWhenCan', {}, 'ALL');\n\nrun_function('CustomSettingsService', {}, 'ALL');\nrun_function('CustomSettingsFromServer', {}, 'ALL');\nrun_function('CustomSettingsFromPackage', {}, 'ALL');\n\nrun_function('systemCreate', {}, 'ALL');\nrun_function('balanceCreate', {}, 'ALL');\nrun_function('affCreate', {}, 'ALL');\nrun_function('defCreate', {}, 'ALL');\nrun_function('cureCreate', {}, 'ALL');\nrun_function('cacheCreate', {}, 'ALL');\n\nrun_function('allLoaded', {}, 'ALL');"},{"type":"function","name":"jsHelpers","enabled":true,"id":95,"code":"String.prototype.toProperCase = function () {\n return this.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n};\n\n// A few helpful functions to map/convert dot representations to their object counterparts.\n// Very useful when want to store/pull to/from database as a column name but want to\n// represent it in a view as a nested object.\n\n//var objStrConv = {};\n\n\n// function to set value for a nested object.\n// It will initialize the parent object if it doesn't exist\n// and recursively move down until child object is set\n// If no val is passed in then it basically initializes the object\nObject.setAtString = function(obj, dotarr, val) {\n a = dotarr.shift();\n if ( dotarr.length == 0 ) { // if at last element in chain, set value\n if (obj[a] == undefined) {\n obj[a] = {};\n }\n if( Array.isArray(val) ) {\n obj[a] = val;\n }\n else if(typeof val === 'object') {\n for(key in val) {\n obj[a][key] = val[key];\n }\n }\n else {\n obj[a] = val;\n }\n return;\n }\n else {\n if (obj[a] == undefined) {\n obj[a] = {};\n }\n Object.setAtString(obj[a], dotarr, val);\n }\n};\n\n// get value of a nested object by its string representation 'blah.blah1.blah2'\nObject.getByString = function(obj, dotarr) {\n a = dotarr.shift();\n if ( dotarr.length == 0 ) { // if at last element in chain, get value\n return obj[a] || null;\n }\n else {\n if (obj[a] == undefined) {\n //database likes null, but doesn't like undefined\n return null;\n }\n return Object.getByString(obj[a], dotarr);\n }\n};\n\n// Pass object to initialize, and the map of key-value pairs, and the values to pull from with keys\n// where value is the nested structure in dot notation 'nest1.nest2.nest3'\nObject.setStructure = function(obj, map, vals) {\n angular.forEach(map, function(value, key) {\n Object.setAtString(obj, value.split('.'), vals[key]);\n });\n};\n\n// Pull values from a nested structure and map them to a new structure defined in map\nObject.getFromStructure = function(to_obj, from_obj, map) {\n angular.forEach(map, function(value, key) {\n to_obj[key] = Object.getByString(from_obj, value.split('.'));\n });\n};\n\n// Find the first key where 2 arrays or objects intersect and return it\nclient.arraysIntersect = function(arr1, arr2) {\n if( Array.isArray(arr1) && Array.isArray(arr2) ) {\n for(let i=0; i < arr1.length; i++) {\n for(let j=0; j < arr2.length; j++) {\n if(arr1[i] == arr2[j]) {\n return arr1[i];\n }\n }\n }\n }\n else if( Array.isArray(arr1) && !Array.isArray(arr2) ) {\n for(let i=0; i < arr1.length; i++) {\n for(let key in arr2) {\n if(arr1[i] == key && arr2[key]) {\n return key;\n }\n }\n }\n }\n else if( !Array.isArray(arr1) && Array.isArray(arr2) ) {\n for(let key in arr1) {\n for(let i=0; i < arr2.length; i++) {\n if(arr2[i] == key && arr1[key]) {\n return key;\n }\n }\n }\n }\n else {\n for(let key in arr1) {\n for(let key2 in arr2) {\n if(key == key2 && arr1[key] && arr2[key2]) {\n return key;\n }\n }\n }\n }\n\n return false;\n};"},{"type":"function","name":"eventStream","enabled":true,"id":256,"code":"client.EventStream = class EventStream {\n constructor() {\n this.stream = {};\n }\n\n registerEvent(event, callback) {\n if(this.stream[event] === undefined) {\n this.stream[event] = [];\n }\n this.stream[event].push(callback);\n }\n\n raiseEvent(event, data) {\n let streamEvent = this.stream[event];\n if(streamEvent !== undefined) {\n for(let i=0; i < streamEvent.length; i++) {\n streamEvent[i](data);\n }\n }\n if(client.sysLogging.logEvents) {\n client.sysLog(event+ ' event fired with data:');\n client.sysLog(data);\n }\n }\n};\n\nclient.eventStream = new client.EventStream();"},{"type":"function","name":"allLoaded","enabled":true,"id":258,"code":"client.system_loaded = true;\n\nclient.eventStream.raiseEvent('SystemLoaded');\n\nrun_function('SystemLoaded', {}, 'ALL');"}]},{"type":"group","name":"system","enabled":true,"id":16,"items":[{"type":"group","name":"system aliases","enabled":true,"id":7,"items":[{"type":"alias","name":"","enabled":true,"id":4,"matching":"exact","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"client.sys.pause();"}],"text":"pp on"},{"type":"alias","name":"","enabled":true,"id":5,"matching":"exact","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"client.sys.unpause();"}],"text":"pp off"},{"type":"alias","name":"","enabled":true,"id":3,"matching":"exact","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"client.sys.pauseToggle();"}],"text":"pp"},{"type":"alias","name":"","enabled":true,"id":271,"matching":"regexp","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"client.sys.setTarget(args[1]);"}],"text":"^tt?\\s+(\\w+)$"},{"type":"alias","name":"Toggle Health/Mana","enabled":true,"id":324,"matching":"exact","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"client.sys.toggleSystemStatus('sipPriority');"}],"text":"hh"}]},{"type":"group","name":"systemTrigger","enabled":true,"id":277,"items":[{"type":"trigger","name":"SystemOutput Event Trigger","enabled":true,"id":278,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^SystemEvent (.+)$","actions":[{"action":"script","script":"client.eventStream.raiseEvent(args[1]);"},{"action":"gag"}]},{"type":"trigger","name":"","enabled":true,"id":363,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"** Illusion **","actions":[{"action":"script","script":"client.sys.lifevision = true;"}]}]},{"type":"function","name":"systemSettings","enabled":true,"id":93,"code":"client.sys = client.sys || {};\n\nlet sep = get_variable('commandSeparator');\n\nclient.sys.settings = {\n sep: sep,\n overrideTab: false,\n overrideUpDown: false,\n customPrompt: false,\n echoAffGot: false,\n echoAffLost: false,\n echoDefGot: true,\n echoDefLost: true,\n echoBalanceGot: true,\n echoBalanceLost: false,\n echoTrackableGot: true,\n echoTrackableLost: true,\n echoPrioritySet: true,\n curingMethod: 'Transmutation',\n sipHealthAt: 80,\n sipManaAt: 80,\n mossHealthAt: 80,\n mossManaAt: 80,\n focus: true,\n focusOverHerbs: true,\n tree: true,\n clot: true,\n clotAt: 5,\n insomnia: true,\n fracturesAbove: 30,\n manaAbilitiesAbove: 1,\n batch: true\n};\n"},{"type":"function","name":"systemCreate","enabled":true,"id":372,"code":"client.sys.state = {\n paused: false,\n slowMode: false,\n curingMethod: 'Transmutation',\n sipPriority: \"Health\",\n sipHealthAt: 80,\n sipManaAt: 80,\n mossHealthAt: 80,\n mossManaAt: 80,\n focus: true,\n focusOverHerbs: true,\n tree: true,\n clot: true,\n clotAt: 5,\n insomnia: true,\n fracturesAbove: 30,\n manaAbilitiesAbove: 1,\n batch: true\n};\n\nclient.sys.char = client.sys.char || {\n class: \"\",\n race: \"\",\n color: \"\",\n h: 5000,\n m: 5000,\n e: 20000,\n w: 20000,\n xp: 0,\n\n maxh: 5000,\n maxm: 5000,\n maxw: 20000,\n maxe: 20000,\n\n bleed: 0,\n rage: 0,\n kai: 0,\n shin: 0,\n stance: \"\",\n target: \"\"\n};\n\nclient.sys.target = client.sys.target || client.GMCP.Target || '';\nclient.sys.lifevision = false;\n\nlet settings = client.sys.settings;\nfor(let setting in settings) {\n client.sys.state[setting] = settings[setting];\n}\n\nlet sep = get_variable('commandSeparator');\nclient.sys.settings.sep = sep;\nclient.sys.sep = sep;"},{"type":"function","name":"systemService","enabled":true,"id":262,"code":"client.sys.isPaused = function() { return client.sys.state.paused; };\n\nclient.sys.isSlowMode = function() { return client.sys.state.slowMode; };\n\nclient.sys.getClass = function() { return client.sys.char.class; };\n\nclient.sys.isClass = function(className) {\n if(className == undefined) {\n return true;\n }\n\n if(Array.isArray(className)) {\n for(let i=0;i < className.length;i++) {\n if(client.sys.checkClass(className[i])) {\n return true;\n }\n }\n return false;\n }\n else {\n return client.sys.checkClass(className);\n }\n};\n\nclient.sys.checkClass = function(className) {\n return client.sys.getClass().toLowerCase() == className.toLowerCase();\n};\n\nclient.sys.setTarget = function(target) {\n target = target.toProperCase();\n client.eventStream.raiseEvent('TargetSetEvent', target);\n\n if(client.sys.target != target) {\n client.sys.target = target;\n client.eventStream.raiseEvent('TargetChanged', target);\n }\n client.eventStream.raiseEvent('SystemOutputAdd','settarget '+target);\n client.set_current_target(target, true);\n};\n\nclient.sys.isTarget = function(person) {\n return person == undefined ? false : client.sys.target.toLowerCase() == person.toLowerCase();\n};\n\nclient.sys.pause = function() {\n client.sys.state.paused = true;\n client.eventStream.raiseEvent('SystemPaused');\n};\n\nclient.sys.unpause = function() {\n client.sys.state.paused = false;\n client.eventStream.raiseEvent('SystemUnpaused');\n};\n\nclient.sys.pauseToggle = function() {\n if(client.sys.isPaused()) {\n client.sys.unpause();\n }\n else {\n client.sys.pause();\n }\n};\n\nclient.sys.slowOn = function() {\n client.sys.state.slowMode = true;\n client.eventStream.raiseEvent('SystemSlowModeOn');\n};\n\nclient.sys.slowOff = function() {\n client.sys.state.slowMode = false;\n client.eventStream.raiseEvent('SystemSlowModeOff');\n};\n\nclient.sys.slowToggle = function() {\n if(client.sys.isSlowMode()) {\n client.sys.slowOff();\n }\n else {\n client.sys.slowOn();\n }\n};\n\nclient.sys.setSystemStatus = function(status, arg) {\n client.sys.state[status] = arg;\n client.eventStream.raiseEvent('SystemStatusSetEvent', {status: status, arg: arg});\n};\n\nclient.sys.toggleSystemStatus = function(status) {\n if(client.sys.state[status] == \"Health\") {\n client.sys.setSystemStatus(status, \"Mana\");\n }\n else if(client.sys.state[status] == \"Mana\") {\n client.sys.setSystemStatus(status, \"Health\");\n }\n else {\n client.sys.setSystemStatus(status, !client.sys.state[status]);\n }\n};"},{"type":"function","name":"systemOutput","enabled":true,"id":276,"code":"let outputInProgress = false;\nlet outputPending = false;\nlet output = [];\nlet outputFeedbackCommand = \"echo SystemEvent SystemOutputCompleteEvent\";\nlet outputChunkSize = 10;\nlet eventOutput = [];\nlet outputTrack = new client.Balance('SystemOutput', 1.0);\n\nlet addToOutput = function(command) {\n if(Array.isArray(command)) {\n output = output.concat(command);\n }\n else {\n output.push(command);\n }\n};\n\nlet sendOutput = function () {\n if(output.length > 0) {\n client.eventStream.raiseEvent('OutputSentEvent', output);\n addToOutput(outputFeedbackCommand);\n let chunks = (output.length-1)/outputChunkSize + 1;\n for(let i = 0; i < chunks; i++) {\n let chunk = output.slice(i * outputChunkSize, i * outputChunkSize + outputChunkSize);\n let cmd = chunk.join(client.sys.sep);\n client.sendCmd(cmd);\n }\n outputInProgress = true;\n eventOutput = [];\n client.eventStream.raiseEvent('SystemOutputLostBalEvent');\n }\n};\n\nlet populateOutputFlag = false;\n\nlet populateOutput = function () {\n if(populateOutputFlag) {\n\n if (outputInProgress || client.sys.isPaused() || client.sys.isSlowMode()) {\n outputPending = true;\n }\n else {\n populateOutputFlag = false;\n output = [];\n outputPending = false;\n\n let affList = client.getCurrentAffs(); // make sure these return in prio order\n let balList = client.getCurrentBals();\n\n\n //loop affs repeatedly until no for-sure cures happen, remove those affs, bals\n //loop affs repeatedly until no maybe cures happen, remove those affs, bals\n addToOutput(client.getCureOutputs(affList, balList));\n addToOutput(client.getLustCommands());\n\n //loop defs\n addToOutput(client.getDefOutputs(affList, balList));\n //loop precache\n addToOutput(client.getCacheOutputs(affList));\n\n // add commands that have been accumulated from other events\n addToOutput(eventOutput);\n\n addToOutput(client.getCommandsToDo(affList, balList));\n\n sendOutput();\n }\n }\n};\n\nlet addToEventOutput = function(command) {\n if(Array.isArray(command)) {\n eventOutput = eventOutput.concat(command);\n }\n else {\n eventOutput.push(command);\n }\n forcePopulateOutput();\n};\n\nclient.eventStream.registerEvent('SystemOutputAdd', addToEventOutput);\n\nlet forcePopulateOutput = function() {\n populateOutputFlag = true;\n populateOutput();\n};\n\nlet flagPopulateOutput = function() {\n populateOutputFlag = true;\n};\n\nclient.eventStream.registerEvent('PromptEvent', populateOutput);\nclient.eventStream.registerEvent('ForcePopulateEvent', forcePopulateOutput);\nclient.eventStream.registerEvent('AffGot', flagPopulateOutput);\nclient.eventStream.registerEvent('AffLost', flagPopulateOutput);\nclient.eventStream.registerEvent('DefGot', flagPopulateOutput);\nclient.eventStream.registerEvent('DefLost', flagPopulateOutput);\nclient.eventStream.registerEvent('BalanceGot', flagPopulateOutput);\nclient.eventStream.registerEvent('BalanceLost', flagPopulateOutput);\nclient.eventStream.registerEvent('AffPrioritySetEvent', flagPopulateOutput);\nclient.eventStream.registerEvent('DefPrioritySetEvent', flagPopulateOutput);\nclient.eventStream.registerEvent('PrioritySetEvent', flagPopulateOutput);\nclient.eventStream.registerEvent('RealLustGotEvent', flagPopulateOutput);\nclient.eventStream.registerEvent('RiftListCompleteEvent', forcePopulateOutput);\n\nlet outputComplete = function (balance) {\n if(balance.name == \"SystemOutput\") {\n client.eventStream.raiseEvent('OutputCompleteEvent', output);\n outputInProgress = false;\n output = [];\n \n if(outputPending) {\n forcePopulateOutput();\n }\n }\n};\n\nclient.eventStream.registerEvent('BalanceGot', outputComplete);\n\nlet systemOutputComplete = function() {\n client.eventStream.raiseEvent('SystemOutputGotBalEvent');\n};\n\nclient.eventStream.registerEvent('SystemOutputCompleteEvent', systemOutputComplete);"},{"type":"function","name":"systemEvents","enabled":true,"id":373,"code":"client.sys.lifevision = false;\n\nlet setCharVitals = function(vitals) {\n let sysChar = client.sys.char;\n let oh = sysChar.h;\n let om = sysChar.m;\n let oe = sysChar.e;\n let ow = sysChar.w;\n let omaxh = sysChar.maxh;\n let omaxm = sysChar.maxm;\n let omaxe = sysChar.maxe;\n let omaxw = sysChar.maxw;\n let oxp = sysChar.xp;\n\n let h = vitals.hp || oh;\n let m = vitals.mp || om;\n let e = vitals.ep || oe;\n let w = vitals.wp || ow;\n let maxh = vitals.maxhp || omaxh;\n let maxm = vitals.maxmp || omaxm;\n let maxe = vitals.maxep || omaxe;\n let maxw = vitals.maxwp || omaxw;\n let xp = vitals.xp || oxp;\n\n sysChar.h = h;\n sysChar.m = m;\n sysChar.e = e;\n sysChar.w = w;\n sysChar.maxh = maxh;\n sysChar.maxm = maxm;\n sysChar.maxe = maxe;\n sysChar.maxw = maxw;\n sysChar.xp = xp;\n\n if(h != oh) {\n client.eventStream.raiseEvent(\"HealthUpdated\", {max: maxh, current: h, diff: h-oh});\n }\n\n if(m != om) {\n client.eventStream.raiseEvent(\"ManaUpdated\", {max: maxm, current: m, diff: m-om});\n }\n\n if(maxh != omaxh) {\n client.eventStream.raiseEvent(\"MaxHealthUpdated\", {max: maxh, current: h, diff: maxh-omaxh});\n }\n\n if(maxm != omaxm) {\n client.eventStream.raiseEvent(\"MaxManaUpdated\", {max: maxm, current: m, diff: maxm-omaxm});\n }\n\n\n if(h == 0) {\n if(oh > 0) {\n client.sys.pause();\n client.eventStream.raiseEvent(\"DiedEvent\");\n }\n }\n else {\n if(oh == 0 && h > 0) {\n client.sys.unpause();\n client.eventStream.raiseEvent(\"AliveEvent\");\n }\n }\n\n client.eventStream.raiseEvent('SystemCharVitalsUpdated', sysChar);\n};\n\nlet setCharStatus = function(status) {\n let sysChar = client.sys.char;\n let otarget = sysChar.target;\n let oclass = sysChar.class;\n let orace = sysChar.race;\n\n let curTarget = (status.target || otarget).split(' ')[0].toProperCase();\n let curClass = (status.class || oclass).toProperCase();\n let curRace = (status.race || orace);\n let curColor = \"\";\n if(curRace.indexOf(\"Dragon\") >= 0) {\n curClass = \"Dragon\";\n curColor = curRace.split(\" \")[0];\n }\n\n sysChar.target = curTarget;\n sysChar.class = curClass;\n sysChar.race = curRace;\n sysChar.color = curColor;\n\n if(otarget != curTarget) {\n client.eventStream.raiseEvent('GameTargetChanged', {old: otarget, new: curTarget});\n }\n if(oclass != curClass) {\n client.eventStream.raiseEvent('ClassChanged', {old: oclass, new: curClass});\n }\n\n client.eventStream.raiseEvent('SystemCharStatusUpdated', sysChar);\n};\n\nclient.eventStream.registerEvent('Char.Vitals', setCharVitals);\nclient.eventStream.registerEvent('Char.Status', setCharStatus);\n\nclient.eventStream.registerEvent('PromptEvent', function() { client.sys.lifevision = false; });"}]},{"type":"group","name":"baseClasses","enabled":true,"id":57,"items":[{"type":"function","name":"countableClass","enabled":true,"id":58,"code":"client.Countable = class Countable {\n constructor(name, min=0, max=0) {\n this._name = name;\n this._min = min;\n this._max = max;\n this._count = this._min;\n this._prev = this._count;\n }\n\n get count() { return this._count }\n get name() { return this._name }\n get min() { return this._min }\n get max() { return this._max }\n\n raiseEventCountableUp() {\n client.eventStream.raiseEvent('CountableUpEvent', this);\n }\n\n raiseEventCountableDown() {\n client.eventStream.raiseEvent('CountableDownEvent', this);\n }\n\n raiseEventCountableSet() {\n client.eventStream.raiseEvent('CountableSetEvent', this);\n }\n\n raiseEventCountableReset() {\n client.eventStream.raiseEvent('CountableResetEvent', this);\n }\n\n checkLimits(num) {\n if(num > this._max) {\n return this._max;\n }\n\n if(num < this._min) {\n return this._min;\n }\n\n return num;\n }\n\n setCount(num) {\n this._prev = this._count;\n this._count = num;\n this.raiseEventCountableSet();\n return this._count;\n }\n\n reset() {\n this.setCount(this._min);\n this.raiseEventCountableReset();\n return this._count;\n }\n\n add(num=1) {\n this.setCount(this.checkLimits(this._count + num));\n this.raiseEventCountableUp();\n return this._count;\n }\n\n subtract(num=1) {\n this.setCount(this.checkLimits(this._count - num));\n this.raiseEventCountableDown();\n return this._count;\n }\n};"},{"type":"function","name":"priorityClass","enabled":true,"id":59,"code":"client.Priority = class Priority {\n constructor(name, prio=0) {\n this._name = name;\n this._default = prio;\n this._current = prio;\n this._prev = prio;\n }\n\n get name() { return this._name }\n get prio() { return this._current }\n get defaultPrio() { return this._default }\n\n raiseEventPrioSet() {\n client.eventStream.raiseEvent('PrioritySetEvent', this);\n }\n raiseEventPrioReset() {\n client.eventStream.raiseEvent('PriorityResetEvent', this);\n }\n raiseEventPrioSetDefault() {\n client.eventStream.raiseEvent('PrioritySetDefaultEvent', this);\n }\n\n setPrio(prio) {\n this._prev = this.prio;\n this._current = prio;\n if(this._current != this._prev) {\n this.raiseEventPrioSet();\n }\n }\n\n\n reset() {\n this.setPrio(this.defaultPrio);\n if(this._current != this._prev) {\n this.raiseEventPrioReset();\n }\n }\n\n setDefault(prio) {\n this._default = prio;\n this.setPrio(prio);\n this.raiseEventPrioSetDefault();\n }\n};"},{"type":"function","name":"timerClass","enabled":true,"id":61,"code":"client.Timer = class Timer {\n constructor(name, length=0) {\n this._name = name;\n this._enabled = false;\n this._t_started = 0;\n this._t_ended = 0;\n this._timerId = 0;\n this._default_length = length;\n this.setLength(length);\n this._callbacks = [];\n }\n\n get length() { return this._t_length }\n\n\n setLength(length) {\n this._t_length = length;\n this._t_length_ms = length*1000;\n }\n\n reset() {\n this.setLength(this._default_length);\n }\n\n start() {\n if(this._enabled) {\n clearTimeout(this._timerId);\n }\n this._timerId = setTimeout(this.stop.bind(this), this._t_length_ms);\n this._t_started = performance.now()/1000;\n this._enabled = true;\n }\n\n stop() {\n if(this._enabled) {\n clearTimeout(this._timerId);\n this._t_ended = performance.now()/1000;\n this._enabled = false;\n if(this._callbacks) {\n for(let i=0; i < this._callbacks.length;i++) {\n this._callbacks[i](this._t_ended - this._t_started);\n //add clear callback method so can set one time callbacks and clear them\n }\n }\n }\n }\n\n duration() {\n if(this._enabled) {\n return this.elapsed();\n }\n else {\n return this._t_ended - this._t_started;\n }\n }\n\n elapsed() {\n if(this._enabled) {\n return (performance.now()/1000 - this._t_started);\n }\n else {\n return 0;\n }\n }\n\n remaining() {\n if(this._enabled) {\n return (this._t_length - performance.now()/1000 - this._t_started);\n }\n else {\n return 0;\n }\n };\n\n addCallback(callback) {\n this._callbacks.push(callback);\n }\n\n clearCallbacks() {\n this._callbacks = [];\n }\n};"},{"type":"function","name":"trackableClass","enabled":true,"id":63,"code":"client.Trackable = class Trackable {\n constructor(name) {\n this._name = name;\n this._status = false;\n this._got_time = 0;\n this._lost_time = 0;\n client.eventStream.registerEvent(name+'LostTrackableEvent', this.lost.bind(this));\n client.eventStream.registerEvent(name+'GotTrackableEvent', this.got.bind(this));\n }\n\n get have() { return this._status }\n get name() { return this._name }\n\n raiseEventGot() {\n client.eventStream.raiseEvent('TrackableGot', this);\n }\n\n raiseEventLost() {\n client.eventStream.raiseEvent('TrackableLost', this);\n }\n\n got() {\n this._status = true;\n this._got_time = performance.now();\n this.raiseEventGot();\n }\n\n lost() {\n this._status = false;\n this._lost_time = performance.now();\n this.raiseEventLost();\n }\n\n elapsed() {\n return this._status ? (performance.now() - this._got_time)/1000.0 : 0;\n }\n};"},{"type":"function","name":"priorityQueueClass","enabled":true,"id":331,"code":"class Node {\n constructor(key, value){\n this.key = key;\n this.value = value;\n }\n}\n\nclass Heap {\n constructor(opt_heap) {\n this.nodes = [];\n if (opt_heap) {\n this.insertAll(opt_heap);\n }\n }\n\n insert(key, value) {\n let node = new Node(key, value);\n let nodes = this.nodes;\n nodes.push(node);\n this.moveUp(nodes.length - 1);\n\n }\n\n insertAll(heap) {\n let keys, values;\n if (heap instanceof Heap) {\n keys = Object.keys(heap);\n values = Object.values(heap);\n\n if (this.nodes.length <= 0) {\n let nodes = this.nodes;\n for (let i = 0; i < keys.length; i++) {\n nodes.push(new Node(keys[i], values[i]));\n }\n return;\n }\n } else {\n keys = Object.keys(heap);\n values = Object.values(heap);\n }\n\n for (let i = 0; i < keys.length; i++) {\n this.insert(keys[i], values[i]);\n }\n\n }\n\n remove() {\n let nodes = this.nodes;\n let count = nodes.length;\n let rootNode = nodes[0];\n if (count <= 0) {\n return undefined;\n } else if (count == 1) {\n this.nodes = [];\n } else {\n nodes[0] = nodes.pop();\n this.moveDown(0);\n }\n return rootNode.value;\n }\n\n peek() {\n let nodes = this.nodes;\n if (nodes.length == 0) {\n return undefined;\n }\n return nodes[0].value;\n }\n\n peekKey() {\n return this.nodes[0] && this.nodes[0].key;\n }\n\n moveDown(index) {\n let nodes = this.nodes;\n let count = nodes.length;\n\n // Save the node being moved down.\n let node = nodes[index];\n // While the current node has a child.\n while (index < (count >> 1)) {\n let leftChildIndex = this.getLeftChildIndex(index);\n let rightChildIndex = this.getRightChildIndex(index);\n\n // Determine the index of the smaller child.\n let smallerChildIndex = rightChildIndex < count &&\n nodes[rightChildIndex].key < nodes[leftChildIndex].key ?\n rightChildIndex :\n leftChildIndex;\n\n // If the node being moved down is smaller than its children, the node\n // has found the correct index it should be at.\n if (nodes[smallerChildIndex].key > node.key) {\n break;\n }\n\n // If not, then take the smaller child as the current node.\n nodes[index] = nodes[smallerChildIndex];\n index = smallerChildIndex;\n }\n nodes[index] = node;\n }\n\n moveUp(index) {\n var nodes = this.nodes;\n var node = nodes[index];\n\n // While the node being moved up is not at the root.\n while (index > 0) {\n // If the parent is less than the node being moved up, move the parent down.\n var parentIndex = this.getParentIndex(index);\n if (nodes[parentIndex].key > node.key) {\n nodes[index] = nodes[parentIndex];\n index = parentIndex;\n } else {\n break;\n }\n }\n nodes[index] = node;\n }\n\n getLeftChildIndex(index) {\n return index * 2 + 1;\n }\n\n getRightChildIndex(index) {\n return index * 2 + 2;\n }\n\n getParentIndex(index) {\n return (index - 1) >> 1;\n }\n}\n\nclient.PriorityQueue = class PriorityQueue extends Heap {\n constructor(opt_heap) {\n super(opt_heap);\n }\n\n push(priority, value) {\n this.insert(priority, value);\n }\n\n pop() {\n return this.remove();\n }\n};\n\n\n"}]},{"type":"group","name":"affs","enabled":true,"id":74,"items":[{"type":"function","name":"affTable","enabled":true,"id":28,"code":"let affs = {};\n\naffs.list = [\n 'addiction',\n 'aeon',\n 'agoraphobia',\n 'airdisrupt',\n 'airfisted',\n 'amnesia',\n 'anorexia',\n 'asthma',\n 'blackout',\n 'bleeding',\n 'blindness',\n 'bound',\n 'brokenleftarm',\n 'brokenrightarm',\n 'brokenleftleg',\n 'brokenrightleg',\n 'bruisedribs',\n 'burning',\n 'cadmuscurse',\n 'claustrophobia',\n 'clumsiness',\n 'conflagration',\n 'confusion',\n 'corruption',\n 'crackedribs',\n 'daeggerimpale',\n 'damagedhead',\n 'damagedleftarm',\n 'damagedleftleg',\n 'damagedrightarm',\n 'damagedrightleg',\n 'darkshade',\n 'dazed',\n 'deadening',\n 'deafness',\n 'death',\n 'dehydrated',\n 'dementia',\n 'demonstain',\n 'disloyalty',\n 'disrupted',\n 'dissonance',\n 'dizziness',\n 'earthdisrupt',\n 'enlightenment',\n 'enmesh',\n 'entangled',\n 'epilepsy',\n 'fear',\n 'firedisrupt',\n 'flamefisted',\n 'frozen',\n 'galed',\n 'generosity',\n 'hamstrung',\n 'haemophilia',\n 'hallucinations',\n 'healthleech',\n 'heartseed',\n 'hecatecurse',\n 'hellsight',\n 'homunculusmercury',\n 'hypersomnia',\n 'hypochondria',\n 'hypothermia',\n 'icefisted',\n 'impaled',\n 'internalbleeding',\n 'impatience',\n 'lovers',\n 'inquisition',\n 'insomnia',\n 'insulation',\n 'itching',\n 'justice',\n 'laceratedthroat',\n 'lethargy',\n 'loneliness',\n 'lullaby',\n 'manaleech',\n 'masochism',\n 'mildtrauma',\n 'mangledleftarm',\n 'mangledleftleg',\n 'mangledrightarm',\n 'mangledrightleg',\n 'mangledhead',\n 'nausea',\n 'slimeobscure',\n 'numbedleftarm',\n 'numbedrightarm',\n 'pacified',\n 'palpatarfeed',\n 'paralysis',\n 'paranoia',\n 'peace',\n 'phlogisticated',\n 'pinshot',\n 'prone',\n 'recklessness',\n 'selarnia',\n 'serioustrauma',\n 'sensitivity',\n 'scalded',\n 'scytherus',\n 'shivering',\n 'shyness',\n 'skullfractures',\n 'slashedthroat',\n 'sleeping',\n 'slickness',\n 'spiritdisrupt',\n 'stun',\n 'stupidity',\n 'stuttering',\n 'temperedcholeric',\n 'temperedmelancholic',\n 'temperedphlegmatic',\n 'temperedsanguine',\n 'timeflux',\n 'torntendons',\n 'transfixation',\n 'trueblind',\n 'vertigo',\n 'vinewreathed',\n 'voidfisted',\n 'voyria',\n 'waterdisrupt',\n 'weakenedmind',\n 'weariness',\n 'webbed',\n 'whisperingmadness',\n 'wristfractures',\n 'unconsciousness',\n\n 'harmonic',\n 'bop',\n 'spiritwrack',\n 'bedevil',\n 'loki',\n 'moon',\n 'evileye',\n 'dragoncurse',\n 'swiftcurse',\n];\n\naffs.prios = {\n //affs that don't have serverside prio because can't be 'cured', set as 0\n airfisted: 0,\n bruisedribs: 0,\n cadmuscurse: 0,\n conflagration: 0,\n corruption: 0,\n death: 0,\n dehydrated: 0,\n demonstain: 0,\n enlightenment: 0,\n enmesh: 0,\n flamefisted: 0,\n galed: 0,\n hamstrung: 0,\n hecatecurse: 0,\n homunculusmercury: 0,\n icefisted: 0,\n internalbleeding: 0,\n inquisition: 0,\n lullaby: 0,\n numbedleftarm: 0,\n numbedrightarm: 0,\n palpatarfeed: 0,\n phlogisticated: 0,\n pinshot: 0,\n slimeobscure: 0,\n stun: 0,\n timeflux: 0,\n trueblind: 0,\n vinewreathed: 0,\n voidfisted: 0,\n weakenedmind: 0,\n unconsciousness: 0,\n\n\n //serverside affs 1-26, 26=ignore\n\n aeon: 2,\n anorexia: 2,\n sleeping: 2,\n\n\n heartseed: 3,\n paralysis: 3,\n skullfractures: 3,\n\n hypothermia: 4,\n impatience: 4,\n torntendons: 4,\n\n earthdisrupt: 5,\n hypochondria: 5,\n lovers: 5,\n itching: 5,\n pacified: 5,\n peace: 5,\n scytherus: 5,\n\n asthma: 6,\n bound: 6,\n daeggerimpale: 6,\n clumsiness: 6,\n entangled: 6,\n impaled: 6,\n sensitivity: 6,\n transfixation: 6,\n weariness: 6,\n webbed: 6,\n\n damagedleftleg: 7,\n damagedrightleg: 7,\n darkshade: 7,\n mangledleftleg: 7,\n mangledrightleg: 7,\n spiritdisrupt: 7,\n\n brokenleftleg: 8,\n brokenrightleg: 8,\n confusion: 8,\n hallucinations: 8,\n hypersomnia: 8,\n\n disrupted: 9,\n mangledhead: 9,\n prone: 9,\n stupidity: 9,\n voyria: 9,\n\n airdisrupt: 10,\n brokenleftarm: 10,\n brokenrightarm: 10,\n firedisrupt: 10,\n slickness: 10,\n waterdisrupt: 10,\n wristfractures: 10,\n\n addiction: 11,\n crackedribs: 11,\n haemophilia: 11,\n lethargy: 11,\n nausea: 11,\n whisperingmadness: 11,\n\n damagedhead: 12,\n hellsight: 12,\n recklessness: 12,\n\n damagedleftarm: 13,\n damagedrightarm: 13,\n healthleech: 13,\n manaleech: 13,\n temperedcholeric: 13,\n temperedmelancholic: 13,\n temperedphlegmatic: 13,\n temperedsanguine: 13,\n\n disloyalty: 14,\n dissonance: 14,\n dizziness: 14,\n mangledleftarm: 14,\n mangledrightarm: 14,\n shyness: 14,\n\n agoraphobia: 15,\n claustrophobia: 15,\n deadening: 15,\n frozen: 15,\n generosity: 15,\n justice: 15,\n loneliness: 15,\n shivering: 15,\n vertigo: 15,\n\n dementia: 16,\n mildtrauma: 16,\n paranoia: 16,\n serioustrauma: 16,\n\n epilepsy: 17,\n\n burning: 18,\n laceratedthroat: 18,\n slashedthroat: 18,\n stuttering: 18,\n\n selarnia: 19,\n\n fear: 20,\n masochism: 20,\n scalded: 20,\n dazed: 20,\n\n //affs you can cure on your own, but no serverside, 30-49, 30=ignore\n bleeding: 30,\n amnesia: 31,\n blackout: 32,\n\n //def affs\n insomnia: 10,\n insulation: 20,\n deafness: 21,\n blindness: 22,\n\n // unknowns, 100=ignore\n harmonic: 100,\n bop: 100,\n spiritwrack: 100,\n bedevil: 100,\n loki: 101,\n moon: 101,\n evileye: 101,\n dragoncurse: 101,\n swiftcurse: 101,\n};\n\naffs.types = {};\n\naffs.types.defs = {\n blindness: true,\n deafness: true,\n insomnia: true,\n insulation: true\n};\n\naffs.types.countable = {\n bleeding: {min:0, max:15000},\n burning: {min:0, max:5},\n crackedribs: {min:0, max:7},\n skullfractures: {min:0, max:7},\n temperedcholeric: {min:0, max:8},\n temperedmelancholic: {min:0, max:8},\n temperedphlegmatic: {min:0, max:8},\n temperedsanguine: {min:0, max:8},\n torntendons: {min:0, max:7},\n wristfractures: {min:0, max:7}\n};\n\naffs.types.timed = {\n aeon: {length: 16},\n airfisted: {length: 16},\n blackout: {length: 10},\n bruisedribs: {length: 30},\n cadmuscurse: {length: 20},\n corruption: {length: 45},\n dehydrated: {length: 60},\n demonstain: {length: 120},\n enmesh: {length: 5},\n flamefisted: {length: 30},\n hamstrung: {length: 9},\n heartseed: {length: 11},\n hecatecurse: {length: 16},\n icefisted: {length: 30},\n internalbleeding: {length: 30},\n inquisition: {length: 30},\n numbedleftarm: {length: 7.5},\n numbedrightarm: {length: 7.5},\n phlogisticated: {length: 45},\n pinshot: {length: 18},\n slimeobscure: {length: 30},\n stun: {length: 3},\n timeflux: {length: 60},\n trueblind: {length: 6},\n unconsciousness: {length: 10},\n vinewreathed: {length: 30},\n voidfisted: {length: 5},\n weakenedmind: {length: 60}\n};\n\naffs.types.unknown = {\n moon: ['stupidity', 'confusion', 'epilepsy', 'masochism', 'hypersomnia', 'hallucinations'],\n loki: ['stupidity', 'clumsiness', 'recklessness', 'asthma', 'shyness', 'darkshade', 'paralysis',\n 'brokenleftarm', 'brokenrightarm', 'brokenleftleg', 'brokenrightleg', 'sensitivity',\n 'disloyalty', 'nausea', 'weariness', 'dizziness', 'anorexia', 'voyria',\n 'haemophilia', 'addiction', 'selarnia', 'slickness', 'scytherus'],\n evileye: [ 'confusion', 'dizziness' ],\n dragoncurse: [ 'recklessness', 'clumsiness', 'epilepsy', 'dizziness', 'pacifism', 'nausea', 'addiction',\n 'anorexia', 'generosity', 'disloyalty', 'sensitivity', 'vertigo', 'paranoia', 'stupidity',\n 'hypochondria', 'lethargy', 'insulation', 'shivering', 'frozen', 'impatience', 'paralysis',\n 'asthma', 'agoraphobia' ],\n harmonic: ['stupidity', 'recklessness'],\n bop: ['stupidity', 'recklessness'],\n swiftcurse: ['stupidity', 'clumsiness', 'recklessness', 'asthma', 'paralysis',\n 'deafness', 'sensitivity', 'nausea', 'weariness', 'dizziness', 'anorexia', 'voyria',\n 'haemophilia', 'addiction', 'impatience', 'claustrophobia', 'vertigo', 'agoraphobia',\n 'masochism', 'epilepsy', 'manaleech', 'pacifism', 'dementia', 'healthleech'],\n bedevil: ['stupidity', 'recklessness']\n};\n\naffs.types.uncurable = {\n cadmuscurse: true,\n conflagration: true,\n death: true,\n enlightenment: true,\n galed: true,\n insomnia: true,\n lullaby: true,\n palpatarfeed: true,\n stun: true,\n weakenedmind: true\n};\n\nclient.affTable = affs;"},{"type":"function","name":"affClass","enabled":true,"id":50,"code":"client.Aff = class Aff extends client.Trackable {\n constructor(name, prio = 0, uncurable = false) {\n super(name);\n this._prio = new Priority(this._name, prio);\n this._cures = [];\n this._serverside = false;\n if(prio >= 0 && prio <= 26) {\n this._serverside = true;\n }\n this._uncurable = uncurable;\n this.registerEvents();\n }\n\n registerEvents() {\n client.eventStream.registerEvent(this.name+'LostAffEvent', this.lost.bind(this));\n client.eventStream.registerEvent(this.name+'GotAffEvent', this.got.bind(this));\n }\n \n get isUncurable() { return this._uncurable }\n\n get isServerSide() { return this._serverside }\n\n get cures() { return this._cures }\n\n get prio() { return this._prio.prio }\n\n raiseEventGot() {\n client.eventStream.raiseEvent('AffGot', this);\n }\n\n raiseEventLost() {\n client.eventStream.raiseEvent('AffLost', this);\n }\n\n raiseEventSet() {\n if(!this.isUncurable) {\n client.eventStream.raiseEvent('AffPrioritySetEvent', this);\n }\n }\n\n got() {\n if(!this.have) {\n super.got();\n }\n }\n\n lost() {\n if(this.have) {\n super.lost();\n }\n }\n\n addCure(cure) {\n this._cures.push(cure);\n }\n\n set_prio(prio) {\n this._prio.setPrio(prio);\n this.raiseEventSet();\n }\n\n set_default_prio(prio) {\n this._prio.setDefault(prio);\n this.set_prio(prio);\n }\n\n toggle_default_prio(prio) {\n if(this._prio.prio === prio) {\n this.set_default_prio(0);\n }\n else {\n this.set_default_prio(prio);\n }\n }\n\n reset_prio () {\n this._prio.reset();\n this.raiseEventSet();\n }\n};\n\nclient.AffCountable = class AffCountable extends client.Aff {\n constructor(name, prio, min=0, max=0, uncurable=false) {\n super(name, prio, uncurable);\n this._count = new client.Countable(this._name, min, max);\n }\n\n registerEvents() {\n super.registerEvents();\n client.eventStream.registerEvent(this.name+'AffCountSubtractEvent', this.subtract.bind(this));\n client.eventStream.registerEvent(this.name+'AffCountAddEvent', this.add.bind(this));\n client.eventStream.registerEvent(this.name+'AffCountSetEvent', this.setCount.bind(this));\n }\n\n\n get count() { return this._count.count }\n get min() { return this._count.min }\n get max() { return this._count.max }\n\n\n setCount(num) {\n this._count.setCount(num);\n }\n\n lost() {\n this.setCount(this.min);\n super.lost();\n }\n\n add(num=1) {\n let count = this._count.add(num);\n if(count > this.min && !this.have) {\n this.got();\n }\n }\n\n subtract(num=1) {\n let count = this._count.subtract(num);\n if(count == this.min) {\n this.lost();\n }\n }\n};\n\nclient.AffTimed = class AffTimed extends client.Aff {\n constructor(name, prio, length=0, uncurable=false) {\n super(name, prio, uncurable);\n this._timer = new client.Timer(this._name, length);\n this._timer.addCallback(this.lost.bind(this));\n }\n\n got() {\n this._timer.start();\n super.got();\n }\n\n lost() {\n this._timer.stop();\n super.lost();\n }\n};\n\nclient.AffDef = class AffDef extends client.Aff {\n constructor(name, prio=0, uncurable=false) {\n super(name, prio, uncurable);\n }\n registerEvents() {\n client.eventStream.registerEvent(name+'LostAffEvent', this.got.bind(this));\n client.eventStream.registerEvent(name+'GotAffEvent', this.lost.bind(this));\n client.eventStream.registerEvent(name+'LostDefEvent', this.got.bind(this));\n client.eventStream.registerEvent(name+'GotDefEvent', this.lost.bind(this));\n }\n\n raiseEventSet() {\n if(!this.isUncurable) {\n client.eventStream.raiseEvent('DefPrioritySetEvent', this);\n }\n }\n};"},{"type":"function","name":"affCreate","enabled":true,"id":52,"code":"client.Affs = {};\n\nlet affs = client.affTable;\nfor(let i=0; i < affs.list.length; i++) {\n let affname = affs.list[i];\n let count = affs.types.countable[affname];\n let timed = affs.types.timed[affname];\n let defs = affs.types.defs[affname];\n let prio = affs.prios[affname];\n let uncurable = affs.types.uncurable[affname];\n\n if(count) {\n client.Affs[affname] = new client.AffCountable(affname, prio, count.min, count.max, uncurable);\n }\n else if(timed) {\n client.Affs[affname] = new client.AffTimed(affname, prio, timed.length, uncurable);\n }\n else if(defs) {\n client.Affs[affname] = new client.AffDef(affname, prio, uncurable);\n }\n else {\n client.Affs[affname] = new client.Aff(affname, prio, uncurable);\n }\n}\n\nlet addCuresToAffs = function(cures) {\n for(let cure in cures) {\n let order = cures[cure].order;\n if(order != undefined) {\n for(let i = 0; i < order.length; i++) {\n client.Affs[order[i]].addCure(cure);\n }\n }\n }\n};\n\nclient.eventStream.registerEvent('CuresCreatedEvent', addCuresToAffs);\n\n"},{"type":"function","name":"affEvents","enabled":true,"id":91,"code":"let eventGmcpAffList = function(list) {\n let prev_list = client.getCurrentAffs();\n let new_list = {};\n\n for (let i in list) {\n let count = 0;\n let aff = list[i].name;\n let index = 0;\n\n if( (index = aff.search('\\(\\\\d+\\)')) >= 0) {\n count = parseInt(aff.substr(index, 1));\n aff = aff.substr(0, index-2);\n }\n // maintain new list, to compare to old list when done\n new_list[aff] = true;\n\n client.eventStream.raiseEvent(aff+'GotAffEvent');\n\n // add counts here\n if(count > 0) {\n client.eventStream.raiseEvent(aff+'AffCountSetEvent', count);\n }\n }\n\n\n // compare new list to old list and remove affs that are no longer there\n for (let i=0; i < prev_list.length; i++) {\n if(new_list[prev_list[i]] === undefined) {\n client.eventStream.raiseEvent(prev_list[i]+'LostAffEvent');\n }\n }\n};\n\nclient.eventStream.registerEvent('Char.Afflictions.List', eventGmcpAffList);\n\n\nlet eventGmcpAffAdd = function(obj) {\n let aff = obj.name;\n let index = 0;\n let count = 0;\n if( (index = aff.search('\\(\\\\d+\\)')) >= 0) {\n count = parseInt(aff.substr(index, 1));\n aff = aff.substr(0, index-2);\n }\n\n client.eventStream.raiseEvent(aff+'GotAffEvent');\n\n if(count > 0) {\n client.eventStream.raiseEvent(aff+'AffCountAddEvent', count);\n }\n};\n\nclient.eventStream.registerEvent('Char.Afflictions.Add', eventGmcpAffAdd);\n\n\nlet eventGmcpAffRemove = function(aff) {\n aff = aff[0].toLowerCase();\n client.eventStream.raiseEvent(aff+'LostAffEvent');\n};\n\nclient.eventStream.registerEvent('Char.Afflictions.Remove', eventGmcpAffRemove);\n\n\nlet deathEvent = function() {\n client.eventStream.raiseEvent('deathGotAffEvent');\n};\n\nlet aliveEvent = function() {\n client.eventStream.raiseEvent('deathLostAffEvent');\n};\n\nclient.eventStream.registerEvent('AliveEvent', aliveEvent);\nclient.eventStream.registerEvent('DeathEvent', deathEvent);\n\n\nlet setAffPrios = function() {\n let affs = client.Affs;\n for(let aff in affs) {\n let curAff = affs[aff];\n curAff.set_prio(curAff.prio);\n }\n};\n\nclient.eventStream.registerEvent('ServersideSettingsCaptured', setAffPrios);"},{"type":"function","name":"affService","enabled":true,"id":273,"code":"client.getCurrentAffs = function() {\n let affs = client.Affs;\n let current_affs = [];\n let queue = new client.PriorityQueue();\n for(let aff in affs) {\n if(affs[aff].have) {\n //push on priority queue\n queue.push(affs[aff].prio, affs[aff].name);\n //current_affs.push(affs[aff].name);\n }\n }\n \n let i = 100;\n while(queue.nodes.length > 0 && i > 0) {\n current_affs.push(queue.pop());\n i--;\n if(i == 1) {\n console.log('aff service looped');\n console.log(queue.nodes);\n }\n }\n\n //pop from priority queue in order and fill array\n\n return current_affs;\n};\n\nclient.haveAff = function(aff) {\n let curAff = client.Affs[aff];\n if(aff == undefined || curAff == undefined) {\n client.sysLog('Called client.haveAff with an aff that does not exist: ' + aff);\n return false;\n }\n else {\n return curAff.have;\n }\n};\n\nclient.haveAffs = function(affs) {\n if(affs == undefined) {\n return false;\n }\n\n if(Array.isArray(affs)) {\n for(let i=0;i < affs.length;i++) {\n if(!client.haveAff(affs[i])) {\n return false;\n }\n }\n return true;\n }\n else {\n return client.haveAff(affs);\n }\n};\n\nclient.haveAnAff = function(affs) {\n if(affs == undefined) {\n return false;\n }\n\n if(Array.isArray(affs)) {\n for(let i=0;i < affs.length;i++) {\n if(client.haveAff(affs[i])) {\n return true;\n }\n }\n return false;\n }\n else {\n return client.haveAff(affs);\n }\n};\n\nclient.affPrioSwap = function(aff, prio) {\n let curAff = client.Affs[aff];\n if(aff == undefined || curAff == undefined) {\n client.sysLog('Called client.affPrioSwap with an aff that does not exist: ' + aff);\n }\n else {\n curAff.set_prio(prio);\n }\n};"},{"type":"group","name":"self affs triggers","enabled":true,"id":89,"items":[{"type":"trigger","name":"","enabled":true,"id":75,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"The fires consuming you diminish somewhat.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('burningAffCountSubtractEvent', 1);"}]}]}]},{"type":"group","name":"balances","enabled":true,"id":76,"items":[{"type":"function","name":"balanceTable","enabled":true,"id":36,"code":"let balances = {};\n\nbalances.objs = {\n herb: {\n length: 1.6,\n aff_modifiers: {homunculusmercury: {multiplier: 1.0, offset: .5}, earthdisrupt: {multiplier: 1.0, offset: .5}},\n },\n focus: {\n length: 2.5,\n aff_modifiers: {weakenedmind: {multiplier: 2.0, offset: .5}},\n },\n sip: {\n length: 4.5,\n aff_modifiers: {skullfractures: {multiplier: 1.0, offset: 1.0}},\n },\n moss: {\n length: 6.0\n },\n\n tree: {\n length: 15.0,\n aff_modifiers: {slimeobscure: {multiplier: 1.0, offset: 10.0}},\n },\n\n equilibrium: {\n length: 20.0,\n aff_modifiers: {confusion: {multiplier: 1.5, offset: 0.0}},\n },\n balance: {\n length: 20.0,\n aff_modifiers: {lethargy: {multiplier: 1.25, offset: 0.0}},\n },\n salve: {\n length: 1.0,\n aff_modifiers: {timeflux: {multiplier: 1.5, offset: 0.0}},\n },\n immunity: {\n length: 10.0\n },\n rebounding: {\n length: 9.0\n },\n smoke: {\n length: 1.5\n },\n dragonbreath: {\n length: 1.5\n },\n deafness: {\n length: 3.0\n },\n deaf: {\n length: 6.0\n },\n blind: {\n length: 6.0\n },\n speed: {\n length: 6.0\n },\n wake: {\n length: 20\n },\n sileris: {\n length: 8\n },\n free: {\n length: 0\n },\n voice: {\n length: 2.5\n },\n tremolo: {\n length: 6.0\n },\n homunculus: {\n length: 6.0\n },\n fitness: {\n length: 10.0\n },\n bloodboil: {\n length: 10.0\n },\n dragonheal: {\n length: 20.0\n },\n rage: {\n length: 10.0\n },\n salt: {\n length: 10.0\n },\n shrugging: {\n length: 12.0\n },\n fool: {\n length: 40.0\n },\n writhe: {\n length: 6.0\n },\n impalewrithe: {\n length: 4.0\n }\n};\n\nclient.balTable = balances.objs;"},{"type":"function","name":"balanceClass","enabled":true,"id":65,"code":"client.Balance = class Balance extends client.Trackable {\n constructor(name, length=60) {\n super(name);\n this._length = length;\n this._timer = new client.Timer(this._name, this._length);\n this._status = true;\n this.registerEvents();\n }\n\n get duration() { return this._timer.duration() }\n\n registerEvents() {\n client.eventStream.registerEvent(this.name+'LostBalEvent', this.lost.bind(this));\n client.eventStream.registerEvent(this.name+'GotBalEvent', this.got.bind(this));\n }\n\n raiseEventGot() {\n client.eventStream.raiseEvent('BalanceGot', this);\n }\n\n raiseEventLost() {\n client.eventStream.raiseEvent('BalanceLost', this);\n }\n\n got() {\n if(!this.have) {\n this.clearCallbacks();\n this._timer.stop();\n super.got();\n }\n }\n\n lost() {\n if(this.have) {\n this.addCallback(this.got.bind(this));\n this._timer.start();\n super.lost();\n }\n }\n\n on() {\n if(!this.have) {\n this.got();\n }\n }\n\n off() {\n if(this.have) {\n this.lost();\n }\n }\n\n setTimer(length) {\n this._timer.setLength(length);\n }\n\n resetTimer() {\n this._timer.reset();\n }\n\n addCallback(callback) {\n this._timer.addCallback(callback);\n }\n \n clearCallbacks() {\n this._timer.clearCallbacks();\n }\n};\n\nclient.BalExtended = class BalExtended extends client.Balance {\n constructor(name, length, obj){\n super(name, length);\n this._aff_modifiers = obj.aff_modifiers;\n this._mods = {};\n this.registerAffModifiers();\n }\n\n registerAffModifiers() {\n for(let name in this._aff_modifiers) {\n this._mods[name] = false;\n client.eventStream.registerEvent(name+'LostAffEvent', this.removeModifier.bind(this));\n client.eventStream.registerEvent(name+'GotAffEvent', this.addModifier.bind(this));\n }\n }\n\n removeModifier(aff) {\n this._mods[aff] = false;\n }\n\n addModifier(aff) {\n this._mods[aff] = true;\n }\n\n got() {\n this.resetTimer();\n super.got();\n }\n\n lost() {\n let length = this._length;\n for(let i=0; i < this._mods;i++) {\n let aff_mod = this._aff_modifiers[this._mods[i]];\n length *= aff_mod.multiplier;\n length += aff_mod.offset;\n }\n this.setTimer(length);\n super.lost();\n }\n};"},{"type":"function","name":"balanceCreate","enabled":true,"id":71,"code":"client.Bals = {};\n\nlet balances = client.balTable;\n\nfor(let bal in balances) {\n let obj = {};\n let length = balances[bal].length;\n\n if(balances[bal].aff_modifiers) {\n obj.aff_modifiers = balances[bal].aff_modifiers;\n client.Bals[bal] = new client.BalExtended(bal, length, obj);\n\n } else {\n client.Bals[bal] = new client.Balance(bal, length);\n }\n}"},{"type":"function","name":"balanceEvents","enabled":true,"id":90,"code":"let eventGmcpBalances = function(vitals) {\n if(vitals.bal == '1') {\n client.eventStream.raiseEvent('balanceGotBalEvent');\n }\n else {\n client.eventStream.raiseEvent('balanceLostBalEvent');\n }\n \n if(vitals.eq == '1') {\n client.eventStream.raiseEvent('equilibriumGotBalEvent');\n }\n else {\n client.eventStream.raiseEvent('equilibriumLostBalEvent');\n }\n};\n\nclient.eventStream.registerEvent('Char.Vitals', eventGmcpBalances);"},{"type":"function","name":"balanceService","enabled":true,"id":274,"code":"client.getCurrentBals = function () {\n let bals = client.Bals;\n let current_bals = [];\n for(let bal in bals) {\n if(bals[bal].have) {\n current_bals.push(bals[bal].name);\n }\n }\n\n return current_bals;\n};\n\nclient.haveBal = function(bal) {\n let curBal = client.Bals[bal];\n if(bal == undefined || curBal == undefined) {\n client.sysLog('Called client.haveBal with a balance that does not exist: ' + bal);\n return false;\n }\n else {\n return curBal.have;\n }\n};\n\nclient.haveBals = function(bals) {\n if(bals == undefined) {\n return false;\n }\n\n if(Array.isArray(bals)) {\n for(let i=0;i < bals.length;i++) {\n if(!client.haveBal(bals[i])) {\n return false;\n }\n }\n return true;\n }\n else {\n return client.haveBal(bals);\n }\n};\n\nclient.haveABal = function(bals) {\n if(bals == undefined) {\n return false;\n }\n\n if(Array.isArray(bals)) {\n for(let i=0;i < bals.length;i++) {\n if(client.haveBal(bals[i])) {\n return true;\n }\n }\n return false;\n }\n else {\n return client.haveBal(bals);\n }\n};"},{"type":"group","name":"self balance herb","enabled":true,"id":98,"items":[{"type":"trigger","name":"","enabled":true,"id":97,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You may eat another plant or mineral.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":99,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat a magnesium chip.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'magnesium');"}]},{"type":"trigger","name":"","enabled":true,"id":100,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat an aurum flake.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'aurum');"}]},{"type":"trigger","name":"","enabled":true,"id":101,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat a plumbum flake.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'plumbum');"}]},{"type":"trigger","name":"","enabled":true,"id":102,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat a stannum flake.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'stannum');"}]},{"type":"trigger","name":"","enabled":true,"id":103,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat an arsenic pellet.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'arsenic');"}]},{"type":"trigger","name":"","enabled":true,"id":104,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat a ferrum flake.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'ferrum');"}]},{"type":"trigger","name":"","enabled":true,"id":105,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat an antimony flake.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'antimony');"}]},{"type":"trigger","name":"","enabled":true,"id":106,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat a cuprum flake.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'cuprum');"}]},{"type":"trigger","name":"","enabled":true,"id":107,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat an argentum flake.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'argentum');"}]},{"type":"trigger","name":"","enabled":true,"id":108,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat a calamine crystal.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'calamine');"}]},{"type":"trigger","name":"","enabled":true,"id":115,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat a bloodroot leaf.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'bloodroot');"}]},{"type":"trigger","name":"","enabled":true,"id":116,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat a piece of kelp.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'kelp');"}]},{"type":"trigger","name":"","enabled":true,"id":117,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat a goldenseal root.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'goldenseal');"}]},{"type":"trigger","name":"","enabled":true,"id":118,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat some prickly ash bark.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'ash');"}]},{"type":"trigger","name":"","enabled":true,"id":119,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat some bayberry bark.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'bayberry');"}]},{"type":"trigger","name":"","enabled":true,"id":120,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat a ginseng root.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'ginseng');"}]},{"type":"trigger","name":"","enabled":true,"id":121,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat a ginger root.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'ginger');"}]},{"type":"trigger","name":"","enabled":true,"id":122,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat a bellwort flower.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'bellwort');"}]},{"type":"trigger","name":"","enabled":true,"id":123,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat a lobelia seed.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'lobelia');"}]},{"type":"trigger","name":"","enabled":true,"id":124,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat a hawthorn berry.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('herbLostBalEvent', 'hawthorn');"}]}]},{"type":"group","name":"self balance focus","enabled":true,"id":114,"items":[{"type":"trigger","name":"","enabled":true,"id":113,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Your mind is able to focus once again.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('focusGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":125,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"The blow sets your head to spinning - you cannot concentrate on anything.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('focusLostBalEvent', 'smashHigh');"}]},{"type":"trigger","name":"","enabled":true,"id":126,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You focus your mind intently on curing your mental maladies.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('focusLostBalEvent', 'focus');"}]},{"type":"trigger","name":"","enabled":true,"id":127,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"A diminutive homunculus resembling (\\w+) turns its head towards you, its jaws opening wider than what seems possible\\. The homunculus stares intently at you and lets out an ear\\-piercing shriek that disrupts your thoughts\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('focusLostBalEvent', 'shriek');"}]},{"type":"trigger","name":"","enabled":true,"id":128,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You concentrate, but your mind is too tired to focus.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('focusLostBalEvent', 'alreadyOff');"}]},{"type":"trigger","name":"","enabled":true,"id":129,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^\\w+ swings (his|her) shield around, smashing your temple with a backhanded blow\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('focusLostBalEvent', 'smashHigh');"}]}]},{"type":"group","name":"self balance sip","enabled":true,"id":130,"items":[{"type":"trigger","name":"","enabled":true,"id":131,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You may drink another health or mana elixir.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('sipGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":132,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"The elixir heals and soothes you.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('sipLostBalEvent', 'sipHealth');"}]},{"type":"trigger","name":"","enabled":true,"id":133,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Your mind feels stronger and more alert.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('sipLostBalEvent', 'sipMana');"}]},{"type":"trigger","name":"","enabled":true,"id":134,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^You take some elixir from (.+) and rub it into your (.+)\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('sipLostBalEvent', 'applyHealth'); //add args for limb"}]},{"type":"trigger","name":"","enabled":true,"id":135,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"The elixir flows down your throat without effect.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('sipLostBalEvent', 'alreadyOff');"}]},{"type":"trigger","name":"","enabled":true,"id":136,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"The health elixir fizzles away without any discernable effect.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('sipLostBalEvent', 'alreadyOff');"}]}]},{"type":"group","name":"self balance moss","enabled":true,"id":137,"items":[{"type":"trigger","name":"","enabled":true,"id":138,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You may eat another bit of irid moss or potash.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('mossGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":139,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You feel your health and mana replenished.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('mossLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":140,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"The potash slides down without effect.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('mossLostBalEvent', 'alreadyOff');"}]}]},{"type":"group","name":"self balance tree","enabled":true,"id":141,"items":[{"type":"trigger","name":"","enabled":true,"id":142,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You may utilise the tree tattoo again.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('treeGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":143,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You touch the tree of life tattoo.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('treeLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":144,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Your tree of life tattoo glows faintly for a moment then fades, leaving you unchanged.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('treeLostBalEvent', 'alreadyOff');"}]}]},{"type":"group","name":"self balance salve","enabled":true,"id":149,"items":[{"type":"trigger","name":"","enabled":true,"id":150,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You may apply another salve to yourself.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('salveGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":151,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"The salve dissolves and quickly disappears after you apply it.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('salveLostBalEvent', 'alreadyOff');"}]},{"type":"trigger","name":"","enabled":true,"id":152,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^\\[Curing\\]\\: APPLY RESTORATION TO (\\w+)$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('salveLostBalEvent', 4);\n"}]},{"type":"trigger","name":"","enabled":true,"id":155,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^\\[Curing\\]\\: APPLY (MENDING|EPIDERMAL|CALORIC)(.*)$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('salveLostBalEvent', 1);\n"}]}]},{"type":"group","name":"self balance immunity","enabled":true,"id":154,"items":[{"type":"trigger","name":"","enabled":true,"id":153,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Your system is able to absorb antidotes once again.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('immunityGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":156,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"The liquid reacts with the substance still present in your system, cancelling itself out.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('immunityLostBalEvent', 'alreadyOff');"}]},{"type":"trigger","name":"","enabled":true,"id":183,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"[Curing]: SIP IMMUNITY","actions":[{"action":"script","script":"client.eventStream.raiseEvent('immunityLostBalEvent');"}]}]},{"type":"group","name":"self balance rebounding","enabled":true,"id":158,"items":[{"type":"trigger","name":"","enabled":true,"id":184,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You feel an aura of rebounding surround you.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('reboundingGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":178,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Your aura of weapons rebounding disappears.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('reboundingGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":181,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You puff on the pipe, but your existing aura of weapons rebounding negates any effect.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('reboundingGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":180,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You take a long drag of malachite off your pipe","actions":[{"action":"script","script":"client.eventStream.raiseEvent('reboundingLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":179,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You take a long drag of skullcap off your pipe.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('reboundingLostBalEvent');"}]}]},{"type":"group","name":"self balance smoke","enabled":true,"id":159,"items":[{"type":"trigger","name":"","enabled":true,"id":157,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Your lungs have recovered enough to smoke another mineral or plant.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('smokeGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":185,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Your lungs have not yet recovered enough to allow you to smoke.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('smokeLostBalEvent', 'alreadyOff');"}]},{"type":"trigger","name":"","enabled":true,"id":186,"matching":"begins","whole_words":true,"case_sensitive":true,"text":"You take a long drag of ","actions":[{"action":"script","script":"client.eventStream.raiseEvent('smokeLostBalEvent');"}]}]},{"type":"group","name":"self balance dragonbreath","enabled":true,"id":160,"items":[{"type":"trigger","name":"","enabled":true,"id":182,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Your \\w+ summoning is complete\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('dragonbreathGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":187,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You already have your breath summoned, Wyrm.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('dragonbreathLostBalEvent', 'alreadyOff');"}]},{"type":"trigger","name":"","enabled":true,"id":188,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You feel your eyes begin to blaze as you summon lightning to your belly.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('dragonbreathLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":194,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"With an almost inaudible growl, you begin summoning a fiery inferno into your belly.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('dragonbreathLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":195,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"With a great effort, you begin to summon caustic hell to your innards.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('dragonbreathLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":196,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Flaring your wings and head back, you begin summoning forth the icy cold of the pure, endless void into your belly.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('dragonbreathLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":197,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"With a great shudder, you begin to summon forth the defiling, deadly wyrmvenom of legend.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('dragonbreathLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":198,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Calling upon the vast well of mental power at your disposal, you begin to summon a mind-rending blast of psi energy.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('dragonbreathLostBalEvent');"}]}]},{"type":"group","name":"self balance deafness","enabled":true,"id":161,"items":[{"type":"trigger","name":"","enabled":true,"id":190,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"The aural world fades to silence.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('deafnessGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":193,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat a calamine crystal.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('deafnessLostBalEvent', 'calamine');"}]},{"type":"trigger","name":"","enabled":true,"id":199,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You eat a hawthorn berry.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('deafnessLostBalEvent', 'hawthorn');"}]}]},{"type":"group","name":"self balance deaf","enabled":true,"id":162,"items":[{"type":"trigger","name":"","enabled":true,"id":192,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You are already deaf.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('deafGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":191,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"The world about you falls silent as the deafness trance sinks upon you.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('deafGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":200,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You stare straight ahead and concentrate on a distant focal point.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('deafLostBalEvent');"}]}]},{"type":"group","name":"self balance blind","enabled":true,"id":163,"items":[{"type":"trigger","name":"","enabled":true,"id":201,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You are already blind.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('blindGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":202,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You open your eyes once more, and the world about you is darkness.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('blindGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":203,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You close your eyes for a moment.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('blindLostBalEvent');"}]}]},{"type":"group","name":"self balance speed","enabled":true,"id":164,"items":[{"type":"trigger","name":"","enabled":true,"id":204,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Tiny tremours spread through your body as the world seems to slow down.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('speedGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":205,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"[Curing]: SIP SPEED","actions":[{"action":"script","script":"client.eventStream.raiseEvent('speedLostBalEvent');"}]}]},{"type":"group","name":"self balance sileris","enabled":true,"id":165,"items":[{"type":"trigger","name":"","enabled":true,"id":206,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"The quicksilver hardens into a supple metallic shell.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('silerisGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":207,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"The sileris berry juice hardens into a supple purple shell.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('silerisGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":208,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You apply a quicksilver droplet to yourself.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('silerisLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":209,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You apply a sileris berry to yourself.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('silerisLostBalEvent');"}]}]},{"type":"group","name":"self balance voice","enabled":true,"id":166,"items":[{"type":"trigger","name":"","enabled":true,"id":210,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You have recovered voice balance.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('voiceGotBalEvent');"}]}]},{"type":"group","name":"self balance tremolo","enabled":true,"id":167,"items":[{"type":"trigger","name":"","enabled":true,"id":211,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You may mangle a limb with the vibrato or tremolo once again.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('tremoloGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":222,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^With a trilling vibrato you attack (\\w+)\\'s broken (left|right) arm\\. (He|She) screams in pain\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('tremoloLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":223,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Using a heavy tremolo you brutally punish (\\w+)\\'s already shattered (left|right) leg\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('tremoloLostBalEvent');"}]}]},{"type":"group","name":"self balance homunculus","enabled":true,"id":168,"items":[{"type":"trigger","name":"","enabled":true,"id":212,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You may order your homunculus once more.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('homunculusGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":224,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Focusing your mind on a diminutive homunculus resembling (\\w+), you command it to disrupt (\\w+)\\'s focus\\. The homunculus turns towards (him|her) before letting out an ear\\-piercing shriek\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('homunculusLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":225,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You are unable to order your homunculus again so soon.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('homunculusLostBalEvent', 'alreadyOff');"}]}]},{"type":"group","name":"self balance fitness","enabled":true,"id":169,"items":[{"type":"trigger","name":"","enabled":true,"id":213,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You may purge your lungs once again.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('fitnessGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":226,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You inhale deeply, purging yourself of your asthmatic condition.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('fitnessLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":227,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You may not purge your lungs again as of this time.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('fitnessLostBalEvent', 'alreadyOff');"}]}]},{"type":"group","name":"self balance bloodboil","enabled":true,"id":170,"items":[{"type":"trigger","name":"","enabled":true,"id":214,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You may boil your blood once again.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('bloodboilGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":228,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You summon spirits of fire to burn off that which afflicts you.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('bloodboilLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":229,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You have not recovered enough to boil your blood again as of yet.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('bloodboilLostBalEvent', 'alreadyOff');"}]}]},{"type":"group","name":"self balance dragonheal","enabled":true,"id":171,"items":[{"type":"trigger","name":"","enabled":true,"id":215,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You may purge your great form of afflictions once again.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('dragonhealGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":230,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You let out a great keening, and cast the impurities from your form.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('dragonhealLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":231,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You have not yet recovered enough to purge your great form of afflictions.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('dragonhealLostBalEvent', 'alreadyOff');"}]},{"type":"trigger","name":"","enabled":true,"id":232,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Your mind and body are too disjointed to invoke your healing powers, wyrm.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('dragonhealLostBalEvent', 'alreadyOff');"}]}]},{"type":"group","name":"self balance rage","enabled":true,"id":172,"items":[{"type":"trigger","name":"","enabled":true,"id":216,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You may channel your rage to cure your afflictions once again.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('rageGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":233,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You allow your pent-up rage to vent and your eyes flash dangerously.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('rageLostBalEvent');"}]}]},{"type":"group","name":"self balance salt","enabled":true,"id":173,"items":[{"type":"trigger","name":"","enabled":true,"id":217,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Directing the energy of salt, you surround yourself with a primal aura, purging yourself of ailments.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('saltLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":234,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You may channel alchemical energy to heal yourself once again.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('saltGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":235,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You have not recovered enough to heal yourself with alchemical energy once again.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('saltLostBalEvent', 'alreadyOff');"}]}]},{"type":"group","name":"self balance shrugging","enabled":true,"id":174,"items":[{"type":"trigger","name":"","enabled":true,"id":218,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Your body has recovered enough to shrug afflictions once again.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('shruggingGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":236,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Focusing inward, you purge your body of afflictions.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('shruggingLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":237,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You may not shrug again so soon.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('shruggingLostBalEvent', 'alreadyOff');"}]}]},{"type":"group","name":"self balance fool","enabled":true,"id":175,"items":[{"type":"trigger","name":"","enabled":true,"id":219,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You may heal another affliction.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('foolGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":238,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You press the Fool tarot to your forehead.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('foolLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":239,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"The Fool has no effect on you.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('foolLostBalEvent', 'alreadyOff');"}]}]},{"type":"group","name":"self balance writhe","enabled":true,"id":176,"items":[{"type":"trigger","name":"","enabled":true,"id":220,"matching":"begins","whole_words":true,"case_sensitive":true,"text":"You have writhed free","actions":[{"action":"script","script":"client.eventStream.raiseEvent('writheGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":240,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You begin to writhe helplessly, throwing your body off balance.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('writheGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":241,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You begin to struggle free of your entanglement.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('writheLostBalEvent', 'entangled');"}]},{"type":"trigger","name":"","enabled":true,"id":242,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You begin trying to wrest your mind free of that which has transfixed it.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('writheLostBalEvent', 'transfixation');"}]},{"type":"trigger","name":"","enabled":true,"id":243,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You twist and turn as you attempt to escape from your entanglement.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('writheLostBalEvent', 'alreadyOff');"}]},{"type":"trigger","name":"","enabled":true,"id":244,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You continue trying to wrest your mind free.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('writheLostBalEvent', 'alreadyOff');"}]}]},{"type":"group","name":"self balance impalewrithe","enabled":true,"id":177,"items":[{"type":"trigger","name":"","enabled":true,"id":221,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"With an heroic effort you manage to writhe yourself free from the weapon that impaled you.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('writheGotBalEvent', 'impale');"}]},{"type":"trigger","name":"","enabled":true,"id":245,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"^With a vicious snarl \\w+ carves a merciless swathe through your steaming guts\\. You gurgle and choke as s?he withdraws (his|her) dripping blade, glistening with gore\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('writheGotBalEvent', 'impale');"}]},{"type":"trigger","name":"","enabled":true,"id":246,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"^Searing pain tears through your midsection as you wrench away from ([A-Z][a-z]+), (his|her) weapon ripping unceremoniously through your innards\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('writheGotBalEvent', 'impale');"}]},{"type":"trigger","name":"","enabled":true,"id":247,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"^With a snarl of contempt, \\w+ allows you to slide free of (her|his) weapon\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('writheGotBalEvent', 'impale');"}]},{"type":"trigger","name":"","enabled":true,"id":248,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You begin to writhe furiously to escape the blade that has impaled you.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('writheLostBalEvent', 'impale');"}]}]},{"type":"group","name":"self balance alleviate","enabled":true,"id":353,"items":[{"type":"trigger","name":"","enabled":true,"id":354,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You may purge your body of afflictions once again.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('alleviateGotBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":355,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"There are no pesky afflictions keeping you from your destiny, Warrior.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('alleviateLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":356,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Applying your knowledge of anatomy, you massage pressure points with your fingers, and a flood of relief courses through your body.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('alleviateLostBalEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":357,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You are too exhausted to purge your body of afflictions.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('alleviateLostBalEvent', 'alreadyOff');"}]}]}]},{"type":"group","name":"defs","enabled":true,"id":77,"items":[{"type":"function","name":"defTable","enabled":true,"id":40,"code":"let defs = {};\n\ndefs.objs = {\n acrobatics: {\n command: 'acrobatics on',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['balance'],\n blocks: ['death', 'sleeping'],\n skills: ['Bard'],\n serverside: true\n },\n airpocket: {\n command: ['outr calcite', 'eat calcite'],\n bals_req: [],\n bals_used: [],\n blocks: ['death', 'sleeping', 'anorexia'],\n serverside: true\n },\n alertness: {\n command: 'alertness on',\n bals_req: ['equilibrium'],\n bals_used: ['equilibrium'],\n serverside: true\n },\n aria: {\n command: 'sing aria at me',\n bals_req: ['voice'],\n bals_used: ['voice'],\n blocks: ['death', 'sleeping'],\n skills: ['Bard'],\n },\n arctar: {\n command: 'command orb',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n blocks: ['death', 'sleeping'],\n skills: ['Occultist'],\n },\n arrowcatching: {\n command: 'arrowcatch on',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['balance'],\n blocks: ['death', 'sleeping'],\n skills: ['Bard'],\n serverside: true\n },\n astronomy: {\n command: 'astronomy empower me',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n blocks: ['death', 'sleeping'],\n skills: ['Alchemist'],\n serverside: true\n },\n balancing: {\n command: 'balancing on',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['balance'],\n blocks: ['death', 'sleeping'],\n skills: ['Bard'],\n serverside: true\n },\n blindness: {\n command: ['outr arsenic', 'eat arsenic'],\n bals_req: ['herb'],\n bals_used: ['herb'],\n blocks: ['death', 'sleeping', 'anorexia'],\n serverside: true\n },\n blocking: {\n command: 'block d',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['balance'],\n blocks: ['death', 'sleeping', 'prone'],\n },\n bodyblock: {\n command: 'bdb',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['balance'],\n blocks: ['death', 'sleeping'],\n skills: ['Monk'],\n serverside: true\n },\n boostedregeneration: {\n command: 'boost regeneration',\n bals_req: ['free'],\n bals_used: ['free'],\n blocks: ['death', 'sleeping'],\n skills: ['Monk'],\n serverside: true\n },\n cloak: {\n command: 'touch cloak',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n blocks: ['prone', 'death', 'sleeping', ['brokenleftarm', 'brokenrightarm'], ['brokenleftarm', 'damagedrightarm'], ['brokenleftarm', 'mangledrightarm'],\n ['damagedleftarm', 'brokenrightarm'], ['damagedleftarm', 'damagedrightarm'], ['damagedleftarm', 'mangledrightarm'],\n ['mangledleftarm', 'brokenrightarm'], ['mangledleftarm', 'damagedrightarm'], ['mangledleftarm', 'mangledrightarm'],\n 'entangled' ,'transfixation', 'impaled', 'webbed', 'bound', 'icefist'],\n serverside: true\n },\n chargeshield: {\n command: 'cast chargeshield at me',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n skills: ['Magi'],\n serverside: true\n },\n coldresist: {\n command: 'activate cold resistance',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n serverside: true\n },\n compoundmask: {\n command: ['wear mask', 'secure mask'],\n bals_req: ['free'],\n bals_used: ['free'],\n skills: ['Alchemist'],\n },\n consciousness: {\n command: 'consciousness on',\n bals_req: ['free'],\n bals_used: ['free'],\n blocks: ['death', 'sleeping'],\n skills: ['Monk', 'Blademaster'],\n serverside: true\n },\n constitution: {\n command: 'constitution',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n skills: ['Monk', 'Blademaster'],\n serverside: true\n },\n curseward: {\n command: 'curseward',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n serverside: true\n },\n deafness: {\n command: ['outr calamine', 'eat calamine'],\n bals_req: ['herb', 'deafness'],\n bals_used: ['herb', 'deafness'],\n blocks: ['death', 'sleeping', 'anorexia'],\n serverside: true\n },\n deathsight: {\n command: 'deathsight',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n serverside: true\n },\n density: {\n command: 'wear shackle',\n bals_req: ['salve'],\n bals_used: ['salve'],\n blocks: ['death', 'slickness', 'sleeping'],\n serverside: true\n },\n devilmark: {\n command: 'devilmark',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n blocks: ['death', 'prone', 'sleeping'],\n skills: ['Occultist'],\n serverside: true\n },\n diamondskin: {\n command: 'cast diamondskin',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n skills: ['Magi'],\n serverside: true\n },\n distortedaura: {\n command: 'distortaura',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n blocks: ['death', 'prone', 'sleeping'],\n skills: ['Occultist'],\n serverside: true\n },\n dragonarmour: {\n command: 'dragonarmour',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n blocks: ['death', 'prone', 'sleeping'],\n skills: ['Dragon'],\n serverside: true\n },\n dragonbreath: {\n command: 'summon ice',\n bals_req: ['balance', 'equilibrium', 'dragonbreath'],\n bals_used: ['free', 'dragonbreath'],\n blocks: ['death', 'prone', 'sleeping'],\n skills: ['Dragon'],\n preempt: true,\n serverside: true\n },\n drunkensailor: {\n command: 'drunkensailor',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['balance'],\n blocks: ['death', 'sleeping'],\n skills: ['Bard'],\n serverside: true\n },\n electricresist: {\n command: 'activate electric resistance',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n serverside: true\n },\n enhancedform: {\n command: ['outr 3 argentum', 'outr 2 quicksilver', 'amalgamate enhancement', 'imbibe enhancement'],\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n blocks: ['death', 'sleeping'],\n skills: ['Alchemist'],\n },\n evadeblock: {\n command: 'evb',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['balance'],\n blocks: ['death', 'sleeping'],\n skills: ['Monk'],\n serverside: true\n },\n fireresist: {\n command: 'activate fire resistance',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n serverside: true\n },\n fangbarrier: {\n command: 'apply quicksilver',\n bals_req: ['salve', 'sileris'],\n bals_used: ['salve', 'sileris'],\n blocks: ['death', 'slickness', 'paralysis', 'sleeping'],\n serverside: true\n },\n fury: {\n command: 'fury on',\n bals_req: ['balance'],\n bals_used: ['equilibrium'],\n skills: ['Runewarden'],\n serverside: true\n },\n ghost: {\n command: 'conjure ghost',\n bals_req: ['equilibrium'],\n bals_used: ['equilibrium'],\n skills: ['Serpent'],\n serverside: true\n },\n groundwatch: {\n command: 'groundwatch on',\n bals_req: ['free'],\n bals_used: ['free'],\n serverside: true\n },\n 'guarding right leg': {\n command: 'guard right leg',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n skills: ['Monk'],\n opps: ['guarding left leg', 'guarding left arm', 'guarding right arm', 'guarding torso', 'guarding head', 'parrying right leg', 'parrying left leg', 'parrying left arm', 'parrying right arm', 'parrying torso', 'parrying head', 'parrying left', 'parrying right', 'parrying centre']\n },\n 'guarding left leg': {\n command: 'guard left leg',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n skills: ['Monk'],\n opps: ['guarding right leg', 'guarding left arm', 'guarding right arm', 'guarding torso', 'guarding head', 'parrying right leg', 'parrying left leg', 'parrying left arm', 'parrying right arm', 'parrying torso', 'parrying head', 'parrying left', 'parrying right', 'parrying centre']\n },\n 'guarding right arm': {\n command: 'guard right arm',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n skills: ['Monk'],\n opps: ['guarding left leg', 'guarding left arm', 'guarding right leg', 'guarding torso', 'guarding head', 'parrying right leg', 'parrying left leg', 'parrying left arm', 'parrying right arm', 'parrying torso', 'parrying head', 'parrying left', 'parrying right', 'parrying centre']\n },\n 'guarding left arm': {\n command: 'guard left arm',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n skills: ['Monk'],\n opps: ['guarding left leg', 'guarding right leg', 'guarding right arm', 'guarding torso', 'guarding head', 'parrying right leg', 'parrying left leg', 'parrying left arm', 'parrying right arm', 'parrying torso', 'parrying head', 'parrying left', 'parrying right', 'parrying centre']\n },\n 'guarding head': {\n command: 'guard head',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n skills: ['Monk'],\n opps: ['guarding left leg', 'guarding left arm', 'guarding right arm', 'guarding torso', 'guarding right leg', 'parrying right leg', 'parrying left leg', 'parrying left arm', 'parrying right arm', 'parrying torso', 'parrying head', 'parrying left', 'parrying right', 'parrying centre']\n },\n 'guarding torso': {\n command: 'guard torso',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n skills: ['Monk'],\n opps: ['guarding left leg', 'guarding left arm', 'guarding right arm', 'guarding right leg', 'guarding head', 'parrying right leg', 'parrying left leg', 'parrying left arm', 'parrying right arm', 'parrying torso', 'parrying head', 'parrying left', 'parrying right', 'parrying centre']\n },\n heartsfury: {\n command: 'heartsfury',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['balance'],\n blocks: ['death', 'sleeping'],\n skills: ['Bard'],\n serverside: true\n },\n heldbreath: {\n command: 'hold breath',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n blocks: ['death', 'asthma','sleeping'],\n preempt: true,\n serverside: true\n },\n hiding: {\n command: 'hide',\n bals_req: ['equilibrium', 'balance'],\n bals_used: ['balance'],\n skills: ['Serpent'],\n serverside: true\n },\n hypersight: {\n command: 'hypersight on',\n bals_req: ['balance'],\n bals_used: ['equilibrium'],\n serverside: true\n },\n immunity: {\n command: 'immunity',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n blocks: ['death', 'sleeping'],\n skills: ['Monk', 'Blademaster'],\n serverside: true\n },\n insomnia: {\n command: 'insomnia',\n bals_req: ['free'],\n bals_used: ['free'],\n blocks: ['death', 'hypersomnia','sleeping'],\n serverside: true\n },\n insulation: {\n command: 'apply caloric',\n bals_req: ['salve'],\n bals_used: ['salve'],\n blocks: ['death', 'sleeping', 'slickness', 'hypothermia'],\n serverside: true\n },\n ironform: {\n command: ['outr 2 ferrum', 'outr 1 plumbum', 'amalgamate petrifying', 'imbibe petrifying'],\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n blocks: ['death', 'sleeping'],\n skills: ['Alchemist'],\n },\n kaiboost: {\n command: 'kai boost',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n blocks: ['death', 'sleeping'],\n skills: ['Monk'],\n preempt: true,\n serverside: true\n },\n kaitrance: {\n command: 'kai trance',\n bals_req: ['free'],\n bals_used: ['free'],\n blocks: ['death', 'sleeping'],\n skills: ['Monk'],\n serverside: true\n },\n kola: {\n command: ['outr quartz', 'eat quartz'],\n bals_req: ['free'],\n bals_used: ['free'],\n blocks: ['death', 'sleeping', 'anorexia'],\n serverside: true\n },\n lay: {\n command: 'sing lay',\n bals_req: ['voice'],\n bals_used: ['voice'],\n blocks: ['death', 'sleeping'],\n skills: ['Bard'],\n serverside: true\n },\n levitating: {\n command: 'sip levitation',\n bals_req: ['free'],\n bals_used: ['free'],\n blocks: ['death', 'anorexia','sleeping'],\n serverside: true\n },\n lifevision: {\n command: 'lifevision',\n bals_req: ['equilibrium'],\n bals_used: ['equilibrium'],\n serverside: true\n },\n lipreading: {\n command: 'lipread',\n bals_req: ['equilibrium'],\n bals_used: ['equilibrium'],\n skills: ['Serpent'],\n serverside: true\n },\n locketdeath: {\n command: 'solicit locket for immortality',\n bals_req: ['free'],\n bals_used: ['free'],\n },\n magicresist: {\n command: 'activate magic resistance',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n serverside: true\n },\n blademastery: {\n command: 'mastery on',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n skills: ['Runewarden'],\n preempt: true,\n serverside: true\n },\n meditate: {\n command: 'meditate',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n blocks: ['death', 'sleeping', 'impatience'],\n preempt: true,\n },\n mercury: {\n command: 'educe mercury',\n bals_req: ['balance'],\n bals_used: ['equilibrium'],\n blocks: ['death', 'sleeping'],\n skills: ['Alchemist'],\n serverside: true\n },\n metawake: {\n command: 'metawake on',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n blocks: ['death', 'sleeping', 'lullaby'],\n serverside: true\n },\n mindcloak: {\n command: 'mind cloak on',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['balance'],\n blocks: ['death', 'sleeping'],\n preempt: true,\n skills: ['Monk'],\n serverside: true\n },\n mindnet: {\n command: 'mindnet on',\n bals_req: ['free'],\n bals_used: ['free'],\n blocks: ['death', 'sleeping'],\n skills: ['Monk', 'Blademaster'],\n serverside: true\n },\n mindseye: {\n command: 'touch mindseye',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n blocks: ['death', 'prone', 'sleeping', ['brokenleftarm', 'brokenrightarm'], ['brokenleftarm', 'damagedrightarm'], ['brokenleftarm', 'mangledrightarm'],\n ['damagedleftarm', 'brokenrightarm'], ['damagedleftarm', 'damagedrightarm'], ['damagedleftarm', 'mangledrightarm'],\n ['mangledleftarm', 'brokenrightarm'], ['mangledleftarm', 'damagedrightarm'], ['mangledleftarm', 'mangledrightarm'],\n 'entangled' ,'transfixation', 'impaled', 'webbed', 'bound', 'icefist'],\n serverside: true\n },\n mounted: {\n command: ['drop mamba', 'vault mamba', 'vault geagle'],\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n blocks: ['death', 'sleeping', 'hamstrung', 'prone', 'brokenleftarm', 'brokenrightarm', 'damagedrightarm', 'damagedleftarm', 'mangledrightarm', 'mangledleftarm',\n 'paralysis', 'entangled' ,'transfixation', 'impaled', 'webbed', 'bound'],\n preempt: true,\n },\n nightsight: {\n command: 'nightsight',\n bals_req: ['free'],\n bals_used: ['free'],\n serverside: true\n },\n numbness: {\n command: 'numb',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n skills: ['Monk'],\n },\n 'parrying right leg': {\n command: 'parry right leg',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n opps: ['guarding left leg', 'guarding left arm', 'guarding right arm', 'guarding torso', 'guarding head', 'guarding right leg', 'parrying left leg', 'parrying left arm', 'parrying right arm', 'parrying torso', 'parrying head', 'parrying left', 'parrying right', 'parrying centre']\n },\n 'parrying left leg': {\n command: 'parry left leg',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n opps: ['guarding left leg', 'guarding left arm', 'guarding right arm', 'guarding torso', 'guarding head', 'parrying right leg', 'guarding right leg', 'parrying left arm', 'parrying right arm', 'parrying torso', 'parrying head', 'parrying left', 'parrying right', 'parrying centre']\n },\n 'parrying right arm': {\n command: 'parry right arm',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n opps: ['guarding left leg', 'guarding left arm', 'guarding right arm', 'guarding torso', 'guarding head', 'parrying right leg', 'parrying left leg', 'parrying left arm', 'guarding right leg', 'parrying torso', 'parrying head', 'parrying left', 'parrying right', 'parrying centre']\n },\n 'parrying left arm': {\n command: 'parry left arm',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n opps: ['guarding left leg', 'guarding left arm', 'guarding right arm', 'guarding torso', 'guarding head', 'parrying right leg', 'parrying left leg', 'guarding right leg', 'parrying right arm', 'parrying torso', 'parrying head', 'parrying left', 'parrying right', 'parrying centre']\n },\n 'parrying head': {\n command: 'parry head',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n opps: ['guarding left leg', 'guarding left arm', 'guarding right arm', 'guarding torso', 'guarding head', 'parrying right leg', 'parrying left leg', 'parrying left arm', 'parrying right arm', 'parrying torso', 'guarding right leg', 'parrying left', 'parrying right', 'parrying centre']\n },\n 'parrying torso': {\n command: 'parry torso',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n opps: ['guarding left leg', 'guarding left arm', 'guarding right arm', 'guarding torso', 'guarding head', 'parrying right leg', 'parrying left leg', 'parrying left arm', 'parrying right arm', 'guarding right leg', 'parrying head', 'parrying left', 'parrying right', 'parrying centre']\n },\n 'parrying left': {\n command: 'trueparry left',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n skills: ['Bard'],\n opps: ['guarding left leg', 'guarding left arm', 'guarding right arm', 'guarding torso', 'guarding head', 'parrying right leg', 'parrying left leg', 'parrying left arm', 'parrying right arm', 'parrying torso', 'parrying head', 'guarding right leg', 'parrying right', 'parrying centre']\n },\n 'parrying right': {\n command: 'trueparry right',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n skills: ['Bard'],\n opps: ['guarding left leg', 'guarding left arm', 'guarding right arm', 'guarding torso', 'guarding head', 'parrying right leg', 'parrying left leg', 'parrying left arm', 'parrying right arm', 'parrying torso', 'parrying head', 'parrying left', 'guarding right leg', 'parrying centre']\n },\n 'parrying centre': {\n command: 'trueparry centre',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n preempt: true,\n skills: ['Bard'],\n opps: ['guarding left leg', 'guarding left arm', 'guarding right arm', 'guarding torso', 'guarding head', 'parrying right leg', 'parrying left leg', 'parrying left arm', 'parrying right arm', 'parrying torso', 'parrying head', 'parrying left', 'parrying right', 'guarding right leg']\n },\n pinchblock: {\n command: 'pnb',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['balance'],\n blocks: ['death', 'sleeping'],\n skills: ['Monk'],\n serverside: true\n },\n projectiles: {\n command: 'projectiles on',\n bals_req: ['free'],\n bals_used: ['free'],\n skills: ['Monk', 'Blademaster'],\n blocks: ['death', 'sleeping', 'mounted'],\n preempt: true,\n serverside: true\n },\n poisonresist: {\n command: 'sip venom',\n bals_req: ['free'],\n bals_used: ['free'],\n blocks: ['death', 'anorexia', 'sleeping'],\n serverside: true\n },\n prismatic: {\n command: 'strum lyre',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n blocks: ['death', 'prone', 'sleeping'],\n },\n rebounding: {\n command: 'smoke malachite',\n bals_req: ['smoke', 'rebounding'],\n bals_used: ['smoke', 'rebounding'],\n blocks: ['death', 'asthma', 'sleeping'],\n serverside: true\n },\n reflections: {\n command: 'point wand235913 at me',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['free'],\n blocks: ['death', 'sleeping'],\n },\n regeneration: {\n command: 'regeneration on',\n bals_req: ['free'],\n bals_used: ['free'],\n skills: ['Monk'],\n blocks: ['death', 'sleeping'],\n serverside: true\n },\n resistance: {\n command: 'resistance',\n bals_req: ['free'],\n bals_used: ['free'],\n skills: ['Runewarden', 'Monk'],\n blocks: ['death', 'sleeping'],\n serverside: true\n },\n scales: {\n command: 'scales',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['balance'],\n skills: ['Serpent'],\n serverside: true\n },\n secondsight: {\n command: 'secondsight',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n skills: ['Serpent'],\n serverside: true\n },\n shield: {\n command: 'touch shield',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n blocks: ['death', 'prone', 'sleeping', ['brokenleftarm', 'brokenrightarm'], ['brokenleftarm', 'damagedrightarm'], ['brokenleftarm', 'mangledrightarm'],\n ['damagedleftarm', 'brokenrightarm'], ['damagedleftarm', 'damagedrightarm'], ['damagedleftarm', 'mangledrightarm'],\n ['mangledleftarm', 'brokenrightarm'], ['mangledleftarm', 'damagedrightarm'], ['mangledleftarm', 'mangledrightarm'],\n 'entangled' ,'transfixation', 'impaled', 'webbed', 'bound', 'icefist'],\n serverside: true\n },\n shintrance: {\n command: 'shin trance',\n bals_req: ['free'],\n bals_used: ['free'],\n skills: ['Blademaster'],\n blocks: ['death', 'sleeping'],\n serverside: true\n },\n shinclarity: {\n command: 'clarity',\n bals_req: ['balance'],\n bals_used: ['equilibrium'],\n skills: ['Blademaster'],\n blocks: ['death', 'sleeping'],\n serverside: true\n },\n shinbinding: {\n command: 'shinbinding on',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n skills: ['Blademaster'],\n blocks: ['death', 'sleeping'],\n serverside: true\n },\n shroud: {\n command: 'conjure cloak',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n skills: ['Serpent'],\n serverside: true\n },\n softfocusing: {\n command: 'softfocus on',\n bals_req: ['free'],\n bals_used: ['free'],\n blocks: ['death', 'sleeping'],\n serverside: true\n },\n songbird: {\n command: 'whistle for songbird',\n bals_req: ['equilibrium'],\n bals_used: ['equilibrium'],\n blocks: ['death', 'sleeping'],\n skills: ['Bard'],\n },\n speed: {\n command: 'sip speed',\n bals_req: ['speed'],\n bals_used: ['speed'],\n blocks: ['death', 'anorexia','sleeping'],\n serverside: true\n },\n skywatch: {\n command: 'skywatch on',\n bals_req: ['free'],\n bals_used: ['free'],\n serverside: true\n },\n stonefist: {\n command: 'cast stonefist',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n skills: ['Magi'],\n serverside: true\n },\n stoneskin: {\n command: 'cast stoneskin',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n skills: ['Magi'],\n serverside: true\n },\n sulphur: {\n command: 'educe sulphur',\n bals_req: ['balance'],\n bals_used: ['equilibrium'],\n blocks: ['death', 'sleeping'],\n skills: ['Alchemist'],\n serverside: true\n },\n tekurastance: {\n command: 'tekurastance',\n bals_req: ['free'],\n bals_used: ['balance'],\n skills: ['Monk'],\n },\n telesense: {\n command: 'telesense on',\n bals_req: ['free'],\n bals_used: ['free'],\n serverside: true\n },\n temperance: {\n command: 'sip frost',\n bals_req: ['free'],\n bals_used: ['free'],\n blocks: ['death', 'anorexia','sleeping'],\n serverside: true\n },\n thirdeye: {\n command: 'thirdeye',\n bals_req: ['free'],\n bals_used: ['free'],\n serverside: true\n },\n tin: {\n command: 'educe tin',\n bals_req: ['balance'],\n bals_used: ['equilibrium'],\n blocks: ['death', 'sleeping', 'prone'],\n skills: ['Alchemist'],\n serverside: true\n },\n tentacles: {\n command: 'tentacles',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n blocks: ['death', 'sleeping', 'prone'],\n skills: ['Occultist'],\n serverside: true\n },\n toughness: {\n command: 'toughness',\n bals_req: ['free'],\n bals_used: ['free'],\n skills: ['Monk', 'Blademaster'],\n serverside: true\n },\n treewatch: {\n command: 'treewatch on',\n bals_req: ['free'],\n bals_used: ['free'],\n serverside: true\n },\n tune: {\n command: 'sing tune',\n bals_req: ['voice'],\n bals_used: ['voice'],\n blocks: ['death', 'sleeping'],\n skills: ['Bard'],\n serverside: true\n },\n twoartsstance: {\n command: '',\n bals_req: ['free'],\n bals_used: ['free'],\n blocks: ['death', 'sleeping'],\n skills: ['Blademaster'],\n },\n vigilance: {\n command: 'vigilance on',\n bals_req: ['free'],\n bals_used: ['free'],\n serverside: true\n },\n vitality: {\n command: 'vitality on',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n skills: ['Monk'],\n serverside: true\n },\n weathering: {\n command: 'weathering on',\n bals_req: ['free'],\n bals_used: ['free'],\n skills: ['Runewarden', 'Monk', 'Blademaster'],\n blocks: ['death', 'sleeping'],\n serverside: true\n },\n weaving: {\n command: 'weaving on',\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['balance'],\n skills: ['Serpent'],\n serverside: true\n },\n};\n\ndefs.prios = {};\n\n// default keepup essentially\ndefs.prios.keepup = {\n // Normal defences\n alertness: 0,\n curseward: 0,\n deathsight: 0,\n density: 0,\n groundwatch: 0,\n heldbreath: 0,\n hypersight: 0,\n lifevision: 0,\n metawake: 0,\n mindseye: 0,\n reflections: 0,\n shield: \t0,\n softfocusing: 0,\n telesense: 0,\n treewatch: 0,\n vigilance: 0,\n insomnia: 0,\n speed: 0,\n insulation: 0,\n kola: 0,\n deafness: 0,\n blindness: 0,\n temperance: 0,\n cloak: 0,\n airpocket: 0,\n coldresist: 0,\n electricresist: 0,\n fangbarrier: 0,\n fireresist: 0,\n levitating: 0,\n magicresist: 0,\n nightsight: 0,\n poisonresist: 0,\n rebounding: 0,\n skywatch: 0,\n thirdeye: 0,\n\n // class defences\n\n // Alchemist\n astronomy: 0,\n mercury: 0,\n sulphur: 0,\n tin: 0,\n enhancedform: 0,\n ironform: 0,\n\n // Bard\n acrobatics: 0,\n aria: 0,\n arrowcatching: 0,\n balancing: 0,\n drunkensailor: 0,\n heartsfury: 0,\n lay: 0,\n songbird: 0,\n tune: 0,\n\n // Blademaster\n shintrance: 0,\n shinbinding: 0,\n shinclarity: 0,\n\n // Dragon\n dragonarmour: 0,\n dragonbreath: 0,\n\n // Magi\n chargeshield: 0,\n diamondskin: 0,\n stonefist: 0,\n stoneskin: 0,\n\n // Monk\n bodyblock: 0,\n constitution: 0,\n evadeblock: 0,\n immunity: 0,\n kaiboost: 0,\n numbness: 0,\n pinchblock: 0,\n vitality: 0,\n kaitrance: 0,\n regeneration: 0,\n boostedregeneration: 0,\n consciousness: 0,\n mindcloak: 0,\n mindnet: 0,\n projectiles: 0,\n resistance: 0,\n toughness: 0,\n weathering: 0,\n\n // Occultist\n arctar: 0,\n devilmark: 0,\n distortedaura: 0,\n tentacles: 0,\n\n // Runewarden\n fury: 0,\n blademastery: 0,\n\n // Serpent\n ghost: 0,\n hiding: 0,\n lipreading: 0,\n scales: 0,\n secondsight: 0,\n shroud: 0,\n weaving: 0,\n\n\n\n\n // non-serverside defences 50=ignore\n blocking: 0,\n locketdeath: 0,\n meditate: 0,\n mounted: 0,\n prismatic: 0,\n 'parrying left leg': 0,\n 'parrying right arm': 0,\n 'parrying left arm': 0,\n 'parrying head': 0,\n 'parrying torso': 0,\n 'parrying left': 0,\n 'parrying right': 0,\n 'parrying centre': 0,\n 'parrying right leg': 0,\n\n // Alchemist\n compoundmask: 0,\n\n // Blademaster\n twoartsstance: 0,\n\n // Monk\n tekurastance: 0,\n 'guarding left leg': 0,\n 'guarding right arm': 0,\n 'guarding left arm': 0,\n 'guarding head': 0,\n 'guarding torso': 0,\n 'guarding right leg': 0,\n};\n\n// what gets set when deffing up\ndefs.prios.static = {\n // Regular\n mindseye: 0,\n lifevision: 0,\n alertness: 0,\n curseward: 0,\n deathsight: 0,\n\n // Dragon\n dragonarmour: 0,\n\n // Alchemist\n astronomy: 0,\n ironform: 0,\n mercury: 0,\n sulphur: 0,\n tin: 0,\n\n // Blademaster\n shinbinding: 0,\n shinclarity: 0,\n\n // Magi\n chargeshield: 0,\n diamondskin: 0,\n stonefist: 0,\n stoneskin: 0,\n\n // Monk\n constitution: 0,\n bodyblock: 0,\n\n // Occultist\n devilmark: 0,\n distortedaura: 0,\n\n // Serpent\n ghost: 0,\n lipreading: 0,\n scales: 0,\n secondsight: 0,\n weaving: 0,\n shroud: 0\n\n};\n\nclient.defPrios = defs.prios;\nclient.defTable = defs.objs;"},{"type":"function","name":"defClass","enabled":true,"id":68,"code":"client.Def = class Def extends client.Trackable {\n constructor(name, prio = 0, obj) {\n super(name);\n this._prio = new Priority(this._name, prio);\n this._command = obj.command || '';\n this._bals_req = obj.bals_req || [];\n this._bals_used = obj.bals_used || [];\n this._blocks = obj.blocks || [];\n this._skills = obj.skills || [];\n this._preempt = obj.preempt || false;\n this._opps = obj.opps;\n this.registerEvents();\n }\n\n get isServerSide() { return false }\n\n get prio() { return this._prio.prio }\n\n get isIgnored() { return this._prio.prio == 0 }\n\n get balsUsed() { return this._bals_used }\n\n get balsReq() { return this._bals_req }\n\n get blocks() { return this._blocks }\n\n get command() { return this._command }\n\n get skills() { return this._skills }\n\n get preempt() { return this._preempt }\n\n registerEvents() {\n client.eventStream.registerEvent(this.name+'LostDefEvent', this.lost.bind(this));\n client.eventStream.registerEvent(this.name+'GotDefEvent', this.got.bind(this));\n if(this._opps != undefined) {\n for(let i=0; i < this._opps.length; i++) {\n client.eventStream.registerEvent(this._opps[i]+'GotDefEvent', this.lost.bind(this));\n }\n }\n }\n\n raiseEventGot() {\n client.eventStream.raiseEvent('DefGot', this);\n }\n\n raiseEventLost() {\n client.eventStream.raiseEvent('DefLost', this);\n }\n\n raiseEventSet() {\n client.eventStream.raiseEvent('DefPrioritySetEvent', this);\n }\n\n got() {\n // reset prio to default when got. Assumes we were deffing up\n if(!this.have) {\n this.reset_prio();\n super.got();\n }\n }\n\n lost() {\n if(this.have) {\n super.lost();\n }\n }\n\n set_prio(prio) {\n this._prio.setPrio(prio);\n this.raiseEventSet();\n }\n\n set_default_prio(prio) {\n this._prio.setDefault(prio);\n this.set_prio(prio);\n }\n\n toggle_default_prio(prio) {\n if(this._prio.prio === prio) {\n this.set_default_prio(0);\n }\n else {\n this.set_default_prio(prio);\n }\n }\n\n reset_prio () {\n this._prio.reset();\n this.raiseEventSet();\n }\n\n set_command(cmd) {\n this._command = cmd;\n }\n\n};\n\nclient.DefServerside = class DefServerside extends client.Def {\n constructor(name, prio, obj) {\n super(name, prio, obj);\n }\n\n get isServerSide() { return true }\n};"},{"type":"function","name":"defCreate","enabled":true,"id":69,"code":"client.Defs = {};\n\nlet defs = client.defTable;\nlet defPrios = client.defPrios;\nfor(let def in defs) {\n let cur_def = defs[def];\n let prio = (defPrios.keepup[def] === undefined)? 0 : defPrios.keepup[def];\n let obj = {};\n obj.command = cur_def.command;\n obj.bals_req = cur_def.bals_req;\n obj.bals_used = cur_def.bals_used;\n obj.blocks = cur_def.blocks;\n obj.skills = cur_def.skills;\n obj.preempt = cur_def.preempt;\n obj.opps = cur_def.opps;\n obj.serverside = cur_def.serverside;\n\n if(obj.serverside) {\n client.Defs[def] = new DefServerside(def, prio, obj);\n }\n else {\n client.Defs[def] = new Def(def, prio, obj);\n }\n}"},{"type":"function","name":"defEvents","enabled":true,"id":92,"code":"\nlet eventGmcpDefList = function(list) {\n let prev_list = client.getCurrentDefs();\n let new_list = {};\n\n for (i in list) {\n let def = list[i].name;\n def = def.replace('\\(', '');\n def = def.replace('\\)', '');\n // maintain new list, to compare to old list when done\n new_list[def] = true;\n\n client.eventStream.raiseEvent(def+'GotDefEvent');\n }\n\n // compare new list to old list and remove defs that are no longer there\n for (let i in prev_list) {\n if(new_list[prev_list[i]] === undefined) {\n client.eventStream.raiseEvent(prev_list[i]+'LostDefEvent');\n }\n }\n};\n\nclient.eventStream.registerEvent('Char.Defences.List', eventGmcpDefList);\n\n\nlet eventGmcpDefAdd = function(obj) {\n var def = obj.name;\n\n def = def.replace('\\(', '');\n def = def.replace('\\)', '');\n\n client.eventStream.raiseEvent(def+'GotDefEvent');\n};\n\nclient.eventStream.registerEvent('Char.Defences.Add', eventGmcpDefAdd);\n\nlet eventGmcpDefRemove = function(def) {\n def = def[0];\n\n def = def.replace('\\(', '');\n def = def.replace('\\)', '');\n\n client.eventStream.raiseEvent(def+'LostDefEvent');\n};\n\nclient.eventStream.registerEvent('Char.Defences.Remove', eventGmcpDefRemove);"},{"type":"function","name":"defService","enabled":true,"id":79,"code":"client.getCurrentDefs = function() {\n let defs = client.Defs;\n let current_defs = [];\n for(let def in defs) {\n if(defs[def].have) {\n current_defs.push(defs[def].name);\n }\n }\n\n return current_defs;\n};\n\nclient.getMissingDefs = function() {\n let defs = client.Defs;\n let missing_defs = [];\n let queue = new client.PriorityQueue();\n for(let def in defs) {\n let cur_def = defs[def];\n if(!cur_def.have && !cur_def.isIgnored && !cur_def.isServerSide) {\n //push on priority queue\n queue.push(defs[def].prio, defs[def]);\n //missing_defs.push(defs[def]);\n }\n }\n \n let i = 100;\n while(queue.nodes.length > 0 && i > 0) {\n missing_defs.push(queue.pop());\n i--;\n if(i == 1) {\n console.log('def service looped');\n console.log(queue.nodes);\n }\n }\n // pop from priority queue in order and fill array\n\n return missing_defs;\n};\n\nclient.haveDef = function(def) {\n let curDef = client.Defs[def];\n if(def == undefined || curDef == undefined) {\n client.sysLog('Called client.haveDef with a def that does not exist: ' + def);\n return false;\n }\n else {\n return curDef.have;\n }\n};\n\nclient.defPrioSwap = function(def, prio) {\n let curDef = client.Defs[def];\n if(def == undefined || curDef == undefined) {\n client.sysLog('Called client.defPrioSwap with an def that does not exist: ' + def);\n }\n else {\n curDef.set_prio(prio);\n }\n};\n\nclient.getDefOutputs = function(affList, balList) {\n let defOutputs = [];\n let missingDefs = client.getMissingDefs(); // return this as sorted by prio\n let remainingDefs = [];\n\n for(let i = 0; i < missingDefs.length; i++) {\n let def = missingDefs[i];\n let canPerform = true;\n if (def.blocks == undefined || def.blocks.length == 0 || !client.arraysIntersect(def.blocks, affList)) {\n //isn't blocked by an aff\n\n //if it's free to use, but requires certain bals, get those here\n if (def.balsUsed.length != 0 && def.balsUsed[0] == \"free\") {\n for (let j = 0; j < def.balsReq.length && canPerform; j++) {\n if (balList.indexOf(def.balsReq[j]) == -1) {\n canPerform = false;\n }\n }\n }\n else {\n // not sure if we can perform these yet\n remainingDefs.push(def);\n canPerform = false;\n }\n }\n else {\n canPerform = false;\n }\n // add to defOutputs if it's free and can use it\n if (canPerform) {\n defOutputs = defOutputs.concat(def.command);\n }\n }\n\n for(let i = 0; i < remainingDefs.length; i++) {\n let def = remainingDefs[i];\n let canPerform = true;\n\n // if required bals are satisfied or is 'free' add to defOutput\n if (def.balsReq.length != 0 && def.balsReq[0] != \"free\") {\n for (let j = 0; j < def.balsReq.length && canPerform; j++) {\n if (balList.indexOf(def.balsReq[j]) == -1) {\n canPerform = false;\n }\n }\n }\n if (canPerform) {\n defOutputs = defOutputs.concat(def.command);\n for (let j = 0; j < def.balsUsed.length; j++) {\n balList.splice(balList.indexOf(def.balsUsed[j]), 1);\n }\n }\n }\n\n return defOutputs;\n};\n\nclient.my_defs = {};\n\nclient.my_defs.defup = function() {\n let defs = client.Defs;\n let staticPrios = client.defPrios.static;\n for(let def in defs) {\n let cur_def = defs[def];\n if (!cur_def.have) {\n if (staticPrios[def]) {\n if (client.sys.isClass(cur_def.skills) || cur_def.skills == undefined || cur_def.skills.length == 0) {\n cur_def.set_prio(staticPrios[def]);\n }\n else {\n cur_def.set_default_prio(0);\n }\n }\n else if (!client.sys.isClass(cur_def.skills)) {\n cur_def.set_default_prio(0);\n }\n }\n }\n client.eventStream.raiseEvent('ForcePopulateEvent');\n};\n\nclient.my_defs.defoff = function() {\n let defs = client.Defs;\n for(let def in defs) {\n let cur_def = defs[def];\n cur_def.reset_prio();\n }\n};\n\nclient.my_defs.repop = function(args) {\n if(client.serversideSettings.loaded) {\n let defs = client.Defs;\n let keepupPrios = client.defPrios.keepup;\n for (let def in defs) {\n let cur_def = defs[def];\n if (client.sys.isClass(cur_def.skills) || cur_def.skills == undefined || cur_def.skills.length == 0) {\n if (keepupPrios[def]) {\n cur_def.set_default_prio(keepupPrios[def]);\n }\n else {\n cur_def.set_default_prio(0);\n }\n }\n else {\n cur_def.set_default_prio(0);\n }\n }\n for(let limb in client.limbs.long) {\n if(!client.Defs['parrying ' +limb].isIgnored) {\n client.my_defs.parry(limb);\n }\n if(client.Defs['guarding ' +limb]) {\n if(!client.Defs['guarding ' +limb].isIgnored) {\n client.my_defs.parry(limb);\n }\n }\n }\n client.eventStream.raiseEvent('ForcePopulateEvent');\n }\n};\n\nclient.eventStream.registerEvent('ClassChanged', client.my_defs.repop);\nclient.eventStream.registerEvent('ServersideSettingsCaptured', client.my_defs.repop);\n\n\nclient.my_defs.parry = function(arg) {\n for(let limb in client.limbs.long) {\n client.Defs['parrying ' +limb].set_default_prio(0);\n if(client.Defs['guarding ' +limb]) {\n client.Defs['guarding ' +limb].set_default_prio(0);\n }\n }\n\n let limb = client.limbs.short[arg] || arg;\n\n if(client.sys.isClass(client.Defs['guarding '+limb].skills)) {\n client.Defs['guarding ' +limb].set_default_prio(25);\n }\n else {\n client.Defs['parrying ' +limb].set_default_prio(25);\n if(client.sys.isClass(\"Dragon\")) {\n client.Defs[\"parrying \" + limb].set_command(\"clawparry \" + limb);\n }\n else {\n client.Defs[\"parrying \" + limb].set_command(\"parry \" + limb)\n }\n }\n};"},{"type":"alias","name":"","enabled":true,"id":80,"matching":"exact","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"my_defs.defup();"}],"text":"defup"},{"type":"alias","name":"","enabled":true,"id":81,"matching":"exact","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"my_defs.defoff();"}],"text":"defoff"},{"type":"alias","name":"","enabled":true,"id":82,"matching":"exact","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"Defs.heldbreath.toggle_default_prio(25);"}],"text":"br"},{"type":"alias","name":"","enabled":true,"id":83,"matching":"exact","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"Defs.rebounding.toggle_default_prio(25);"}],"text":"ss"},{"type":"alias","name":"","enabled":true,"id":84,"matching":"exact","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"Defs.cloak.toggle_default_prio(25);"}],"text":"cl"},{"type":"alias","name":"","enabled":true,"id":85,"matching":"regexp","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"client.my_defs.parry(args[1]);"}],"text":"^p(rl|ll|ra|la|h|tt|c|l|r)$"},{"type":"alias","name":"","enabled":true,"id":86,"matching":"exact","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"send_command('unblock');\nDefs.blocking.set_default_prio(0);"}],"text":"ub"},{"type":"alias","name":"","enabled":true,"id":87,"matching":"regexp","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"Defs.blocking.set_command('block ' +args[1]);\nDefs.blocking.set_default_prio(25);"}],"text":"^block\\s+(\\w+)$"}]},{"type":"group","name":"cures","enabled":true,"id":78,"items":[{"type":"function","name":"cureTable","enabled":true,"id":38,"code":"let cures = {};\n\ncures.objs = {\n\n // Minerals\n ferrum: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat ferrum',\n order: ['darkshade', 'haemophilia', 'lethargy', 'addiction', 'scytherus', 'nausea'],\n prio: 0\n },\n magnesium: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat magnesium',\n order: ['paralysis', 'slickness'],\n prio: 0\n },\n aurum: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat aurum',\n order: ['clumsiness', 'healthleech', 'sensitivity', 'weariness', 'asthma', 'hypochondria'],\n prio: 0\n },\n calamine: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat calamine',\n order: ['deafness'],\n delay: 2.5,\n prio: 0\n },\n argentum: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat argentum',\n order: ['masochism', 'loneliness', 'vertigo', 'recklessness', 'agoraphobia', 'airdisrupt', 'firedisrupt', 'waterdisrupt', 'earthdisrupt', 'spiritdisrupt'],\n prio: 0\n },\n cuprum: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat cuprum',\n order: ['pacified', 'peace', 'lovers', 'generosity'],\n prio: 0\n },\n antimony: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat antimony',\n order: ['temperedcholeric', 'temperedmelancholic', 'temperedphlegmatic', 'temperedsanguine'],\n prio: 0\n },\n arsenic: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat arsenic',\n prio: 0\n },\n stannum: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat stannum',\n order: ['claustrophobia', 'paranoia', 'confusion', 'hypersomnia', 'hallucinations', 'dementia'],\n prio: 0\n },\n plumbum: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n order: ['stupidity', 'epilepsy', 'dizziness', 'shyness', 'impatience', 'dissonance'],\n command: 'eat plumbum',\n prio: 0\n },\n\n // Herbs\n ginseng: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat ginseng',\n order: ['darkshade', 'haemophilia', 'lethargy', 'addiction', 'scytherus', 'nausea'],\n prio: 0\n },\n bloodroot: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat bloodroot',\n order: ['paralysis', 'slickness'],\n prio: 0\n },\n kelp: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat kelp',\n order: ['clumsiness', 'healthleech', 'sensitivity', 'weariness', 'asthma', 'hypochondria'],\n prio: 0\n },\n hawthorn: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat hawthorn',\n order: ['deafness'],\n delay: 2.5,\n prio: 0\n },\n lobelia: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat lobelia',\n order: ['masochism', 'loneliness', 'vertigo', 'recklessness', 'agoraphobia', 'airdisrupt', 'firedisrupt', 'waterdisrupt', 'earthdisrupt', 'spiritdisrupt'],\n prio: 0\n },\n bellwort: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat bellwort',\n order: ['pacified', 'peace', 'lovers', 'generosity'],\n prio: 0\n },\n ginger: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat ginger',\n order: ['temperedcholeric', 'temperedmelancholic', 'temperedphlegmatic', 'temperedsanguine'],\n prio: 0\n },\n bayberry: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat bayberry',\n prio: 0\n },\n ash: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat ash',\n order: ['claustrophobia', 'paranoia', 'confusion', 'hypersomnia', 'hallucinations', 'dementia'],\n prio: 0\n },\n goldenseal: {\n bals_used: ['herb'],\n bals_req: ['herb'],\n blocks: ['death', 'anorexia', 'sleeping'],\n command: 'eat goldenseal',\n order: ['stupidity', 'epilepsy', 'dizziness', 'shyness', 'impatience', 'dissonance'],\n prio: 0\n },\n // Smokes\n smoke: {\n bals_used: ['smoke'],\n bals_req: ['smoke'],\n blocks: ['death', 'asthma', 'sleeping'],\n command: 'smoke cinnabar',\n order: ['aeon', 'whisperingmadness', 'disloyalty', 'hellsight', 'manaleech', 'slickness', 'deadening' ],\n prio: 0\n },\n cinnabar: {\n bals_used: ['smoke'],\n bals_req: ['smoke'],\n blocks: ['death', 'asthma', 'sleeping'],\n command: 'smoke cinnabar',\n order: ['aeon', 'deadening', 'whisperingmadness'],\n prio: 0\n },\n malachite: {\n bals_used: ['smoke'],\n bals_req: ['smoke'],\n blocks: ['death', 'asthma', 'sleeping'],\n command: 'smoke malachite',\n prio: 0\n },\n realgar: {\n bals_used: ['smoke'],\n bals_req: ['smoke'],\n blocks: ['death', 'asthma', 'sleeping'],\n command: 'smoke realgar',\n order: ['disloyalty', 'hellsight', 'manaleech', 'slickness'],\n prio: 0\n },\n elm: {\n bals_used: ['smoke'],\n bals_req: ['smoke'],\n blocks: ['death', 'asthma', 'sleeping'],\n command: 'smoke elm',\n order: ['aeon', 'deadening', 'whisperingmadness'],\n prio: 0\n },\n skullcap: {\n bals_used: ['smoke'],\n bals_req: ['smoke'],\n blocks: ['death', 'asthma', 'sleeping'],\n command: 'smoke skullcap',\n prio: 0\n },\n valerian: {\n bals_used: ['smoke'],\n bals_req: ['smoke'],\n blocks: ['death', 'asthma', 'sleeping'],\n command: 'smoke valerian',\n order: ['disloyalty', 'hellsight', 'manaleech', 'slickness'],\n prio: 0\n },\n\n // Salves\n caloric: {\n bals_used: ['salve'],\n bals_req: ['salve'],\n blocks: ['death', 'slickness', 'sleeping'],\n command: 'apply caloric',\n order: ['frozen', 'shivering', 'insulation'],\n prio: 0\n },\n 'epidermal to body': {\n bals_used: ['salve'],\n bals_req: ['salve'],\n blocks: ['death', 'slickness', 'sleeping'],\n command: 'apply epidermal to body',\n order: ['anorexia'],\n prio: 0\n },\n 'epidermal to head': {\n bals_used: ['salve'],\n bals_req: ['salve'],\n blocks: ['death', 'slickness', 'sleeping'],\n command: 'apply epidermal to head',\n order: ['blindness', 'scalded', 'deafness'],\n prio: 0\n },\n 'epidermal to ears': {\n bals_used: ['salve'],\n bals_req: ['salve'],\n blocks: ['death', 'slickness', 'sleeping'],\n command: 'apply epidermal to ears',\n order: ['deafness'],\n prio: 0\n },\n 'mending to head': {\n bals_used: ['salve'],\n bals_req: ['salve'],\n blocks: ['death', 'slickness', 'sleeping'],\n command: 'apply mending to head',\n prio: 0\n },\n 'mending to arms': {\n bals_used: ['salve'],\n bals_req: ['salve'],\n blocks: ['death', 'slickness', 'sleeping'],\n command: 'apply mending to arms',\n order: ['brokenleftarm', 'brokenrightarm'],\n prio: 0\n },\n 'mending to legs': {\n bals_used: ['salve'],\n bals_req: ['salve'],\n blocks: ['death', 'slickness', 'sleeping'],\n command: 'apply mending to legs',\n order: ['brokenleftleg', 'brokenrightleg'],\n prio: 0\n },\n 'mending to torso': {\n bals_used: ['salve'],\n bals_req: ['salve'],\n blocks: ['death', 'slickness', 'sleeping'],\n command: 'apply mending to torso',\n order: ['burning'],\n prio: 0\n },\n 'restoration to head': {\n bals_used: ['salve'],\n bals_req: ['salve'],\n blocks: ['death', 'slickness', 'sleeping'],\n command: 'apply restoration to head',\n order: ['mangledhead', 'damagedhead'],\n delay: 4.0,\n prio: 0\n },\n 'restoration to torso': {\n bals_used: ['salve'],\n bals_req: ['salve'],\n blocks: ['death', 'slickness', 'sleeping'],\n command: 'apply restoration to torso',\n order: ['hypothermia', 'heartseed', 'serioustrauma', 'mildtrauma'],\n delay: 4.0,\n prio: 0\n },\n 'restoration to arms': {\n bals_used: ['salve'],\n bals_req: ['salve'],\n blocks: ['death', 'slickness', 'sleeping'],\n command: 'apply restoration to arms',\n order: ['mangledleftarm', 'mangledrightarm', 'damagedleftarm', 'damagedrightarm'],\n delay: 4.0,\n prio: 0\n },\n 'restoration to legs': {\n bals_used: ['salve'],\n bals_req: ['salve'],\n blocks: ['death', 'slickness', 'sleeping'],\n command: 'apply restoration to legs',\n order: ['mangledleftleg', 'mangledrightleg', 'damagedleftleg', 'damagedrightleg'],\n delay: 4.0,\n prio: 0\n },\n\n // Misc\n insomnia: {\n bals_req: ['free'],\n bals_used: ['free'],\n blocks: ['death', 'hypersomnia', 'sleeping'],\n command: 'insomnia',\n order: ['insomnia'],\n prio: 0\n },\n focus: {\n bals_req: ['focus'],\n bals_used: ['focus'],\n blocks: ['death', 'impatience', 'sleeping'],\n command: 'focus',\n order: ['stupidity', 'epilepsy', 'agoraphobia', 'masochism',\n 'claustrophobia', 'recklessness', 'dizziness',\n 'confusion', 'loneliness', 'vertigo', 'shyness',\n 'lovers', 'anorexia', 'airdisrupt', 'firedisrupt', 'waterdisrupt',\n 'generosity', 'pacified', 'stuttering'],\n prio: 0\n },\n 'health to head': {\n bals_req: ['sip'],\n bals_used: ['sip'],\n command: 'apply health to head',\n order: ['skullfractures'],\n prio: 0\n },\n 'health to torso': {\n bals_req: ['sip'],\n bals_used: ['sip'],\n command: 'apply health to torso',\n order: ['crackedribs'],\n prio: 0\n },\n 'health to arms': {\n bals_req: ['sip'],\n bals_used: ['sip'],\n command: 'apply health to arms',\n order: ['wristfractures'],\n prio: 0\n },\n 'health to legs': {\n bals_req: ['sip'],\n bals_used: ['sip'],\n command: 'apply health to legs',\n order: ['torntendons'],\n prio: 0\n },\n concentrate: {\n blocks: ['death', 'sleeping', 'confusion'],\n command: 'concentrate',\n order: ['disrupted'],\n prio: 0\n },\n immunity: {\n bals_req: ['immunity'],\n bals_used: ['immunity'],\n blocks: ['death', 'sleeping', 'anorexia'],\n command: 'sip immunity',\n order: ['voyria'],\n prio: 0,\n },\n stand: {\n bals_req: ['balance', 'equilibrium'],\n blocks: ['death', 'sleeping', 'paralysis', 'brokenrightleg', 'brokenleftleg', 'damagedleftleg', 'damagedrightleg',\n 'mangledrightleg', 'mangledleftleg', 'entangled' ,'transfixation', 'impaled', 'webbed', 'bound'],\n command: 'stand',\n order: ['prone'],\n prio: 0,\n },\n tree: {\n bals_used: ['tree'],\n bals_req: ['tree'],\n blocks: ['death', 'sleeping', 'paralysis', ['brokenleftarm', 'brokenrightarm'], ['brokenleftarm', 'damagedrightarm'], ['brokenleftarm', 'mangledrightarm'],\n ['damagedleftarm', 'brokenrightarm'], ['damagedleftarm', 'damagedrightarm'], ['damagedleftarm', 'mangledrightarm'],\n ['mangledleftarm', 'brokenrightarm'], ['mangledleftarm', 'damagedrightarm'], ['mangledleftarm', 'mangledrightarm'],\n 'entangled' ,'transfixation', 'impaled', 'webbed', 'bound'],\n command: 'touch tree',\n order: ['clumsiness', 'healthleech', 'sensitivity', 'darkshade', 'haemophilia', 'lethargy', 'addiction', 'scytherus', 'nausea',\n 'peace', 'stupidity', 'epilepsy', 'agoraphobia', 'masochism', 'claustrophobia', 'recklessness', 'dizziness', 'shyness',\n 'paranoia', 'confusion', 'loneliness', 'vertigo', 'hypersomnia', 'hallucinations', 'justice', 'lovers', 'dementia', 'weariness',\n 'anorexia', 'impatience', 'asthma', 'voyria', 'selarnia', 'frozen', 'shivering', 'brokenleftleg', 'brokenrightleg',\n 'brokenleftarm', 'brokenrightarm', 'aeon', 'airdisrupt', 'firedisrupt', 'waterdisrupt', 'generosity', 'pacified', 'stuttering',\n 'blackout', 'burning', 'skullfractures', 'torntendons', 'crackedribs', 'wristfractures', 'deadening', 'dazed', 'disloyalty', 'dissonance',\n 'earthdisrupt', 'hellsight', 'hypochondria', 'itching', 'manaleech', 'slashedthroat', 'slickness', 'spiritdisrupt', 'stuttering',\n 'temperedcholeric', 'temperedmelancholic', 'temperedphlegmatic', 'temperedsanguine'\n ],\n prio: 0,\n },\n health: {\n bals_req: ['sip'],\n bals_used: ['sip'],\n blocks: ['death', 'sleeping', 'anorexia'],\n command: 'sip health',\n prio: 0,\n },\n mana: {\n bals_req: ['sip'],\n bals_used: ['sip'],\n blocks: ['death', 'sleeping', 'anorexia'],\n command: 'sip mana',\n prio: 0,\n },\n potash: {\n bals_req: ['moss'],\n bals_used: ['moss'],\n blocks: ['death', 'sleeping', 'anorexia'],\n command: 'eat potash',\n prio: 0,\n },\n moss: {\n bals_req: ['moss'],\n bals_used: ['moss'],\n blocks: ['death', 'sleeping', 'anorexia'],\n command: 'eat moss',\n prio: 0,\n },\n fitness: {\n bals_req: ['equilibrium', 'balance', 'fitness'],\n bals_used: ['balance','fitness'],\n blocks: ['death', 'weariness', 'sleeping'],\n skills: ['Monk', 'Runewarden'],\n command: 'fitness',\n order: ['asthma'],\n prio: 0\n },\n bloodboil: {\n bals_req: ['equilibrium', 'balance', 'bloodboil'],\n bals_used: ['equilibrium','bloodboil'],\n blocks: ['death', 'haemophilia', 'sleeping', ['brokenleftarm', 'brokenrightarm'], ['brokenleftarm', 'damagedrightarm'], ['brokenleftarm', 'mangledrightarm'],\n ['damagedleftarm', 'brokenrightarm'], ['damagedleftarm', 'damagedrightarm'], ['damagedleftarm', 'mangledrightarm'],\n ['mangledleftarm', 'brokenrightarm'], ['mangledleftarm', 'damagedrightarm'], ['mangledleftarm', 'mangledrightarm'],\n 'entangled' ,'transfixation', 'impaled', 'webbed', 'bound'],\n skills: ['Magi'],\n command: 'cast bloodboil',\n order: ['clumsiness', 'healthleech', 'sensitivity', 'darkshade', 'paralysis', 'lethargy', 'addiction', 'scytherus', 'nausea',\n 'peace', 'stupidity', 'epilepsy', 'agoraphobia', 'masochism', 'claustrophobia', 'recklessness', 'dizziness', 'shyness',\n 'paranoia', 'confusion', 'loneliness', 'vertigo', 'hypersomnia', 'hallucinations', 'justice', 'lovers', 'dementia', 'weariness',\n 'anorexia', 'impatience', 'asthma', 'voyria', 'selarnia', 'frozen', 'shivering', 'brokenleftleg', 'brokenrightleg',\n 'brokenleftarm', 'brokenrightarm', 'aeon', 'airdisrupt', 'firedisrupt', 'waterdisrupt', 'generosity', 'pacified', 'stuttering',\n 'blackout', 'burning', 'skullfractures', 'torntendons', 'crackedribs', 'wristfractures', 'deadening', 'dazed', 'disloyalty', 'dissonance',\n 'earthdisrupt', 'hellsight', 'hypochondria', 'itching', 'manaleech', 'slashedthroat', 'slickness', 'spiritdisrupt', 'stuttering',\n 'temperedcholeric', 'temperedmelancholic', 'temperedphlegmatic', 'temperedsanguine'\n ],\n prio: 0\n },\n restore: {\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n command: 'restore',\n order: ['brokenleftarm', 'brokenrightarm', 'brokenleftleg', 'brokenrightleg', 'skullfractures', 'torntendons', 'wristfractures', 'crackedribs'],\n prio: 0\n },\n dragonflex: {\n bals_req: ['balance'],\n bals_used: ['balance'],\n command: 'dragonflex',\n skills: ['Dragon'],\n order: ['webbed', 'entangled'],\n prio: 0\n },\n dragonheal: {\n bals_req: ['balance', 'equilibrium'],\n bals_used: ['equilibrium'],\n command: 'dragonheal',\n skills: ['Dragon'],\n blocks: ['death', 'sleeping', ['recklessness', 'weariness']],\n order: ['clumsiness', 'healthleech', 'sensitivity', 'darkshade', 'paralysis', 'haemophilia', 'lethargy', 'addiction', 'scytherus', 'nausea',\n 'peace', 'stupidity', 'epilepsy', 'agoraphobia', 'masochism', 'claustrophobia', 'recklessness', 'dizziness', 'shyness',\n 'paranoia', 'confusion', 'loneliness', 'vertigo', 'hypersomnia', 'hallucinations', 'justice', 'lovers', 'dementia', 'weariness',\n 'anorexia', 'impatience', 'asthma', 'voyria', 'selarnia', 'frozen', 'shivering', 'brokenleftleg', 'brokenrightleg',\n 'brokenleftarm', 'brokenrightarm', 'aeon', 'airdisrupt', 'firedisrupt', 'waterdisrupt', 'generosity', 'pacified', 'stuttering',\n 'blackout', 'burning', 'skullfractures', 'torntendons', 'crackedribs', 'wristfractures', 'deadening', 'dazed', 'disloyalty', 'dissonance',\n 'earthdisrupt', 'hellsight', 'hypochondria', 'itching', 'manaleech', 'slashedthroat', 'slickness', 'spiritdisrupt', 'stuttering',\n 'temperedcholeric', 'temperedmelancholic', 'temperedphlegmatic', 'temperedsanguine'\n ],\n prio: 0\n },\n dwinnu: {\n bals_req: ['voice'],\n bals_used: ['voice'],\n command: 'chant dwinnu',\n skills: ['Bard'],\n order: ['webbed', 'entangled'],\n prio: 0\n },\n rage: {\n bals_req: ['rage'],\n bals_used: ['rage'],\n command: 'rage',\n skills: ['Runewarden'],\n order: ['pacified', 'peace', 'lovers', 'generosity'],\n prio: 95\n },\n 'touch soul': {\n command: 'touch soul',\n blocks: ['death'],\n order: ['amnesia'],\n prio: 101,\n },\n salt: {\n bals_req: ['equilibrium','salt'],\n bals_used: ['salt', 'equilibrium'],\n blocks: ['death', 'stupidity', 'sleeping'],\n skills: ['Alchemist'],\n command: 'educe salt',\n order: ['clumsiness', 'healthleech', 'sensitivity', 'darkshade', 'haemophilia', 'lethargy', 'addiction', 'scytherus', 'nausea',\n 'peace', 'paralysis', 'epilepsy', 'agoraphobia', 'masochism', 'claustrophobia', 'recklessness', 'dizziness', 'shyness',\n 'paranoia', 'confusion', 'loneliness', 'vertigo', 'hypersomnia', 'hallucinations', 'justice', 'lovers', 'dementia', 'weariness',\n 'anorexia', 'impatience', 'asthma', 'voyria', 'selarnia', 'frozen', 'shivering', 'brokenleftleg', 'brokenrightleg',\n 'brokenleftarm', 'brokenrightarm', 'aeon', 'airdisrupt', 'firedisrupt', 'waterdisrupt', 'generosity', 'pacified', 'stuttering',\n 'blackout', 'burning', 'skullfractures', 'torntendons', 'crackedribs', 'wristfractures', 'deadening', 'dazed', 'disloyalty', 'dissonance',\n 'earthdisrupt', 'hellsight', 'hypochondria', 'itching', 'manaleech', 'slashedthroat', 'slickness', 'spiritdisrupt', 'stuttering',\n 'temperedcholeric', 'temperedmelancholic', 'temperedphlegmatic', 'temperedsanguine'\n ],\n prio: 0\n },\n shrugging: {\n bals_req: ['equilibrium', 'balance', 'shrugging'],\n bals_used: ['shrugging'],\n blocks: ['death', 'weariness', 'sleeping'],\n skills: ['Serpent'],\n command: 'shrugging',\n order: ['clumsiness', 'healthleech', 'sensitivity', 'darkshade', 'haemophilia', 'lethargy', 'addiction', 'scytherus', 'nausea',\n 'peace', 'stupidity', 'epilepsy', 'agoraphobia', 'masochism', 'claustrophobia', 'recklessness', 'dizziness', 'shyness',\n 'paranoia', 'confusion', 'loneliness', 'vertigo', 'hypersomnia', 'hallucinations', 'justice', 'lovers', 'dementia', 'paralysis',\n 'anorexia', 'impatience', 'asthma', 'voyria', 'selarnia', 'frozen', 'shivering', 'brokenleftleg', 'brokenrightleg',\n 'brokenleftarm', 'brokenrightarm', 'aeon', 'airdisrupt', 'firedisrupt', 'waterdisrupt', 'generosity', 'pacified', 'stuttering',\n 'blackout', 'burning', 'skullfractures', 'torntendons', 'crackedribs', 'wristfractures', 'deadening', 'dazed', 'disloyalty', 'dissonance',\n 'earthdisrupt', 'hellsight', 'hypochondria', 'itching', 'manaleech', 'slashedthroat', 'slickness', 'spiritdisrupt', 'stuttering',\n 'temperedcholeric', 'temperedmelancholic', 'temperedphlegmatic', 'temperedsanguine'\n ],\n prio: 0\n },\n fool: {\n bals_req: ['equilibrium', 'balance', 'fool'],\n bals_used: ['fool', 'balance'],\n blocks: ['death', 'prone', 'paralysis', 'sleeping', ['brokenleftarm', 'brokenrightarm'], ['brokenleftarm', 'damagedrightarm'], ['brokenleftarm', 'mangledrightarm'],\n ['damagedleftarm', 'brokenrightarm'], ['damagedleftarm', 'damagedrightarm'], ['damagedleftarm', 'mangledrightarm'],\n ['mangledleftarm', 'brokenrightarm'], ['mangledleftarm', 'damagedrightarm'], ['mangledleftarm', 'mangledrightarm'],\n 'entangled' ,'transfixation', 'impaled', 'webbed', 'bound'],\n skills: ['Occultist'],\n command: 'fling fool at me',\n order: ['clumsiness', 'healthleech', 'sensitivity', 'darkshade', 'haemophilia', 'lethargy', 'addiction', 'scytherus', 'nausea',\n 'peace', 'stupidity', 'epilepsy', 'agoraphobia', 'masochism', 'claustrophobia', 'recklessness', 'dizziness', 'shyness',\n 'paranoia', 'confusion', 'loneliness', 'vertigo', 'hypersomnia', 'hallucinations', 'justice', 'lovers', 'dementia', 'weariness',\n 'anorexia', 'impatience', 'asthma', 'voyria', 'selarnia', 'frozen', 'shivering', 'brokenleftleg', 'brokenrightleg',\n 'brokenleftarm', 'brokenrightarm', 'aeon', 'airdisrupt', 'firedisrupt', 'waterdisrupt', 'generosity', 'pacified', 'stuttering',\n 'blackout', 'burning', 'skullfractures', 'torntendons', 'crackedribs', 'wristfractures', 'deadening', 'dazed', 'disloyalty', 'dissonance',\n 'earthdisrupt', 'hellsight', 'hypochondria', 'itching', 'manaleech', 'slashedthroat', 'slickness', 'spiritdisrupt', 'stuttering',\n 'temperedcholeric', 'temperedmelancholic', 'temperedphlegmatic', 'temperedsanguine'\n ],\n prio: 0\n },\n alleviate: {\n bals_req: ['equilibrium', 'balance', 'alleviate'],\n bals_used: ['alleviate', 'balance'],\n blocks: ['death', 'paralysis', 'sleeping'],\n skills: ['Blademaster'],\n command: 'alleviate',\n order: ['clumsiness', 'healthleech', 'sensitivity', 'darkshade', 'haemophilia', 'lethargy', 'addiction', 'scytherus', 'nausea',\n 'peace', 'stupidity', 'epilepsy', 'agoraphobia', 'masochism', 'claustrophobia', 'recklessness', 'dizziness', 'shyness',\n 'paranoia', 'confusion', 'loneliness', 'vertigo', 'hypersomnia', 'hallucinations', 'justice', 'lovers', 'dementia', 'weariness',\n 'anorexia', 'impatience', 'asthma', 'voyria', 'selarnia', 'frozen', 'shivering', 'brokenleftleg', 'brokenrightleg',\n 'brokenleftarm', 'brokenrightarm', 'aeon', 'airdisrupt', 'firedisrupt', 'waterdisrupt', 'generosity', 'pacified', 'stuttering',\n 'blackout', 'burning', 'skullfractures', 'torntendons', 'crackedribs', 'wristfractures', 'deadening', 'dazed', 'disloyalty', 'dissonance',\n 'earthdisrupt', 'hellsight', 'hypochondria', 'itching', 'manaleech', 'slashedthroat', 'slickness', 'spiritdisrupt', 'stuttering',\n 'temperedcholeric', 'temperedmelancholic', 'temperedphlegmatic', 'temperedsanguine'\n ],\n prio: 0\n }\n};\n\nclient.cureTable = cures.objs;"},{"type":"function","name":"cureClass","enabled":true,"id":72,"code":"client.Cure = class Cure {\n constructor(name, prio = 0, obj) {\n this._name = name;\n this._bals_req = obj.bals_req || [];\n this._bals_used = obj.bals_used || [];\n this._blocks = obj.blocks || [];\n this._command = obj.command || '';\n this._time_used = 0;\n this._order = obj.order || [];\n\n this._prio = new client.Priority(this._name, prio);\n this.registerEvents();\n }\n\n registerEvents() {\n client.eventStream.registerEvent(this.name+'UsedCureEvent', this.used.bind(this));\n }\n\n raiseEventCureUsed() {\n client.eventStream.raiseEvent('CureUsed', this);\n }\n\n raiseEventSet() {\n client.eventStream.raiseEvent('CurePrioritySetEvent', this);\n }\n \n get name() { return this._name }\n\n get balsUsed() { return this._bals_used }\n\n get balsReq() { return this._bals_req }\n\n get blocks() { return this._blocks }\n\n get command() { return this._command }\n\n get order() { return this._order }\n\n get lastUsed() { return this._time_used }\n\n get isIgnored() { return this._prio.prio == 0 }\n\n used() {\n this._time_used = performance.now();\n this.raiseEventCureUsed();\n }\n\n set_prio(prio) {\n this._prio.setPrio(prio);\n this.raiseEventSet();\n }\n\n set_default_prio(prio) {\n this._prio.setDefault(prio);\n this.set_prio(prio);\n }\n\n toggle_default_prio(prio) {\n if(this._prio.prio === prio) {\n this.set_default_prio(0);\n }\n else {\n this.set_default_prio(prio);\n }\n }\n\n reset_prio () {\n this._prio.reset();\n this.raiseEventSet();\n }\n};"},{"type":"function","name":"cureCreate","enabled":true,"id":73,"code":"client.Cures = {};\n\nlet cures = client.cureTable;\nfor(let cure in cures) {\n let prio = cures[cure].prio;\n\n let obj = {};\n obj.bals_used = cures[cure].bals_used;\n obj.bals_req = cures[cure].bals_req;\n obj.blocks = cures[cure].blocks;\n obj.command = cures[cure].command;\n obj.order = cures[cure].order;\n\n client.Cures[cure] = new client.Cure(cure, prio, obj);\n}\n\nclient.eventStream.raiseEvent('CuresCreatedEvent', client.Cures);"},{"type":"function","name":"cureService","enabled":true,"id":275,"code":"client.getCureOutputs = function(affList, balList) {\n let cureOutputs = [];\n let affCurable = true;\n\n while(affCurable) {\n affCurable = false;\n for (let i = 0; i < affList.length && !affCurable; i++) {\n let aff = client.Affs[affList[i]];\n let cures = aff.cures;\n for (let j = 0; j < cures.length; j++) {\n let canPerform = true;\n let cure = client.Cures[cures[j]];\n if (!cure.isIgnored && !client.arraysIntersect(cure.blocks, affList)) {\n //isn't blocked by an aff\n\n for (let k = 0; k < cure.balsReq.length && canPerform; k++) {\n if (balList.indexOf(cure.balsReq[k]) == -1) {\n canPerform = false;\n }\n }\n \n\n //can Perform it, now make sure it can only cure this aff\n if (canPerform) {\n for (let k = 0; k < cure.order.length && canPerform; k++) {\n if (cure.order[k] != aff.name && affList.indexOf(cure.order[k]) >= 0) {\n canPerform = false;\n }\n }\n \n if (canPerform) {\n // We found a for sure cure, so restart loop with updated affList and balList\n cureOutputs = cureOutputs.concat(cure.command);\n affCurable = true;\n affList.splice(affList.indexOf(aff.name), 1);\n if (cure.balsUsed.length != 0 && cure.balsUsed[0] != \"free\") {\n for (let k = 0; k < cure.balsUsed.length; k++) {\n balList.splice(balList.indexOf(cure.balsUsed[k]), 1);\n }\n }\n }\n }\n }\n }\n }\n }// end while loop, no more for-sure cures were found\n \n // Now loop and finds cures that are possible but not guaranteed\n affCurable = true;\n while(affCurable) {\n affCurable = false;\n for (let i = 0; i < affList.length && !affCurable; i++) {\n let aff = client.Affs[affList[i]];\n let cures = aff.cures;\n for (let j = 0; j < cures.length; j++) {\n let canPerform = true;\n let cure = client.Cures[cures[j]];\n if (!cure.isIgnored && !client.arraysIntersect(cure.blocks, affList)) {\n //isn't blocked by an aff\n\n for (let k = 0; k < cure.balsReq.length && canPerform; k++) {\n if (balList.indexOf(cure.balsReq[k]) == -1) {\n canPerform = false;\n }\n }\n\n //can Perform it, no need to make sure it might cure something else\n if (canPerform) {\n // We found a possible cure, so restart loop with updated affList and balList\n cureOutputs = cureOutputs.concat(cure.command);\n affCurable = true;\n affList.splice(affList.indexOf(aff.name), 1);\n if (cure.balsUsed[0] != \"free\") {\n for (let k = 0; k < cure.balsUsed.length; k++) {\n balList.splice(balList.indexOf(cure.balsUsed[k]), 1);\n }\n }\n }\n }\n }\n }\n }// end while loop, no more possible cures were found\n \n return cureOutputs;\n};"}]},{"type":"group","name":"cache","enabled":true,"id":325,"items":[{"type":"alias","name":"","enabled":true,"id":365,"matching":"exact","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"command","command":"inr all","prefix_suffix":true}],"text":"inra"},{"type":"function","name":"cacheTable","enabled":true,"id":327,"code":"client.mineral_names = [\n \"a magnesium chip\",\n \"an aurum flake\",\n \"a plumbum flake\",\n \"a stannum flake\",\n \"an arsenic pellet\",\n \"a ferrum flake\",\n \"an antimony flake\",\n \"a cuprum flake\",\n \"an argentum flake\",\n \"a calamine crystal\",\n \"a pinch of ground cinnabar\",\n \"a pinch of realgar crystals\",\n \"a quartz grain\",\n \"a pinch of ground malachite\",\n \"a quicksilver droplet\",\n \"a potash crystal\",\n \"a gypsum crystal\"\n];\n\nclient.mineral_names_group = [\n \"magnesium chips\",\n \"aurum flakes\",\n \"plumbum flakes\",\n \"stannum flakes\",\n \"arsenic pellets\",\n \"ferrum flakes\",\n \"antimony flakes\",\n \"cuprum flakes\",\n \"argentum flakes\",\n \"calamine crystals\",\n \"pinches of ground cinnabar\",\n \"pinches of ground realgar\",\n \"quartz grains\",\n \"pinches of ground malachite\",\n \"quicksilver droplets\",\n \"potash crystals\",\n \"gypsum crystals\"\n];\n\nclient.herb_names = [\n \"a bloodroot leaf\",\n \"a piece of kelp\",\n \"a goldenseal root\",\n \"some prickly ash bark\",\n \"some bayberry bark\",\n \"a ginseng root\",\n \"a ginger root\",\n \"a bellwort flower\",\n \"a lobelia seed\",\n \"a hawthorn berry\",\n \"a valerian leaf\",\n \"a skullcap flower\",\n \"slippery elm\",\n \"a kola nut\",\n \"sileris berry\",\n \"some irid moss\",\n \"a black cohosh root\"\n];\n\nclient.herb_names_group = [\n \"bloodroot leaves\",\n \"pieces of kelp\",\n \"goldenseal roots\",\n \"pieces of prickly ash bark\",\n \"pieces of bayberry bark\",\n \"ginseng roots\",\n \"ginger roots\",\n \"bellwort flowers\",\n \"lobelia seeds\",\n \"hawthorn berries\",\n \"valerian leaves\",\n \"skullcap flowers\",\n \"slippery elms\",\n \"kola nuts\",\n \"sileris berries\",\n \"pieces of irid moss\",\n \"cohosh roots\"\n];\n\nclient.herb_name_to_herb = {\n [\"a magnesium chip\"]: \"magnesium\",\n [\"an aurum flake\"]: \"aurum\",\n [\"a plumbum flake\"]: \"plumbum\",\n [\"a stannum flake\"]: \"stannum\",\n [\"an arsenic pellet\"]: \"arsenic\",\n [\"a ferrum flake\"]: \"ferrum\",\n [\"an antimony flake\"]: \"antimony\",\n [\"a cuprum flake\"]: \"cuprum\",\n [\"an argentum flake\"]: \"argentum\",\n [\"a calamine crystal\"]: \"calamine\",\n [\"a pinch of ground cinnabar\"]: \"cinnabar\",\n [\"a pinch of realgar crystals\"]: \"realgar\",\n [\"a quartz grain\"]: \"quartz\",\n [\"a pinch of ground malachite\"]: \"malachite\",\n [\"a quicksilver droplet\"]: \"quicksilver\",\n [\"a potash crystal\"]: \"potash\",\n [\"a gypsum crystal\"]: \"gypsum\",\n [\"a bloodroot leaf\"]: \"bloodroot\",\n [\"a piece of kelp\"]: \"kelp\",\n [\"a goldenseal root\"]: \"goldenseal\",\n [\"some prickly ash bark\"]: \"ash\",\n [\"some bayberry bark\"]: \"bayberry\",\n [\"a ginseng root\"]: \"ginseng\",\n [\"a ginger root\"]: \"ginger\",\n [\"a bellwort flower\"]: \"bellwort\",\n [\"a lobelia seed\"]: \"lobelia\",\n [\"a hawthorn berry\"]: \"hawthorn\",\n [\"a valerian leaf\"]: \"valerian\",\n [\"a skullcap flower\"]: \"skullcap\",\n [\"slippery elm\"]: \"elm\",\n [\"a kola nut\"]: \"kola\",\n [\"sileris berry\"]: \"sileris\",\n [\"some irid moss\"]: \"moss\",\n [\"a black cohosh root\"]: \"cohosh\",\n [\"magnesium chips\"]: \"magnesium\",\n [\"aurum flakes\"]: \"aurum\",\n [\"plumbum flakes\"]: \"plumbum\",\n [\"stannum flakes\"]: \"stannum\",\n [\"arsenic pellets\"]: \"arsenic\",\n [\"ferrum flakes\"]: \"ferrum\",\n [\"antimony flakes\"]: \"antimony\",\n [\"cuprum flakes\"]: \"cuprum\",\n [\"argentum flakes\"]: \"argentum\",\n [\"calamine crystals\"]: \"calamine\",\n [\"pinches of ground cinnabar\"]: \"cinnabar\",\n [\"pinches of ground realgar\"]: \"realgar\",\n [\"quartz grains\"]: \"quartz\",\n [\"pinches of ground malachite\"]: \"malachite\",\n [\"quicksilver droplets\"]: \"quicksilver\",\n [\"potash crystals\"]: \"potash\",\n [\"gypsum crystals\"]: \"gypsum\",\n [\"bloodroot leaves\"]: \"bloodroot\",\n [\"pieces of kelp\"]: \"kelp\",\n [\"goldenseal roots\"]: \"goldenseal\",\n [\"pieces of prickly ash bark\"]: \"ash\",\n [\"pieces of bayberry bark\"]: \"bayberry\",\n [\"ginseng roots\"]: \"ginseng\",\n [\"ginger roots\"]: \"ginger\",\n [\"bellwort flowers\"]: \"bellwort\",\n [\"lobelia seeds\"]: \"lobelia\",\n [\"hawthorn berries\"]: \"hawthorn\",\n [\"valerian leaves\"]: \"valerian\",\n [\"skullcap flowers\"]: \"skullcap\",\n [\"slippery elms\"]: \"elm\",\n [\"kola nuts\"]: \"kola\",\n [\"sileris berries\"]: \"sileris\",\n [\"pieces of irid moss\"]: \"moss\",\n [\"cohosh roots\"]: \"cohosh\"\n};\n\nlet cache_table = {\n magnesium: 0,\n plumbum: 0,\n arsenic: 0,\n potash: 0,\n stannum: 0,\n malachite: 0,\n realgar: 0,\n cinnabar: 0,\n antimony: 0,\n ferrum: 0,\n quartz: 0,\n quicksilver: 0,\n aurum: 0,\n calamine: 0,\n cuprum: 0,\n argentum: 0,\n gypsum: 0,\n\n //herbs\n ginseng: 0,\n bloodroot: 0,\n kelp: 0,\n hawthorn: 0,\n lobelia: 0,\n bellwort: 0,\n ginger: 0,\n bayberry: 0,\n ash: 0,\n goldenseal: 0,\n moss: 0,\n valerian: 0,\n elm: 0,\n skullcap: 0,\n sileris: 0,\n kola: 0,\n cohosh: 0\n};\n\nclient.cacheTable = cache_table;"},{"type":"function","name":"cacheClass","enabled":true,"id":326,"code":"client.Cache = class Cache extends client.Trackable {\n constructor(name, amount=0, obj) {\n super(name);\n this._blocks = obj.blocks || [];\n this._amount = amount;\n this._count = new client.Countable(this._name, 0, 20000);\n this._rift = 0;\n this.registerEvents();\n }\n\n get blocks() { return this._blocks }\n \n get amount() { return this._amount }\n\n get command() { return \"outr \"+(this.amount-this.count)+\" \"+this.name }\n\n get count() { return this._count.count }\n\n get rift() { return this._rift }\n\n get needToOutr() { return this.rift >= this.amount && this.count < this.amount }\n\n registerEvents() {\n client.eventStream.registerEvent(this.name+'CacheCountSubtractEvent', this.subtract.bind(this));\n client.eventStream.registerEvent(this.name+'CacheCountAddEvent', this.add.bind(this));\n client.eventStream.registerEvent(this.name+'CacheCountResetEvent', this.reset.bind(this));\n client.eventStream.registerEvent(this.name+'RiftSetEvent', this.riftSet.bind(this));\n }\n\n setCount(num) {\n return this._count.setCount(num);\n }\n\n add(num=1) {\n return this._count.add(num);\n }\n\n subtract(num=1) {\n return this._count.subtract(num);\n }\n\n reset() {\n return this.setCount(0);\n }\n\n riftSet(num) {\n this._rift = num;\n client.eventStream.raiseEvent('RiftSetEvent', this);\n }\n};"},{"type":"function","name":"cacheCreate","enabled":true,"id":328,"code":"client.Caches = {};\n\nlet cache = client.cacheTable;\nfor(let herb in cache) {\n let amount = cache[herb];\n let obj = {};\n obj.blocks = [\"death\", \"sleeping\", [\"brokenleftarm\", \"brokenrightarm\"], [\"brokenleftarm\", \"damagedrightarm\"], [\"brokenleftarm\", \"mangledrightarm\"],\n [\"damagedleftarm\", \"brokenrightarm\"], [\"damagedleftarm\", \"damagedrightarm\"], [\"damagedleftarm\", \"mangledrightarm\"],\n [\"mangledleftarm\", \"brokenrightarm\"], [\"mangledleftarm\", \"damagedrightarm\"], [\"mangledleftarm\", \"mangledrightarm\"],\n \"entangled\" ,\"transfixation\", \"impaled\", \"webbed\", \"bound\"];\n\n client.Caches[herb] = new Cache(herb, amount, obj);\n}"},{"type":"function","name":"cacheEvents","enabled":true,"id":329,"code":"let filterHerbAndAmount = function(herb) {\n if(herb.location == \"inv\") {\n if(herb.item != undefined && herb.item.icon == \"curative\"){\n let herbShort = \"\";\n let amount = 1;\n if(herb.item.name.startsWith(\"a group of\")) {\n let regexp = /(\\d+)\\s+(.+)/i;\n let matches = herb.item.name.match(regexp);\n herbShort = client.herb_name_to_herb[matches[2]];\n amount = parseInt(matches[1]);\n }\n else {\n herbShort = client.herb_name_to_herb[herb.item.name];\n amount = 1;\n }\n\n if(herbShort != undefined) {\n return {name: herbShort, amount: amount};\n }\n }\n }\n return false;\n};\n\nlet eventGmcpInvAdd = function(herb) {\n let herbAmt = filterHerbAndAmount(herb);\n if(herbAmt){\n client.eventStream.raiseEvent(herbAmt.name+'CacheCountAddEvent', herbAmt.amount);\n }\n};\n\nclient.eventStream.registerEvent('Char.Items.Add', eventGmcpInvAdd);\n\nlet eventGmcpInvRemove = function(herb) {\n let herbAmt = filterHerbAndAmount(herb);\n if(herbAmt){\n client.eventStream.raiseEvent(herbAmt.name+'CacheCountSubtractEvent', herbAmt.amount);\n }\n};\n\nclient.eventStream.registerEvent('Char.Items.Remove', eventGmcpInvRemove);\n\nlet eventGmcpIreRiftChange = function(args) {\n let herb = args.name;\n let amount = parseInt(args.amount);\n \n client.eventStream.raiseEvent(herb+'RiftSetEvent', amount);\n};\n\nclient.eventStream.registerEvent('IRE.Rift.Change', eventGmcpIreRiftChange);\n\nlet eventGmcpIreRiftList = function(args) {\n for(let i=0; i < args.length; i++) {\n client.eventStream.raiseEvent(args[i].name+'RiftSetEvent', args[i].amount);\n }\n \n client.eventStream.raiseEvent('RiftListCompleteEvent');\n};\n\nclient.eventStream.registerEvent('IRE.Rift.List', eventGmcpIreRiftList);"},{"type":"function","name":"cacheService","enabled":true,"id":330,"code":"client.getMissingCache = function() {\n let caches = client.Caches;\n let current_cache = [];\n for(let cache in caches) {\n if(caches[cache].needToOutr) {\n current_cache.push(caches[cache]);\n }\n }\n\n return current_cache;\n};\n\nclient.getCacheOutputs = function(affList) {\n if(client.Affs.blindness.have || client.Defs.mindseye.have) {\n let missingCache = client.getMissingCache(); // return this as sorted by prio\n let cacheOutputs = [];\n\n for (let i = 0; i < missingCache.length; i++) {\n let cache = missingCache[i];\n\n if (!client.arraysIntersect(cache.blocks, affList)) {\n cacheOutputs = cacheOutputs.concat(cache.command);\n }\n }\n\n return cacheOutputs;\n }\n else {\n return [];\n }\n};"}]},{"type":"group","name":"lust","enabled":true,"id":335,"items":[{"type":"function","name":"lust","enabled":true,"id":336,"code":"client.whiteList = [];\n\nlet rejectList = [];\n\nlet lustLost = function(who) {\n rejectList.splice(rejectList.indexOf(who), 1);\n};\nclient.eventStream.registerEvent('LustLostEvent', lustLost);\n\nlet lustGot = function(who) {\n // add if not already in there and if not in whitelist\n if(rejectList.indexOf(who) == -1 && client.whiteList.indexOf(who) == -1) {\n rejectList.push(who);\n client.eventStream.raiseEvent('RealLustGotEvent', who);\n }\n};\n\nclient.getLustCommands = function() {\n let cmd = [];\n for(let i=0; i < rejectList.length; i++) {\n cmd.push('reject '+rejectList[i]);\n }\n return cmd;\n};\n\nclient.eventStream.registerEvent('LustGotEvent', lustGot);\n\nlet lustLostAll = function() {\n rejectList = [];\n};\nclient.eventStream.registerEvent('LustNoneEvent', lustLostAll);"},{"type":"trigger","name":"","enabled":true,"id":337,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^(\\w+) quickly flings a tarot card at you, and you feel unreasonable lust for (?:him|her)\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('LustGotEvent', args[1]);"}]},{"type":"trigger","name":"","enabled":true,"id":338,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^You reject the friendship of (\\w+)\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('LustLostEvent', args[1]);"}]},{"type":"trigger","name":"","enabled":true,"id":339,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Whom do you wish to reject?","actions":[{"action":"script","script":"client.eventStream.raiseEvent('LustNoneEvent');"}]},{"type":"trigger","name":"","enabled":true,"id":340,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Why would you reject (\\w+)\\?$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('LustLostEvent', args[1]);"}]},{"type":"trigger","name":"","enabled":true,"id":366,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^You feel an unusually strong lust for (\\w+)\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('LustGotEvent', args[1]);"}]}]},{"type":"group","name":"gmcp","enabled":true,"id":265,"items":[{"type":"function","name":"gmcpHandler","enabled":true,"id":261,"code":"client.gmcpHandler = function() {\n while(client.gmcpBackLog && client.gmcpBackLog.length > 0) {\n let current_args = client.gmcpBackLog.shift();\n if(current_args.gmcp_method) {\n Object.setAtString(client.GMCP, current_args.gmcp_method.split('.'), current_args.gmcp_args);\n client.eventStream.raiseEvent(current_args.gmcp_method, current_args.gmcp_args);\n }\n }\n};\n\n\nclient.eventStream.registerEvent('SystemLoaded', function(args) { client.gmcpHandler(); } );"},{"type":"function","name":"onGMCP","enabled":true,"id":55,"code":"client.GMCP = client.GMCP || {};\n\nclient.gmcpBackLog = client.gmcpBackLog || [];\n\nclient.gmcpBackLog.push(args);\n\nif( client.system_loaded ) {\n client.gmcpHandler();\n}"},{"type":"function","name":"gmcpRaiseEvents","enabled":true,"id":342,"code":"client.roomItems = client.roomItems || {};\n\nclient.curRoom = 0;\nclient.curRoomName = '';\nclient.curArea = '';\nclient.curRoomArea = '';\n\nlet roomChangeCheck = function(args) {\n let curRoom = client.curRoom;\n if(curRoom != args.num) {\n client.curRoom = args.num;\n client.curRoomName = args.name;\n client.curArea = args.area;\n client.curRoomArea = args.name+ ' (' +args.area+')';\n client.eventStream.raiseEvent('RoomChangedEvent', curRoom);\n }\n};\n\nclient.eventStream.registerEvent('Room.Info', roomChangeCheck);\n\n\nlet addedItem = function(args) {\n if(args.location == \"room\") {\n client.eventStream.raiseEvent('ItemAddedToRoom', args.item);\n }\n else if(args.location == \"inv\") {\n client.eventStream.raiseEvent('ItemAddedToInv', args.item);\n }\n};\n\nclient.eventStream.registerEvent('Char.Items.Add', addedItem);\n\nlet removedItem = function(args) {\n if(args.location == \"room\") {\n client.eventStream.raiseEvent('ItemRemovedFromRoom', args.item);\n }\n else if(args.location == \"inv\") {\n client.eventStream.raiseEvent('ItemRemovedFromInv', args.item);\n }\n};\n\nclient.eventStream.registerEvent('Char.Items.Remove', removedItem);\n\nlet listItems = function(args) {\n if(args.location == \"room\") {\n client.eventStream.raiseEvent('ItemListForRoom', args.items);\n }\n else if(args.location == \"inv\") {\n client.eventStream.raiseEvent('ItemListForInv', args.items);\n }\n};\n\nclient.eventStream.registerEvent('Char.Items.List', listItems);\n\n\nclient.isItemInRoom = function(item) {\n return client.roomItems[item] != null;\n};\n\nlet addItemToRoom = function(item) {\n client.roomItems[item.name] = item.id;\n};\n\nclient.eventStream.registerEvent('ItemAddedToRoom', addItemToRoom);\n\nlet removeItemFromRoom = function(item) {\n client.roomItems[item.name] = null;\n};\n\nclient.eventStream.registerEvent('ItemRemovedFromRoom', removeItemFromRoom);\n\nlet itemListForRoom = function(items) {\n client.roomItems = {};\n for(let i=0; i < items.length; i++) {\n client.roomItems[items[i].name] = items[i].id;\n }\n\n};\n\nclient.eventStream.registerEvent('ItemListForRoom', itemListForRoom);"}]},{"type":"group","name":"echo","enabled":true,"id":266,"items":[{"type":"function","name":"echoClasses","enabled":true,"id":259,"code":"client.Echo = class Echo {\n constructor(fg, bg) {\n this._fg = fg || 'white';\n this._bg = bg;\n }\n\n echo(text) {\n client.display_notice(text, this._fg, this._bg);\n }\n};\n\nclient.EchoWithPrefix = class EchoWithPrefix extends client.Echo {\n constructor(prefix, fg, bg) {\n super(fg, bg);\n if(prefix !== undefined) {\n this._prefix = prefix.text;\n this._prefixFg = prefix.fg;\n this._prefixBg = prefix.bg;\n }\n }\n\n echo(text) {\n client.display_notice(this._prefix, this._prefixFg, this._prefixBg, text, this._fg, this._bg);\n }\n};\n\nclient.EchoLine = class EchoLine extends client.Echo {\n constructor(fg, bg) {\n super(fg, bg);\n }\n\n echo(text) {\n text += \"\\n\";\n super.echo(text);\n }\n};\n\nclient.EchoLinePrefix = class EchoLinePrefix extends client.EchoWithPrefix {\n constructor(prefix, fg, bg) {\n super(prefix, fg, bg);\n }\n\n echo(text) {\n text += \"\\n\";\n super.echo(text);\n }\n};\n"},{"type":"function","name":"echoEvents","enabled":true,"id":260,"code":"let TrackableEchoGot = new client.EchoLinePrefix({text: ' + ', fg: 'white' }, 'green');\nlet TrackableEchoLost = new client.EchoLinePrefix({text: ' - ', fg: 'white' }, 'red');\nlet AffEchoGot = new client.EchoLinePrefix({text: ' +aff ', fg: 'orange' }, 'green');\nlet AffEchoLost = new client.EchoLinePrefix({text: ' -aff ', fg: 'orange' }, 'red');\nlet DefEchoGot = new client.EchoLinePrefix({text: ' +def ', fg: 'purple' }, 'green');\nlet DefEchoLost = new client.EchoLinePrefix({text: ' -def ', fg: 'purple' }, 'red');\nlet BalanceEchoGot = new client.EchoLinePrefix({text: ' onBal ', fg: 'brown' }, 'green');\nlet BalanceEchoLost = new client.EchoLinePrefix({text: ' offBal ', fg: 'brown' }, 'red');\nlet PrioritySetEcho = new client.EchoLinePrefix({text: 'priority change: ', fg: 'yellow' }, 'red');\n\nlet gotTrackable = function(data) {\n if(client.sys.settings.echoTrackableGot) {\n TrackableEchoGot.echo(data.name);\n }\n};\n\nlet lostTrackable = function(data) {\n if(client.sys.settings.echoTrackableLost) {\n TrackableEchoLost.echo(data.name);\n }\n};\n\nlet gotAff = function(data) {\n if(client.sys.settings.echoAffGot) {\n AffEchoGot.echo(data.name);\n\n }\n};\n\nlet lostAff = function(data) {\n if(client.sys.settings.echoAffLost) {\n AffEchoLost.echo(data.name);\n\n }\n};\n\nlet gotDef = function(data) {\n if(client.sys.settings.echoDefGot) {\n DefEchoGot.echo(data.name);\n }\n};\n\nlet lostDef = function(data) {\n if(client.sys.settings.echoDefLost) {\n DefEchoLost.echo(data.name);\n }\n};\n\nlet gotBalance = function(data) {\n if(client.sys.settings.echoBalanceGot && data.name != \"SystemOutput\") {\n BalanceEchoGot.echo(data.name + \"(\" + data.duration.toFixed(2) + \")\");\n }\n};\n\nlet lostBalance = function(data) {\n if(client.sys.settings.echoBalanceLost) {\n BalanceEchoLost.echo(data.name);\n }\n};\n\nlet prioritySet = function(data) {\n if(client.sys.settings.echoPrioritySet) {\n PrioritySetEcho.echo(data.name + \" \" + data.prio);\n }\n};\n\nclient.eventStream.registerEvent('TrackableGot', gotTrackable);\nclient.eventStream.registerEvent('TrackableLost', lostTrackable);\nclient.eventStream.registerEvent('AffGot', gotAff);\nclient.eventStream.registerEvent('AffLost', lostAff);\nclient.eventStream.registerEvent('DefGot', gotDef);\nclient.eventStream.registerEvent('DefLost', lostDef);\nclient.eventStream.registerEvent('BalanceGot', gotBalance);\nclient.eventStream.registerEvent('BalanceLost', lostBalance);\nclient.eventStream.registerEvent('PrioritySetEvent', prioritySet);\n\n\nlet SystemOutputDisplay = new client.Echo('red');\n\nlet systemOutputSentDisplay = function(output) {\n\n SystemOutputDisplay.echo(\"(\"+output.join('|')+\")\");\n};\n\nclient.eventStream.registerEvent('OutputSentEvent', systemOutputSentDisplay);\n\nlet DorEchoStart = new client.EchoLinePrefix({text: '[dor]: ', fg: 'green' }, 'white');\nlet DorEchoStop = new client.EchoLinePrefix({text: '[dor]: ', fg: 'red' }, 'white');\nlet DorEchoExecuted = new client.EchoLinePrefix({text: '[dor]: ', fg: 'green' }, 'white');\n\nlet doRepeatStartedDisplay = function(dor) {\n DorEchoStart.echo('Looping '+dor.command+' every '+dor.length+' seconds');\n};\nclient.eventStream.registerEvent('DorDoRepeatStartedEvent', doRepeatStartedDisplay);\n\nlet doRepeatStoppedDisplay = function(dor) {\n DorEchoStop.echo('Stopped repeating');\n};\nclient.eventStream.registerEvent('DorDoRepeatStoppedEvent', doRepeatStoppedDisplay);\n\nlet doRepeatExecutedDisplay = function(dor) {\n DorEchoExecuted.echo(dor.command);\n};\nclient.eventStream.registerEvent('DorDoRepeatExecutedEvent', doRepeatExecutedDisplay);"},{"type":"function","name":"echoService","enabled":true,"id":288,"code":"let baseEchoClass = new client.Echo('white');\n\nclient.echo = baseEchoClass.echo;\n\nlet baseEchoLineClass = new client.EchoLine('white');\n\nclient.echoLine = baseEchoLineClass.echo;\n\nlet infoEchoLineClass = new client.EchoLinePrefix({text: '[Info]: ', fg: 'yellow' }, 'white');\n\nclient.echoInfoLine = infoEchoLineClass.echo;"}]},{"type":"group","name":"clientOverrides","enabled":true,"id":264,"items":[{"type":"function","name":"clientOverrides","enabled":true,"id":253,"code":"// Tael's display_notice extension\n//\n// Adds support for multi-chunk display notices.\n//\n// API:\n// display_notice(TEXT)\n// Displays TEXT.\n// display_notice(TEXT, FG_COLOR)\n// Displays TEXT in the color of FG_COLOR.\n// Example of printing \"Oh no!\" in red:\n// display_notice(\"Oh no!\", \"red\");\n// display_notice(TEXT, FG_COLOR, BG_COLOR)\n// Displays TEXT in the colour of FG_COLOR on a BG_COLOR background.\n// Note: Use \"\" for default colours.\n// Example of printing \"Oh no!\" in red on blue:\n// display_notice(\"Oh no!\", \"red\", \"blue\");\n// Example of printing \"Oh no!\" in default text colour on blue:\n// display_notice(\"Oh no!\", \"\", \"blue\");\n// display_notice(TEXT, FG_COLOR, BG_COLOR, TEXT2, FG_COLOR2, BG_COLOR2...)\n// Displays TEXT in the colour of FG_COLOR on a BG_COLOR background followed by TEXT2 in the colour of FG_COLOR2 on a BG_COLOR background.\n// Note: If the last FG_COLOR or BG_COLOR is unspecified or any FG_COLOR or BG_COLOR is \"\", the colours will be the last defined FG_COLOR or BG_COLOR (they will not revert to default colours).\n// Note: Set FG_COLOR to \"reset\" to return text and background colour to default (accompanying BG_COLOR will be ignored). There is no way to revert text or background colour independently.\n// Example of printing \"Oh no!\" in red on blue followed by \" Anything but that!\" in orange on green.\n// display_notice(\"Oh no!\", \"red\", \"blue\", \" Anything but that!\", \"orange\", \"green\");\n// Example of printing \"Oh no!\" in red on blue followed by \" Anything but that!\" in orange on blue.\n// display_notice(\"Oh no!\", \"red\", \"blue\", \" Anything but that!\", \"orange\");\n// Example of printing \"Oh no!\" in red on blue followed by \" Anything but that!\" in default colours.\n// display_notice(\"Oh no!\", \"red\", \"blue\", \" Anything but that!\", \"reset\");\n// Example of printing \"Oh no!\" in red on blue followed by \" Anything but that!\" in default text colour on blue:\n// display_notice(\"Oh no!\", \"red\", \"blue\", \"\", \"reset\", \"\", \" Anything but that!\", \"\", \"blue\");\n// Example of printing \"Oh no!\" in red on blue followed by \" Anything but that!\" in orange, then \" This is madness!\" in default colours, then \" Why?!\" in red.\n// display_notice(\"Oh no!\", \"red\", \"blue\", \" Anything but that!\", \"orange\", \"\", \" This is madness!\", \"reset\", \"\", \" Why?!\", \"red\");\n\nclient.display_notice = function (...args) {\n if (!args[0] || !args[0].length) {\n if(args[0] !== \"\") { // some variables will send in \"\", just pretend we're formatting no text\n return;\n }\n }\n let bg;\n let chunk = [];\n let chunks = [];\n let fg;\n let text;\n chunks.length = Math.ceil(args.length / 3);\n chunks = chunks.fill().map((ignore, i) => args.slice(i * 3, i * 3 + 3));\n chunks.forEach(function (e) {\n text = e[0];\n fg = e[1];\n bg = e[2];\n bg = client.convert_bgcolor(bg);\n chunk.push(linechunk_color(fg, bg));\n chunk.push(linechunk_text(text));\n });\n let line = {};\n line.parsed_line = linechunks_create(chunk);\n line.no_triggers = true;\n\n if (client.current_block) {\n let idx = client.current_block.length;\n if (client.current_line) idx = client.current_block.indexOf(client.current_line) + 1;\n client.current_block.splice(idx, 0, line);\n } else {\n let lines = [];\n lines.push(line);\n client.display_text_block(lines);\n }\n};\n\nclient.get_formatted_prompt = function (...args) {\n if (!args[0] || !args[0].length) {\n if(args[0] !== \"\") { // some variables will send in \"\", just pretend we're formatting no text\n return;\n }\n }\n let bg;\n let chunk = [];\n let chunks = [];\n let fg;\n let text;\n chunks.length = Math.ceil(args.length / 3);\n chunks = chunks.fill().map((ignore, i) => args.slice(i * 3, i * 3 + 3));\n chunks.forEach(function (e) {\n text = e[0];\n fg = e[1];\n bg = e[2];\n bg = client.convert_bgcolor(bg);\n chunk.push(linechunk_color(fg, bg));\n chunk.push(linechunk_text(text));\n });\n let line = {};\n line.parsed_prompt = linechunks_create(chunk);\n line.no_triggers = true;\n\n return line;\n};\n\nclient.generate_text_block = function(lines) {\n let customPromptEnabled = client.sys.settings.customPrompt;\n let count = 0;\n\n let timestamp;\n if (client.show_timestamp_milliseconds === true)\n timestamp = client.getTimeMS();\n else\n timestamp = client.getTimeNoMS();\n let cl = \"timestamp mono no_out\";\n timestamp = \"<span class=\\\"\" + cl + \"\\\">\" + timestamp + \" </span>\";\n\n let res = '';\n\n let counter = 0;\n for (let i = 0; i < lines.length; ++i) {\n let txt = lines[i].parsed_line;\n let font = lines[i].monospace ? 'mono' : '';\n let line = \"<p class=\\\"\" + font + \"\\\">\" + timestamp + (txt ? txt.formatted() : '') + \"</p>\";\n\n if (lines[i].gag) continue;\n //////// Moved because don't want gagged lines\n if (logging && txt) append_to_log(line);\n\n //if (lines[i].gag) continue;\n counter++;\n\n if (txt) {\n count++;\n res += line;\n }\n let pr = lines[i].parsed_prompt;\n if (pr && (count > 0)) { // no prompt if we gagged everything\n\n //////// Added\n if(customPromptEnabled) {\n lines[i] = client.prompt.getCustomPrompt();\n pr = lines[i].parsed_prompt;\n }\n line = \"<p class=\\\"prompt \" + font + \"\\\">\" + timestamp + pr.formatted() + \"</p>\";\n if (logging) append_to_log(line);\n res += line;\n }\n // empty line - include it if it's neither the first nor the last one\n // using \"counter\" instead of \"i\" fixes problems where the empty line is included after channel markers and such\n if ((!pr) && (!txt) && (counter > 1) && (i < lines.length - 1)) {\n res += '<p>' + timestamp + ' ' + '</p>';\n }\n }\n if (client.extra_break && res.length) res += \"<br />\";\n\n return res;\n};"},{"type":"function","name":"promptOverride","enabled":true,"id":252,"code":"client.prompt = client.prompt || {};\n\nclient.prompt.getCustomPrompt = function() {\n let vars = client.prompt.vars;\n let diffh = vars.diffh;\n let diffm = vars.diffm;\n\n vars.diffh = \"\";\n vars.diffm = \"\";\n\n if(vars.blackout) {\n return client.get_formatted_prompt('-', \"reset\", \"\");\n }\n\n return client.get_formatted_prompt(\n vars.paused + \"\", \"red\", \"\",\n vars.aeon + \"\", \"red\", \"\",\n vars.retard + \"\", \"blue\", \"\",\n vars.h + \"\", vars.hcolor, \"\",\n \"(\" + vars.ph + \"), \", vars.hcolor, \"\",\n vars.m + \"\", vars.mcolor, \"\",\n \"(\" + vars.pm + \"), \", vars.mcolor, \"\",\n vars.w + \", \", vars.wcolor, \"\",\n vars.e + \" \", vars.ecolor, \"\",\n vars.eq + vars.bal + \"|\", \"reset\", \"\",\n vars.c + vars.k + vars.d + vars.b + \" \", \"reset\", \"\",\n vars.target + \" \", \"green\", \"\",\n vars.kai + \"\", \"reset\", \"\",\n vars.kaitrance + \"\", \"blue\", \"\",\n vars.vitality + \"\", \"purple\", \"\",\n vars.stance + \" \", \"white\", \"\",\n vars.affString + \" \", \"brown\", \"\",\n diffh + \" \", vars.diffhcolor, \"\",\n diffm + \" \", vars.diffmcolor, \"\"\n );\n};\n\nclient.prompt.vars = {\n blackout: false,\n h: \"0\",\n m: \"0\",\n e: \"0\",\n w: \"0\",\n hcolor: \"green\",\n mcolor: \"green\",\n ecolor: \"green\",\n wcolor: \"green\",\n xp: \"0\",\n maxh: \"0\",\n maxm: \"0\",\n maxe: \"0\",\n maxw: \"0\",\n ph: \"100%\",\n pm: \"100%\",\n pe: \"100%\",\n pw: \"100%\",\n diffh: \"\",\n diffm: \"\",\n diffhcolor: \"green\",\n diffmcolor: \"green\",\n diffxp: \"\",\n target: \"\",\n eq: \"\",\n bal: \"\",\n c: \"\",\n k: \"\",\n d: \"\",\n b: \"\",\n affs: {},\n affString: \"\",\n paused: \"\",\n retard: \"\",\n aeon: \"\",\n kai: \"\",\n vitality: \"\",\n kaitrance: \"\",\n shintrance: \"\",\n stance: \"\",\n};\n\nclient.prompt.affAbbrev = {\n addiction: 'add',\n aeon: 'ae',\n agoraphobia: 'agor',\n airdisrupt: 'adsr',\n amnesia: 'amn',\n anorexia: 'ano',\n asleep: 'asl',\n asthma: 'ast',\n blackout: 'bo',\n blindness: 'unb',\n bound: 'bnd',\n brokenleftarm: 'la1',\n brokenleftleg: 'll1',\n brokenrightarm: 'ra1',\n brokenrightleg: 'rl1',\n bruisedribs: 'ribs',\n burning: 'burn',\n charredburn: '4burn',\n claustrophobia: 'clau',\n clumsiness: 'cl',\n confusion: 'con',\n corruption: 'corr',\n crackedribs: 'cr',\n damagedleftarm: 'la2',\n damagedleftleg: 'll2',\n damagedrightarm: 'ra2',\n damagedrightleg: 'rl2',\n damagedhead: 'hd2',\n darkshade: 'dark',\n dazed: 'dzd',\n deadening: 'dea',\n deafness: 'und',\n dehydrated: 'deh',\n dementia: 'dem',\n disloyalty: 'disl',\n disrupted: 'disr',\n dissonance: 'disso',\n dizziness: 'diz',\n earthdisrupt: 'edsr',\n entangled: 'entgl',\n epilepsy: 'epi',\n extremeburn: '3burn',\n fear: 'fear',\n firedisrupt: 'fdsr',\n frozen: 'frz',\n generosity: 'gen',\n haemophilia: 'haem',\n hallucinations: 'hall',\n hamstrung: 'hms',\n healthleech: 'hthl',\n heartseed: 'heart',\n hellsight: 'hell',\n hypersomnia: 'hypers',\n hypochondria: 'hypoch',\n hypothermia: 'hypoth',\n icefist: 'ice',\n impaled: 'impl',\n impatience: 'impat',\n itching: 'itch',\n justice: 'just',\n laceratedthroat: 'lac2',\n lethargy: 'let',\n loneliness: 'lon',\n lovers: 'love',\n insulation: 'cal',\n whisperingmadness: 'mad',\n mangledleftarm: 'la3',\n mangledleftleg: 'll3',\n mangledrightarm: 'ra3',\n mangledrightleg: 'rl3',\n mangledhead: 'hd3',\n masochism: 'maso',\n meltingburn: '5burn',\n mildtrauma: 'tor1',\n nausea: 'nau',\n slimeobscure: 'nkh',\n numbedleftarm: 'nbla',\n numbedrightarm: 'nbra',\n pacified: 'pac',\n paralysis: 'par',\n paranoia: 'prn',\n peace: 'pea',\n phlogistication: 'phlog',\n pinshot: 'psh',\n prone: 'pr',\n recklessness: 'reck',\n retardation: 'ret',\n roped: 'rop',\n sanguinehumour: 'sanH',\n scalded: 'scald',\n scytherus: 'scy',\n selarnia: 'sel',\n sensitivity: 'sen',\n serioustrauma: 'tor2',\n severeburn: '2burn',\n shivering: 'shiv',\n shyness: 'shy',\n skullfractures: 'sf',\n slashedthroat: 'lac1',\n sleeping: 'slp',\n slickness: 'sli',\n spiritdisrupt: 'sdsr',\n stain: 'sta',\n stupidity: 'st',\n stuttering: 'stut',\n homunculusmercury: 'merc',\n temperedcholeric: 'choH',\n temperedmelancholic: 'melaH',\n temperedphlegmatic: 'phleH',\n temperedsanguine: 'sanH',\n timeflux: 'tmfx',\n torntendons: 'tt',\n transfixation: 'trfx',\n vertigo: 'vert',\n vitrification: 'vitri',\n voidfist: 'void',\n voyria: 'voy',\n waterdisrupt: 'wdsr',\n weariness: 'wea',\n webbed: 'web',\n wristfractures: 'wf'\n};\n\nclient.prompt.colorPercentage = function(perc) {\n return perc > 75 ? 'green' : (perc >= 33 ? 'yellow' : 'red');\n};\n\nlet setPromptVitals = function(vitals) {\n let vars = client.prompt.vars;\n vars.h = vitals.h;\n vars.m = vitals.m;\n vars.e = vitals.e;\n vars.w = vitals.w;\n vars.xp = vitals.xp;\n vars.maxh = vitals.maxh;\n vars.maxm = vitals.maxm;\n vars.maxe = vitals.maxe;\n vars.maxw = vitals.maxw;\n vars.bleed = vitals.bleed;\n vars.rage = vitals.rage;\n vars.kai = vitals.kai;\n vars.shin = vitals.shin;\n vars.stance = vitals.stance;\n\n let perch = vitals.h*100/vitals.maxh;\n let percm = vitals.m*100/vitals.maxm;\n let perce = vitals.e*100/vitals.maxe;\n let percw = vitals.w*100/vitals.maxw;\n\n vars.hcolor = client.prompt.colorPercentage(perch);\n vars.mcolor = client.prompt.colorPercentage(percm);\n vars.ecolor = client.prompt.colorPercentage(perce);\n vars.wcolor = client.prompt.colorPercentage(percw);\n\n vars.ph = perch.toFixed(1)+\"%\";\n vars.pm = percm.toFixed(1)+\"%\";\n vars.pe = perce.toFixed(1)+\"%\";\n vars.pw = percw.toFixed(1)+\"%\";\n};\n\nlet setPromptAffs = function() {\n let promptAffs = [];\n let affs = client.prompt.vars.affs;\n let affAbbrev = client.prompt.affAbbrev;\n\n for(let aff in affs) {\n if(affs[aff]) {\n if(affs[aff] === true) {\n promptAffs.push(affAbbrev.hasOwnProperty(aff) ? affAbbrev[aff] : aff);\n }\n else {\n promptAffs.push((affAbbrev.hasOwnProperty(aff) ? affAbbrev[aff] : aff) + \"\\(\" + affs[aff] + \"\\)\");\n }\n }\n }\n\n client.prompt.vars.affString = promptAffs.length > 0 ? \"[\"+promptAffs.join(\" \")+\"]\" : \"\";\n};\n\nlet gotPromptAff = function(aff) {\n let name = aff.name;\n let affs = client.prompt.vars.affs;\n affs[aff.name] = aff.count || true;\n\n setPromptAffs();\n};\n\nlet lostPromptAff = function(aff) {\n let name = aff.name;\n let affs = client.prompt.vars.affs;\n affs[aff.name] = false;\n\n setPromptAffs();\n};\n\nlet setPromptDefs = function(args) {\n client.prompt.vars.c = client.Defs.cloak.have ? \"c\" : \"\";\n client.prompt.vars.k = client.Defs.kola.have ? \"k\" : \"\";\n client.prompt.vars.d = client.Affs.deafness.have ? \"\" : \"d\";\n client.prompt.vars.b = client.Affs.blindness.have ? \"\" : \"b\";\n};\n\nlet setPromptBals = function(args) {\n client.prompt.vars.eq = client.Bals.balance.have ? \"e\" : \"\";\n client.prompt.vars.bal = client.Bals.equilibrium.have ? \"x\" : \"\";\n};\n\nlet setHealthDiffPrompt = function(args) {\n client.prompt.vars.diffh = args.diff < 0 ? \"(\"+args.diff+\")\" : \"(+\"+args.diff+\")\";\n client.prompt.vars.diffhcolor = args.diff < 0 ? \"red\" : \"green\";\n};\n\nlet setManaDiffPrompt = function(args) {\n client.prompt.vars.diffm = args.diff < 0 ? \"(\"+args.diff+\")\" : \"(+\"+args.diff+\")\";\n client.prompt.vars.diffmcolor = args.diff < 0 ? \"red\" : \"green\";\n};\n\n\nclient.eventStream.registerEvent('AffGot', gotPromptAff);\nclient.eventStream.registerEvent('AffLost', lostPromptAff);\nclient.eventStream.registerEvent('SystemLoaded', setPromptDefs);\nclient.eventStream.registerEvent('DefGot', setPromptDefs);\nclient.eventStream.registerEvent('DefLost', setPromptDefs);\nclient.eventStream.registerEvent('SystemLoaded', setPromptBals);\nclient.eventStream.registerEvent('BalanceGot', setPromptBals);\nclient.eventStream.registerEvent('BalanceLost', setPromptBals);\nclient.eventStream.registerEvent('SystemCharVitalsUpdated', setPromptVitals);\nclient.eventStream.registerEvent('HealthUpdated', setHealthDiffPrompt);\nclient.eventStream.registerEvent('ManaUpdated', setManaDiffPrompt);\nclient.eventStream.registerEvent('SystemPaused', function(args) { client.prompt.vars.paused = \"(p)\"; });\nclient.eventStream.registerEvent('SystemUnpaused', function(args) { client.prompt.vars.paused = \"\"; });\nclient.eventStream.registerEvent('aeonLostAffEvent', function(args) { client.prompt.vars.aeon = \"\"; });\nclient.eventStream.registerEvent('aeonGotAffEvent', function(args) { client.prompt.vars.aeon = \"(a)\"; });\nclient.eventStream.registerEvent('SystemSlowModeOn', function(args) { client.prompt.vars.retard = \"(r)\"; });\nclient.eventStream.registerEvent('SystemSlowModeOff', function(args) { client.prompt.vars.retard = \"\"; });\nclient.eventStream.registerEvent('vitalityGotDefEvent', function(args) { client.prompt.vars.vitality = \"V\"; });\nclient.eventStream.registerEvent('vitalityLostDefEvent', function(args) { client.prompt.vars.vitality = \"\"; });\nclient.eventStream.registerEvent('kaitranceGotDefEvent', function(args) { client.prompt.vars.kaitrance = \"T\"; });\nclient.eventStream.registerEvent('kaitranceLostDefEvent', function(args) { client.prompt.vars.kaitrance = \"\"; });"}]},{"type":"group","name":"commonTables","enabled":true,"id":25,"items":[{"type":"function","name":"commonTables","enabled":true,"id":47,"code":"client.limbs = {};\n\nclient.limbs.short = {\n rl: 'right leg',\n ll: 'left leg',\n ra: 'right arm',\n la: 'left arm',\n h: 'head',\n tt: 'torso',\n c: 'centre',\n l: 'left',\n r: 'right'\n};\n\nclient.limbs.long = {\n 'right leg': 'rl',\n 'left leg': 'll',\n 'right arm': 'ra',\n 'left arm': 'la',\n head: 'h',\n torso: 'tt',\n centre: 'c',\n left: 'l',\n right: 'r'\n};\n\nclient.dirs = ['e', 'w', 's', 'n', 'ne', 'se', 'sw', 'nw', 'in', 'out', 'd', 'u'];\n\nclient.dirMap = {\n e: \"east\",\n w: \"west\",\n s: \"south\",\n n: \"north\",\n ne: \"northeast\",\n se: \"southeast\",\n sw: \"southwest\",\n nw: \"northwest\",\n in: \"in\",\n out: \"out\",\n down: \"down\",\n d: \"down\",\n u: \"up\",\n up: \"up\"\n};\n\nclient.oppDirs = {\n e: \"west\",\n w: \"east\",\n s: \"north\",\n n: \"south\",\n ne: \"southwest\",\n se: \"northwest\",\n sw: \"northeast\",\n nw: \"southeast\",\n in: \"out\",\n out: \"in\",\n down: \"up\",\n d: \"up\",\n u: \"down\",\n up: \"down\"\n};"}]},{"type":"group","name":"serverside","enabled":true,"id":267,"items":[{"type":"function","name":"serversideEvents","enabled":true,"id":268,"code":"let serversideSlowModeOn = function(args) {\n client.sendInline([\n \"curing siphealth 30\",\n \"curing sipmana 10\",\n \"curing mosshealth 0\",\n \"curing mossmana 0\",\n \"curing batch off\",\n \"curing clotat 5000\"]);\n};\n\nlet serversideSlowModeOff = function(args) {\n let settings = client.sys.state;\n client.sendInline([\n \"curing siphealth \"+settings.sipHealthAt,\n \"curing sipmana \"+settings.sipManaAt,\n \"curing mosshealth \"+settings.mossHealthAt,\n \"curing mossmana \"+settings.mossManaAt,\n \"curing batch on\",\n \"curing clotat \"+settings.clotAt]);\n};\n\nlet serversideDefencePrio = function(def) {\n if(def instanceof client.AffDef) {\n if(def.isServerSide && def.prio != client.serversideSettings.defs[def.name]) {\n if (def.isIgnored) {\n client.serversideSettings.defs[def.name] = undefined;\n client.eventStream.raiseEvent('SystemOutputAdd', 'curing priority defence ' + def.name + ' reset');\n }\n else {\n client.serversideSettings.defs[def.name] = def.prio;\n client.eventStream.raiseEvent('SystemOutputAdd', 'curing priority defence ' + def.name + ' ' + def.prio);\n }\n }\n }\n else if(def.isServerSide && def.prio != client.serversideSettings.defs[def.name]) {\n if(!(def.isIgnored && client.serversideSettings.defs[def.name] == undefined)) {\n if (def.isIgnored) {\n client.serversideSettings.defs[def.name] = undefined;\n client.eventStream.raiseEvent('SystemOutputAdd', 'curing priority defence ' + def.name + ' reset');\n }\n else {\n if (def.preempt) {\n client.serversideSettings.defs[def.name] = def.prio;\n client.eventStream.raiseEvent('SystemOutputAdd', 'curing priority defence ' + def.name + ' ' + def.prio + ' preempt');\n }\n else {\n client.serversideSettings.defs[def.name] = def.prio;\n client.eventStream.raiseEvent('SystemOutputAdd', 'curing priority defence ' + def.name + ' ' + def.prio);\n }\n }\n }\n }\n};\n\nlet serversideAffPrio = function(aff) {\n if(aff.isServerSide && aff.prio != client.serversideSettings.affs[aff.name]) {\n let prio = aff.prio;\n let reset = 26;\n\n if(prio === 0 || prio === reset) {\n client.serversideSettings.affs[aff.name] = 26;\n client.eventStream.raiseEvent('SystemOutputAdd', 'curing priority ' +aff.name+ ' '+reset);\n }\n else {\n client.serversideSettings.affs[aff.name] = prio;\n client.eventStream.raiseEvent('SystemOutputAdd', 'curing priority ' +aff.name+ ' ' +prio);\n }\n }\n};\n\nlet serversideCuringStatusMap = {\n curingMethod: 'transmutation',\n sipPriority: \"priority\",\n sipHealthAt: \"siphealth\",\n sipManaAt: \"sipmana\",\n mossHealthAt: \"mosshealth\",\n mossManaAt: \"mossmana\",\n focus: \"focus\",\n focusOverHerbs: \"focus\",\n tree: \"tree\",\n clot: \"clot\",\n clotAt: \"clotat\",\n insomnia: \"insomnia\",\n fracturesAbove: \"healthaffsabove\",\n manaAbilitiesAbove: \"manathreshold\",\n batch: \"batch\"\n};\n\nlet serversideSetStatus = function(args) {\n let status = args.status;\n let arg = args.arg;\n\n if(arg === true) {\n arg = \"on\";\n }\n else if(arg === false) {\n arg = \"off\";\n }\n else if(arg == 'Transmutation') {\n arg = \"on\";\n }\n else if(arg == 'Concoctions') {\n arg = \"off\";\n }\n if(status == \"focusOverHerbs\") {\n arg = arg ? \"first\" : \"second\";\n }\n\n client.eventStream.raiseEvent('SystemOutputAdd', 'curing '+serversideCuringStatusMap[status]+ ' ' +arg);\n\n};\n\nclient.eventStream.registerEvent('SystemPaused', function(args) { client.sendCmd(\"curing off\"); });\nclient.eventStream.registerEvent('SystemUnpaused', function(args) { client.sendCmd(\"curing on\"); });\nclient.eventStream.registerEvent('SystemSlowModeOn', serversideSlowModeOn);\nclient.eventStream.registerEvent('SystemSlowModeOff', serversideSlowModeOff);\nclient.eventStream.registerEvent('DefPrioritySetEvent', serversideDefencePrio);\nclient.eventStream.registerEvent('AffPrioritySetEvent', serversideAffPrio);\nclient.eventStream.registerEvent('SystemStatusSetEvent', serversideSetStatus);\n\nlet separatorSet = false;\n\nlet initiateStartup = function(args) {\n if(!separatorSet) {\n separatorSet = true;\n if(args) {\n client.sys.sep = args;\n set_variable('commandSeparator', args);\n }\n client.sys.pause();\n let startupCommands = [\n \"inr all\",\n \"score\",\n \"curing defences on\",\n \"curing afflictions on\",\n \"curing status\",\n \"curing priority list\",\n \"curing priority defence list\",\n \"def\",\n \"echo SystemEvent CuringStartupCompleteEvent\"\n ];\n\n for(let i=0; i < startupCommands.length; i++) {\n client.sendCmd(startupCommands[i]);\n }\n client.send_GMCP(\"IRE.Rift.Request\",\"\");\n }\n};\n\nclient.eventStream.registerEvent('CommandSeparatorSetOnStartup', initiateStartup);\n\nlet systemStartupServerside = function() {\n client.serversideSettings = {\n loaded: false,\n status: {},\n affs: {},\n defs: {}\n };\n let separator = client.sys.sep;\n client.sys.pause();\n if(separator) {\n initiateStartup(false);\n }\n else {\n client.echo(\"Enter commandSeparator to get started (e.g. 'config commandseparator |')\");\n }\n};\n\nclient.eventStream.registerEvent('SystemLoaded', systemStartupServerside);\n\n\nclient.serversideSettings = {\n loaded: false,\n status: {},\n affs: {},\n defs: {}\n};\n\nlet curingStatus = function(args) {\n let statusProperty = args.status;\n let arg = args.arg;\n if(arg == \"Yes\") {\n arg = true;\n }\n else if(arg == \"No\") {\n arg = false;\n }\n\n client.serversideSettings.status[statusProperty] = arg;\n};\n\n\nlet curingPriorityAffs = function(args) {\n let prio = args.prio == 26 ? 0 : args.prio;\n let affs = args.affs.split(\", \");\n for(let i=0; i < affs.length; i++) {\n let aff = affs[i];\n if(aff != \"\") {\n client.serversideSettings.affs[aff] = prio;\n }\n }\n};\n\nlet curingPriorityDefs = function(args) {\n let defs = client.Defs;\n let prio = args.prio;\n let defname = args.def;\n if(defname.length >= 15) {\n for(let def in defs) {\n if(def.startsWith(defname)){\n client.serversideSettings.defs[def] = prio;\n break;\n }\n }\n }\n else {\n client.serversideSettings.defs[defname] = prio;\n }\n};\n\nlet serversideCuringStatusSet = function(args) {\n let arg = args.arg;\n if(arg == \"activated\") {\n arg = true;\n }\n else if(arg == \"disabled\") {\n arg = false;\n }\n\n client.serversideSettings.status[args.status] = args.arg;\n};\n\nlet serversideAffPrioSet = function(args) {\n client.serversideSettings.affs[args.aff] = args.prio;\n};\n\nlet serversideDefPrioSet = function(args) {\n client.serversideSettings.defs[args.def] = args.prio;\n};\n\nclient.eventStream.registerEvent('CuringStatusEvent', curingStatus);\nclient.eventStream.registerEvent('CuringPriorityAffsEvent', curingPriorityAffs);\nclient.eventStream.registerEvent('CuringPriorityDefsEvent', curingPriorityDefs);\nclient.eventStream.registerEvent('ServersideCuringStatusSetEvent', serversideCuringStatusSet);\nclient.eventStream.registerEvent('ServersideAffPrioritySetEvent', serversideAffPrioSet);\nclient.eventStream.registerEvent('ServersideDefPrioritySetEvent', serversideDefPrioSet);\n\nlet curingStartupComplete = function(args) {\n client.serversideSettings.loaded = true;\n client.eventStream.raiseEvent('ServersideSettingsCaptured');\n client.sys.unpause();\n};\n\nlet setCuringStatusVars = function () {\n for(let status in client.serversideSettings.status) {\n let curStatus = client.serversideSettings.status[status];\n let systemStatus = client.sys.state[status];\n if(curStatus != systemStatus) {\n client.sys.setSystemStatus(status, systemStatus);\n }\n }\n};\n\nclient.eventStream.registerEvent('CuringStartupCompleteEvent', curingStartupComplete);\nclient.eventStream.registerEvent('ServersideSettingsCaptured', setCuringStatusVars);\n\nclient.serversideDefencePriorityListStart = false;\n\n\nlet disableTriggersOnPrompt = function() {\n if(client.serversideDefencePriorityListStart) {\n client.reflex_disable(client.reflex_find_by_name(\"trigger\", \"Curing Defence Priority List Line\", true, true, \"System\"));\n }\n client.serversideDefencePriorityListStart = false;\n};\n\nclient.eventStream.registerEvent('PromptEvent', disableTriggersOnPrompt);"},{"type":"trigger","name":"Curing Priority Set Affliction","enabled":true,"id":280,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^You have set the \\'(\\w+)\\' affliction to the (\\d+) priority\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideAffPrioritySetEvent', {'aff': args[1], 'prio': parseInt(args[2])});"}]},{"type":"trigger","name":"Curing Priority Set Defence","enabled":true,"id":281,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^You have set the \\'(\\w+)\\' defence to the (\\d+) priority\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideDefPrioritySetEvent', {'def': args[1], 'prio': parseInt(args[2])});"}]},{"type":"trigger","name":"Curing Defence Priority List Start","enabled":true,"id":282,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Your defence priorities for curing set current:","actions":[{"action":"enable","type":"trigger","name":"Curing Defence Priority List Line"},{"action":"script","script":"client.serversideDefencePriorityListStart = true;"}]},{"type":"trigger","name":"Curing Defence Priority List Line","enabled":false,"id":283,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^(\\w+)\\s*:\\s*(\\d+)\\s*$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringPriorityDefsEvent', {def: args[1], prio: parseInt(args[2])});"}]},{"type":"trigger","name":"Curing Affliction Priority List Start","enabled":true,"id":284,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Your affliction curing priorities for the priority set current:","actions":[{"action":"enable","type":"trigger","name":"Curing Affliction Priority List Line"}]},{"type":"trigger","name":"Curing Affliction Priority List Line","enabled":false,"id":285,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^(\\d+)\\:\\s*(.*)$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringPriorityAffsEvent', {affs: args[2], prio: parseInt(args[1])});"}]},{"type":"trigger","name":"Curing Affliction Priority End Line","enabled":true,"id":364,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Affs with priority 26 are ignored.","actions":[{"action":"disable","type":"trigger","name":"Curing Affliction Priority List Line"}]},{"type":"trigger","name":"Curing Status Paused","enabled":true,"id":290,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Enabled\\:\\s+(Yes|No)$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringStatusEvent', {status: 'paused', arg: args[1] != \"Yes\"});"}]},{"type":"trigger","name":"Curing Status Curing Method","enabled":true,"id":291,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Curing Method\\:\\s+(\\w+)$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringStatusEvent', {status: 'curingMethod', arg: args[1]});"}]},{"type":"trigger","name":"Curing Status Sip Priority","enabled":true,"id":292,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Health\\/Mana Priority\\:\\s+(Health|Mana)$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringStatusEvent', {status: 'sipPriority', arg: args[1]});"}]},{"type":"trigger","name":"Curing Status Curing Sip Health At","enabled":true,"id":293,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Sip health at\\:\\s+(\\d+)\\%$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringStatusEvent', {status: 'sipHealthAt', arg: parseInt(args[1])});"}]},{"type":"trigger","name":"Curing Status Curing Sip Mana At","enabled":true,"id":294,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Sip mana at\\:\\s+(\\d+)\\%$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringStatusEvent', {status: 'sipManaAt', arg: parseInt(args[1])});"}]},{"type":"trigger","name":"Curing Status Curing Moss Health At","enabled":true,"id":295,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Eat moss below health\\:\\s+(\\d+)\\%$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringStatusEvent', {status: 'mossHealthAt', arg: parseInt(args[1])});"}]},{"type":"trigger","name":"Curing Status Curing Moss Mana At","enabled":true,"id":296,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Eat moss below mana\\:\\s+(\\d+)\\%$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringStatusEvent', {status: 'mossManaAt', arg: parseInt(args[1])});"}]},{"type":"trigger","name":"Curing Status Curing Focus","enabled":true,"id":297,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Use focus\\:\\s+(Yes|No)$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringStatusEvent', {status: 'focus', arg: args[1]});"}]},{"type":"trigger","name":"Curing Status Curing Focus Over Herbs","enabled":true,"id":298,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Focus over herbs\\:\\s+(Yes|No)$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringStatusEvent', {status: 'focusOverHerbs', arg: args[1]});"}]},{"type":"trigger","name":"Curing Status Curing Tree","enabled":true,"id":299,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Use tree\\:\\s+(Yes|No)$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringStatusEvent', {status: 'tree', arg: args[1]});"}]},{"type":"trigger","name":"Curing Status Curing Clot","enabled":true,"id":300,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Use clot\\:\\s+(Yes|No)$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringStatusEvent', {status: 'clot', arg: args[1]});"}]},{"type":"trigger","name":"Curing Status Curing Clot At","enabled":true,"id":301,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Clot at\\:\\s+(\\d+) bleeding$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringStatusEvent', {status: 'clotAt', arg: parseInt(args[1])});"}]},{"type":"trigger","name":"Curing Status Curing Insomnia","enabled":true,"id":302,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Use insomnia\\:\\s+(Yes|No)$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringStatusEvent', {status: 'insomnia', arg: args[1]});"}]},{"type":"trigger","name":"Curing Status Curing Fractures Above","enabled":true,"id":303,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Will cure fractures above\\:\\s+(\\d+)\\% health$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringStatusEvent', {status: 'fracturesAbove', arg: parseInt(args[1])});"}]},{"type":"trigger","name":"Curing Status Curing Mana Abilities Above","enabled":true,"id":304,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Will use mana above\\:\\s+(\\d+)\\% mana$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringStatusEvent', {status: 'manaAbilitiesAbove', arg: parseInt(args[1])});"}]},{"type":"trigger","name":"Curing Status Curing Batch","enabled":true,"id":305,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Batch actions\\:\\s+(Yes|No)$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('CuringStatusEvent', {status: 'batch', arg: args[1]});"}]},{"type":"trigger","name":"Curing Status Set Paused","enabled":true,"id":307,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Curing (activated|disabled)\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'paused', arg: args[1]});"}]},{"type":"trigger","name":"Curing Status Set Curing Method Transmutation","enabled":true,"id":308,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You will now use transmutation cures.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'cureMethod', arg: 'Transmutation'});"}]},{"type":"trigger","name":"Curing Status Set Curing Method Concoctions","enabled":true,"id":309,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You will now use concoction-based cures.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'cureMethod', arg: 'Concoctions'});"}]},{"type":"trigger","name":"Curing Status Set Curing Sip Priority","enabled":true,"id":310,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Curing will now prioritise (mana|health) over (mana|health)\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'sipPriority', arg: args[1].toProperCase()});"}]},{"type":"trigger","name":"Curing Status Set Curing Sip At","enabled":true,"id":311,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^(Health|Mana) curing threshold set to (\\d+)\\%\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'sip'+args[1]+'At', arg: parseInt(args[2])});"}]},{"type":"trigger","name":"Curing Status Set Curing Moss At","enabled":true,"id":312,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Moss (health|mana) curing threshold set to (\\d+)\\%\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'moss'+args[1].toProperCase()+'At', arg: parseInt(args[2])});"}]},{"type":"trigger","name":"Curing Status Set Curing Focus","enabled":true,"id":313,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Automatic usage of focusing (activated|disabled)\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'focus', arg: args[1]});"}]},{"type":"trigger","name":"Curing Status Set Curing Focus Over Herbs","enabled":true,"id":314,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^You will now prioritise (focus|herbs) over (focus|herbs)\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'focusOverHerbs', arg: args[1] == \"focus\"});"}]},{"type":"trigger","name":"Curing Status Set Tree","enabled":true,"id":306,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Automatic usage of the tree tattoo (activated|disabled)\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'tree', arg: args[1]});"}]},{"type":"trigger","name":"Curing Status Set Clot On","enabled":true,"id":315,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^You will now attempt to clot your wounds\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'clot', arg: true});"}]},{"type":"trigger","name":"Curing Status Set Clot Off","enabled":true,"id":316,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^You will no longer attempt to clot your wounds\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'clot', arg: false});"}]},{"type":"trigger","name":"Curing Status Set Clot At","enabled":true,"id":317,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Will clot above (\\d+) bleeding\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'clotAt', arg: parseInt(args[1])});"}]},{"type":"trigger","name":"Curing Status Set Insomnia On","enabled":true,"id":318,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You will now use the insomnia ability.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'insomnia', arg: true});"}]},{"type":"trigger","name":"Curing Status Set Insomnia Off","enabled":true,"id":319,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You will now not use the insomnia ability.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'insomnia', arg: false});"}]},{"type":"trigger","name":"Curing Status Set Fractures Above","enabled":true,"id":320,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^Will cure health based afflictions above (\\d+)\\%\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'fracturesAbove', arg: parseInt(args[1])});"}]},{"type":"trigger","name":"Curing Status Set Mana Abilities Above","enabled":true,"id":321,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^You will now use mana if above (\\d+)\\% of your maximum mana reserves\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'manaAbilitiesAbove', arg: parseInt(args[1])});"}]},{"type":"trigger","name":"Curing Status Set Batch On","enabled":true,"id":322,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You will now attempt to cure multiple things at once.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'batch', arg: true});"}]},{"type":"trigger","name":"Curing Status Set Batch Off","enabled":true,"id":323,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You will now cure one thing at a time.","actions":[{"action":"script","script":"client.eventStream.raiseEvent('ServersideCuringStatusSetEvent', {status: 'batch', arg: false});"}]},{"type":"group","name":"PrioritySwapping","enabled":true,"id":359,"items":[{"type":"function","name":"ServersidePrioritySwapping","enabled":true,"id":360,"code":"let isClass = client.sys.isClass;\nlet checkOnPrompt = false;\n\nlet aeonSwapGot = function(aff) {\n let affs = client.Affs;\n if(aff.name == \"aeon\") {\n client.sendInline([\n \"curing siphealth 30\",\n \"curing sipmana 10\",\n \"curing mosshealth 0\",\n \"curing mossmana 0\",\n \"curing batch off\",\n \"curing clotat 5000\"]);\n affs.asthma.set_prio(3);\n affs.weariness.set_prio(4);\n affs.anorexia.set_prio(5);\n affs.impatience.set_prio(7);\n affs.paralysis.set_prio(8);\n }\n\n};\n\nlet aeonSwapLost = function(aff) {\n let affs = client.Affs;\n if(aff.name == \"aeon\") {\n let settings = client.sys.state;\n client.sendInline([\n \"curing siphealth \"+settings.sipHealthAt,\n \"curing sipmana \"+settings.sipManaAt,\n \"curing mosshealth \"+settings.mossHealthAt,\n \"curing mossmana \"+settings.mossManaAt,\n \"curing batch on\",\n \"curing clotat \"+settings.clotAt]);\n affs.asthma.reset_prio();\n affs.weariness.reset_prio();\n affs.anorexia.reset_prio();\n affs.impatience.reset_prio();\n affs.paralysis.reset_prio();\n }\n};\n\nclient.eventStream.registerEvent('AffGot', aeonSwapGot);\nclient.eventStream.registerEvent('AffLost', aeonSwapLost);\n\nlet checkFocusSwapLost = function(bal) {\n let affs = client.Affs;\n if(bal.name == \"focus\") {\n affs.stupidity.set_prio(9);\n affs.recklessness.set_prio(12);\n affs.dizziness.set_prio(14);\n affs.shyness.set_prio(14);\n }\n};\n\nlet checkFocusSwapGot = function(bal) {\n let affs = client.Affs;\n if(bal.name == \"focus\") {\n affs.stupidity.reset_prio();\n affs.recklessness.reset_prio();\n affs.dizziness.reset_prio();\n affs.shyness.reset_prio();\n }\n};\n\nclient.eventStream.registerEvent('BalanceLost', checkFocusSwapLost);\nclient.eventStream.registerEvent('BalanceGot', checkFocusSwapGot);\n\nlet checkPrioritySwaps = function(arg) {\n \n if(checkOnPrompt) {\n \n checkOnPrompt = false;\n let affs = client.Affs;\n\n // Scytherus\n if (client.haveAffs(['scytherus', 'paralysis'])) {\n affs.scytherus.set_prio(2);\n }\n else {\n affs.scytherus.reset_prio();\n }\n\n // Confusion and Disrupt\n if (client.haveAffs(['confusion', 'disrupted']) && (client.haveBal('focus') || client.haveAff('impatience')) && !client.haveAff('whisperingmadness')) {\n affs.confusion.set_prio(2);\n }\n else {\n affs.confusion.reset_prio();\n }\n\n if (client.haveAff('impatience') && client.snapTrack.have && client.snapTrack.elapsed() < 8000) {\n affs.impatience.set_prio(2);\n }\n else {\n affs.impatience.reset_prio();\n }\n\n if (client.haveAffs(['impatience', 'hypochondria'])) {\n affs.hypochondria.set_prio(1);\n }\n else if (client.haveAff('hypochondria') && client.snapTrack.have && client.snapTrack.elapsed() < 8000) {\n affs.hypochondria.set_prio(2);\n }\n else {\n affs.hypochondria.reset_prio();\n }\n\n if (client.haveAffs(['slickness', 'asthma']) && client.haveAnAff(['sensitivity', 'clumsiness', 'weariness', 'hypochondria']) && !affs.anorexia.have) {\n affs.slickness.set_prio(2);\n }\n else {\n affs.slickness.reset_prio();\n }\n\n if (client.haveAffs(['slickness', 'asthma']) && !client.haveAnAff(['sensitivity', 'clumsiness', 'weariness', 'hypochondria'])) {\n affs.asthma.set_prio(2);\n }\n else if (client.haveAffs(['hellsight', 'asthma'])) {\n affs.asthma.set_prio(2);\n }\n else {\n affs.asthma.reset_prio();\n }\n\n if (affs.darkshade.have && affs.darkshade.elapsed() > 10000 && client.roomItems['a lightwall']) {\n affs.darkshade.set_prio(2);\n }\n else {\n affs.darkshade.reset_prio();\n }\n\n if (client.haveAffs(['prone', 'sensitivity']) && client.haveAnAff(['damagedleftleg', 'damagedrightleg'])) {\n affs.sensitivity.set_prio(2);\n }\n else {\n affs.sensitivity.reset_prio();\n }\n\n if (client.haveAff('conflagration') && client.haveAnAff(['brokenleftleg', 'brokenrightleg', 'damagedleftleg', 'damagedrightleg', 'mangledleftleg', 'mangledrightleg'])) {\n if (client.haveAff('prone') && !client.haveAnAff(['damagedleftleg', 'damagedrightleg', 'mangledleftleg', 'mangledrightleg'])) {\n affs.burning.set_prio(7);\n }\n else {\n affs.burning.set_prio(4);\n }\n }\n else {\n affs.burning.reset_prio();\n }\n\n if (client.haveAff('timeflux')) {\n if (client.haveAff('prone') && !client.haveAnAff(['damagedleftleg', 'damagedrightleg', 'mangledleftleg', 'mangledrightleg'])) {\n affs.insulation.set_prio(7);\n }\n else {\n affs.insulation.set_prio(4);\n }\n }\n else {\n affs.insulation.reset_prio();\n }\n\n if (affs.cadmuscurse.have) {\n affs.vertigo.set_prio(4);\n }\n else {\n affs.vertigo.reset_prio();\n }\n\n // add vivi and heartseed curing here\n if (affs.prone.have && (client.haveAnAff(['damagedleftleg', 'damagedrightleg', 'mangledleftleg', 'mangledrightleg']) || client.haveAffs(['brokenrightleg', 'brokenleftleg']))) {\n affs.damagedleftleg.set_prio(6);\n affs.damagedrightleg.set_prio(6);\n affs.mangledleftleg.set_prio(6);\n affs.mangledrightleg.set_prio(6);\n }\n else {\n affs.damagedleftleg.reset_prio();\n affs.damagedrightleg.reset_prio();\n affs.mangledleftleg.reset_prio();\n affs.mangledrightleg.reset_prio();\n }\n\n // Fitness\n if (isClass(['Runewarden', 'Monk', 'Blademaster', 'Infernal', 'Paladin', 'Sentinel', 'Druid'])) {\n if (client.haveAff('asthma')) {\n if (client.haveAnAff(['slickness', 'hellsight']) && client.haveAnAff(['paralysis', 'clumsiness', 'sensitivity'])) {\n client.Cures.fitness.set_prio(100);\n }\n else if (client.haveAnAff(['damagedhead', 'mangledhead', 'damagedleftleg', 'damagedrightleg']) && client.haveAnAff(['paralysis', 'clumsiness', 'sensitivity', 'slickness', 'hellsight', 'disloyalty'])) {\n client.Cures.fitness.set_prio(100);\n }\n else {\n client.Cures.fitness.reset_prio();\n }\n }\n else {\n client.Cures.fitness.reset_prio();\n }\n }\n else {\n client.Cures.fitness.reset_prio();\n }\n\n // Dragon\n if (isClass('Dragon')) {\n // Dragonheal\n\n if (client.haveAffs([\"asthma\", \"slickness\", \"anorexia\"]) && (!client.haveBal(\"focus\") || client.haveAff(\"impatience\"))) {\n client.Cures.dragonheal.set_prio(100);\n }\n else {\n client.Cures.dragonheal.reset_prio();\n }\n\n // Dragonflex\n\n if (client.haveAffs([\"entangled\", \"webbed\"])) {\n client.Cures.dragonflex.set_prio(100);\n }\n else if (client.haveAnAff(['entangled', 'webbed'])) {\n if (client.haveBal(\"balance\") && !client.haveBal(\"writhe\") || client.haveAff('transfixation')) {\n client.Cures.dragonflex.set_prio(100);\n }\n else {\n client.Cures.dragonflex.reset_prio();\n }\n }\n else {\n client.Cures.dragonflex.reset_prio();\n }\n }\n else {\n client.Cures.dragonflex.reset_prio();\n client.Cures.dragonheal.reset_prio();\n }\n\n // Magi\n if (isClass('Magi')) {\n // Bloodboil\n if (client.haveAffs(['asthma', 'slickness'])) {\n if (client.haveAnAff(['hypochondria', 'paralysis']) || (client.haveAff('anorexia') && (!client.haveBal(\"focus\") || client.haveAff(\"impatience\")))) {\n client.Cures.bloodboil.set_prio(100);\n }\n else {\n client.Cures.bloodboil.reset_prio();\n }\n }\n else {\n client.Cures.bloodboil.reset_prio();\n }\n }\n else {\n client.Cures.bloodboil.reset_prio();\n }\n\n\n // Bard\n if (isClass('Bard')) {\n // Dwinnu\n if (client.haveAffs(['webbed', 'entangled'])) {\n client.Cures.dwinnu.set_prio(100);\n }\n else if (client.haveAnAff(['webbed', 'entangled']) && client.haveAff('transfixation')) {\n client.Cures.dwinnu.set_prio(100);\n }\n else {\n client.Cures.dwinnu.reset_prio();\n }\n }\n else {\n client.Cures.dwinnu.reset_prio();\n }\n\n // Alchemist\n if (isClass('Alchemist')) {\n // Salt\n if (client.haveAffs(['asthma', 'slickness', 'anorexia']) && (!client.haveBal(\"focus\") || client.haveAff(\"impatience\"))) {\n client.Cures.salt.set_prio(100);\n }\n else if (client.haveAffs(['asthma', 'slickness', 'hypochondria']) || client.haveAffs(['asthma', 'slickness', 'paralysis'])) {\n client.Cures.salt.set_prio(100);\n }\n else {\n client.Cures.salt.reset_prio();\n }\n }\n else {\n client.Cures.salt.reset_prio();\n }\n\n // Serpent\n if (isClass('Serpent')) {\n // Shrugging\n if (client.haveAffs(['asthma', 'slickness', 'anorexia']) && (!client.haveBal(\"focus\") || client.haveAff(\"impatience\"))) {\n client.Cures.shrugging.set_prio(100);\n }\n else if (client.haveAffs(['asthma', 'slickness', 'hypochondria']) || client.haveAffs(['asthma', 'slickness', 'paralysis'])) {\n client.Cures.shrugging.set_prio(100);\n }\n else {\n client.Cures.shrugging.reset_prio();\n }\n }\n else {\n client.Cures.shrugging.reset_prio();\n }\n\n // Occultist\n if (isClass('Occultist')) {\n // Fool\n if (client.haveAffs(['asthma', 'slickness', 'anorexia']) && (!client.haveBal(\"focus\") || client.haveAff(\"impatience\"))) {\n client.Cures.fool.set_prio(100);\n }\n else if (client.haveAffs(['asthma', 'slickness', 'hypochondria']) || client.haveAffs(['asthma', 'slickness', 'impatience'])) {\n client.Cures.fool.set_prio(100);\n }\n else {\n client.Cures.fool.reset_prio();\n }\n }\n else {\n client.Cures.fool.reset_prio();\n }\n\n // Blademaster\n if (isClass('Blademaster')) {\n // Alleviate\n if (client.haveAffs(['asthma', 'slickness', 'anorexia']) && (!client.haveBal(\"focus\") || client.haveAff(\"impatience\"))) {\n client.Cures.alleviate.set_prio(100);\n }\n else if (client.haveAffs(['asthma', 'slickness', 'hypochondria']) || client.haveAffs(['asthma', 'slickness', 'impatience'])) {\n client.Cures.alleviate.set_prio(100);\n }\n else {\n client.Cures.alleviate.reset_prio();\n }\n }\n else {\n client.Cures.alleviate.reset_prio();\n }\n }\n};\n\nlet checkPrioritySwapsOnPrompt = function() {\n checkOnPrompt = true;\n};\n\nclient.eventStream.registerEvent('PromptEvent', checkPrioritySwaps);\nclient.eventStream.registerEvent('AffGot', checkPrioritySwapsOnPrompt);\nclient.eventStream.registerEvent('AffLost', checkPrioritySwapsOnPrompt);\nclient.eventStream.registerEvent('BalanceLost', checkPrioritySwapsOnPrompt);\nclient.eventStream.registerEvent('BalanceGot', checkPrioritySwapsOnPrompt);\nclient.eventStream.registerEvent('ClassChanged', checkPrioritySwapsOnPrompt);\n\nlet spiritDisruptGained = function(aff) {\n if(aff.name == \"spiritdisrupt\") {\n client.sendCmd('curing focus off');\n }\n};\n\nlet spiritDisruptLost = function(aff) {\n if(aff.name == \"spiritdisrupt\") {\n client.sendCmd('curing focus on');\n }\n};\n\nclient.eventStream.registerEvent('AffGot', spiritDisruptGained);\nclient.eventStream.registerEvent('AffLost', spiritDisruptLost);\n\nlet cadmusGained = function(aff) {\n if(aff.name == \"cadmuscurse\") {\n client.sendCmd('curing focus off');\n }\n};\n\nlet cadmusLost = function(aff) {\n if(aff.name == \"cadmuscurse\") {\n client.sendCmd('curing focus on');\n }\n};\n\nclient.eventStream.registerEvent('AffGot', cadmusGained);\nclient.eventStream.registerEvent('AffLost', cadmusLost);"},{"type":"function","name":"PrioSwapTrackables","enabled":true,"id":361,"code":"let isTarget = client.sys.isTarget;\nclient.snapTrack = new client.Trackable('Snapped');\nclient.heartseedMode = false;\nclient.viviMode = false;\n\nlet gotSnapped = function(person) {\n if(isTarget(person)) {\n client.eventStream.raiseEvent('SnappedGotTrackableEvent');\n }\n};\n\n\nclient.eventStream.registerEvent('GotSnappedEvent', gotSnapped);"},{"type":"trigger","name":"Got snapped","enabled":true,"id":362,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^(\\w+) snaps (?:his|her) fingers in front of you\\.$","actions":[{"action":"script","script":"client.eventStream.raiseEvent('GotSnappedEvent', args[1]);"}]}]}]},{"type":"group","name":"utility","enabled":true,"id":110,"items":[{"type":"function","name":"utilityFunctions","enabled":true,"id":17,"code":"client.sendCmd = function(cmd) {\n send_command(cmd);\n client.eventStream.raiseEvent('SendCommandEvent', cmd)\n};\n\nclient.psend = function(what) {\n if( !client.sys.isPaused() ) {\n client.sendCmd(what);\n }\n};\n\nclient.rsend = function(what) {\n if( !client.sys.isSlowMode() ) {\n client.psend(what);\n }\n};\n\n// get diff from now with previous time, input ms get seconds\nclient.timeDiffNow = function(prev) {\n return (performance.now() - prev)/1000;\n};\n\nclient.sendInline = function(cmd) {\n client.sendCmd(cmd.join(client.sys.sep));\n};\n"},{"type":"alias","name":"","enabled":true,"id":94,"matching":"exact","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"run_function('onLoad', {}, 'System');"}],"text":"load"},{"type":"alias","name":"","enabled":true,"id":109,"matching":"regexp","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"console.log(client[args[1]]);\ndisplay_notice(client[args[1]]);"}],"text":"^display\\s+(\\w+)$"},{"type":"alias","name":"raiseEvent Alias","enabled":true,"id":279,"matching":"regexp","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"client.eventStream.raiseEvent(args[1]);"}],"text":"^event\\s+(\\w+)$"},{"type":"alias","name":"logging on/off","enabled":true,"id":289,"matching":"regexp","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"client.sysLoggingToggle(args[1]);"}],"text":"^logging(on|off)$"}]},{"type":"group","name":"queueing","enabled":true,"id":269,"items":[{"type":"function","name":"queueing","enabled":true,"id":270,"code":"client.QueueClass = class QueueClass {\n constructor(obj) {\n this._name = obj.name;\n this._prefix = obj.prefix || '';\n this._clear = obj.clear || '';\n this._queue = [];\n this._length = obj.length || 0;\n this._timer = new client.Timer(this._name, this._length);\n }\n\n add(cmd) {\n this._queue.push(cmd);\n return this;\n }\n\n send(dontClear) {\n this._timer.clearCallbacks();\n this._timer.stop();\n\n if(!dontClear) {\n this._timer.addCallback( this.clearQueue.bind(this) );\n }\n this._timer.start();\n this._queue[0] = this._prefix + this._queue[0];\n\n //client.sendCmd(this._clear);\n client.sendInline(this._queue);\n client.eventStream.raiseEvent(this._name+'QueueFired', this);\n this._queue = [];\n return this;\n }\n\n clearQueue() {\n this._timer.clearCallbacks();\n this._timer.stop();\n client.sendCmd(this._clear);\n client.eventStream.raiseEvent(this._name+'QueueCleared', this);\n return this;\n }\n};\n\nclient.EqBalQueue = new client.QueueClass({name: 'eqbal', prefix: 'queue addclear eqbal ', clear: 'clearqueue eqbal', length: 0.5});\nclient.ClassQueue = new client.QueueClass({name: 'class', prefix: 'queue addclear class ', clear: 'clearqueue class', length: 0.5});"},{"type":"function","name":"doRepeat","enabled":true,"id":332,"code":"client.DoRepeatClass = class DoRepeat {\n constructor(name, length, prefix, clear, affEvents=[], balEvents=[]) {\n this.name = name;\n this.length = length;\n this.command = \"\";\n this.enabled = false;\n this.clear = clear;\n this.prefix = prefix;\n this.affEvents = affEvents;\n this.balEvents = balEvents;\n this.expandAlias = false;\n this.timer = new client.Timer(this.name, this.length);\n this.registerEvents();\n }\n\n registerEvents() {\n client.eventStream.registerEvent('AffLost', this.checkAff.bind(this));\n client.eventStream.registerEvent('BalanceGot', this.checkBalance.bind(this));\n }\n\n checkAff(aff) {\n if(this.affEvents.includes(aff.name)) {\n this.execute();\n }\n }\n\n checkBalance(bal) {\n if(this.balEvents.includes(bal.name)) {\n this.execute();\n }\n }\n\n stop() {\n this.enabled = false;\n this.timer.clearCallbacks();\n this.timer.stop();\n if(!this.expandAlias) client.sendCmd(this.clear);\n client.eventStream.raiseEvent(this.name+'DoRepeatStoppedEvent', this);\n }\n\n start(command, expandAlias) {\n this.expandAlias = expandAlias;\n this.enabled = true;\n this.command = command;\n this.timer.addCallback( this.execute.bind(this) );\n client.eventStream.raiseEvent(this.name+'DoRepeatStartedEvent', this);\n this.execute();\n }\n\n execute() {\n if(this.enabled) {\n this.timer.stop();\n if(this.expandAlias) {\n client.send_direct(this.command, false);\n }\n else {\n client.sendCmd(this.prefix + ' ' + this.command);\n }\n this.timer.start();\n client.eventStream.raiseEvent(this.name+'DoRepeatExecutedEvent', this);\n }\n }\n\n toggle() {\n this.enabled ? this.stop() : this.start(this.command, this.expandAlias);\n }\n};\n\nlet balEvents = [\"balance\", \"equilibrium\"];\nlet affEvents = [\"paralysis\", \"prone\", \"stun\", \"brokenleftarm\", \"brokenrightarm\", \"brokenleftleg\", \"brokenrightleg\", \"transfixation\", \"webbed\", \"roped\", \"impaled\"];\nlet dorRepeatLength = 1.0;\nlet dorPrefix = 'queue addclear eqbal ';\nlet dorClear = 'clearqueue eqbal';\n\nclient.doRepeat = new client.DoRepeatClass('Dor', dorRepeatLength, dorPrefix, dorClear, affEvents, balEvents);"},{"type":"function","name":"doCommandWhenCan","enabled":true,"id":343,"code":"let commandsToDo = [];\n\n\nclient.diagWhenCan = function() {\n if(commandsToDo.indexOf('diagnose') == -1) {\n commandsToDo.push('diagnose');\n }\n client.eventStream.raiseEvent('ForcePopulateEvent');\n};\n\nlet resetNeedToDiag = function() {\n commandsToDo.splice(commandsToDo.indexOf('diagnose'), 1);\n};\n\nclient.eventStream.registerEvent('Char.Afflictions.List', resetNeedToDiag);\n\nclient.getCommandsToDo = function(affList, balList) {\n let cmds = [];\n if(commandsToDo.includes('diagnose')) {\n if (balList.includes('balance') && balList.includes('equilibrium')) {\n cmds.push('diagnose');\n }\n }\n \n return cmds;\n};"},{"type":"alias","name":"","enabled":true,"id":333,"matching":"exact","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"client.doRepeat.toggle();"}],"text":"dor"},{"type":"alias","name":"","enabled":true,"id":334,"matching":"regexp","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"client.doRepeat.start(args[1], false);"}],"text":"^dor\\s+(.+)$"},{"type":"alias","name":"","enabled":true,"id":341,"matching":"regexp","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"client.doRepeat.start(args[1], true);"}],"text":"^dora\\s+(.+)$"},{"type":"alias","name":"","enabled":true,"id":344,"matching":"exact","whole_words":true,"case_sensitive":true,"prefix_suffix":true,"actions":[{"action":"script","script":"client.diagWhenCan();"}],"text":"dv"},{"type":"trigger","name":"","enabled":true,"id":345,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Your eqbal queue is already empty.","actions":[{"action":"gag"}]},{"type":"trigger","name":"","enabled":true,"id":346,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"[System]: Queued eqbal commands cleared.","actions":[{"action":"gag"}]},{"type":"trigger","name":"","enabled":true,"id":347,"matching":"regexp","whole_words":true,"case_sensitive":true,"text":"^\\[System\\]\\: Added .+ to your eqbal queue\\.$","actions":[{"action":"gag"}]}]},{"type":"group","name":"gags","enabled":true,"id":348,"items":[{"type":"trigger","name":"","enabled":true,"id":349,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"[Curing]: CLOT","actions":[{"action":"gag"}]},{"type":"trigger","name":"","enabled":true,"id":350,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You exert superior mental control and your wounds clot before your eyes.","actions":[{"action":"gag"}]},{"type":"trigger","name":"","enabled":true,"id":351,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You must regain balance first.","actions":[{"action":"gag"}]},{"type":"trigger","name":"","enabled":true,"id":352,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"You must regain equilibrium first.","actions":[{"action":"gag"}]}]},{"type":"group","name":"CustomSettings","enabled":true,"id":367,"items":[{"type":"function","name":"CustomSettingsService","enabled":true,"id":374,"code":"let updateList = function(list, newList) {\n if(newList) {\n for (let i = 0; i < newList.length; i++) {\n if (!list.includes(newList[i])) {\n list.push(newList[i]);\n }\n }\n }\n};\n\nlet updateModel = function(model, newModel) {\n if(newModel) {\n for(let key in newModel) {\n model[key] = newModel[key];\n }\n }\n else {\n console.log(name+ ' model was null in updateModel');\n }\n};\n\nlet saveModel = function(name, model) {\n if(model) {\n set_variable(name, model);\n client.eventStream.raiseEvent(name+'ModelSavedEvent', model);\n }\n else {\n console.log(name+ ' model was null in saveModel');\n }\n};\n\nlet updateAndSaveModel = function(name, model, newModel) {\n updateModel(model, newModel);\n saveModel(name, model);\n};\n\nclient.updateModel = updateModel;\nclient.updateList = updateList;\nclient.saveModel = saveModel;\nclient.updateAndSaveModel = updateAndSaveModel;\n"},{"type":"function","name":"CustomSettingsFromServer","enabled":true,"id":368,"code":"let loadSystemSettings = function() {\n let model = get_variable('CustomSystemSettings');\n client.updateAndSaveModel('CustomSystemSettings', client.sys.settings, model);\n};\n\nlet loadAffSettings = function() {\n let model = get_variable('CustomAffSettings');\n if(model) {\n client.updateList(client.affTable.list, model.list);\n client.updateModel(client.affTable.prios, model.prios);\n if(model.types) {\n client.updateModel(client.affTable.types.defs, model.types.defs);\n client.updateModel(client.affTable.types.countable, model.types.countable);\n client.updateModel(client.affTable.types.timed, model.types.timed);\n client.updateModel(client.affTable.types.unknown, model.types.unknown);\n client.updateModel(client.affTable.types.uncurable, model.types.uncurable);\n }\n }\n\n client.saveModel('CustomAffSettings', client.affTable);\n};\n\nlet loadDefTable = function() {\n let model = get_variable('CustomDefTable');\n client.updateAndSaveModel('CustomDefTable', client.defTable, model);\n};\n\nlet loadDefSettings = function() {\n let model = get_variable('CustomDefSettings');\n if(model) {\n client.updateModel(client.defPrios.keepup, model.keepup);\n client.updateModel(client.defPrios.static, model.static);\n }\n\n client.saveModel('CustomDefSettings', client.defPrios);\n};\n\nlet loadBalanceTable = function() {\n let model = get_variable('CustomBalanceTable');\n client.updateAndSaveModel('CustomBalanceTable', client.balTable, model);\n};\n\nlet loadCacheSettings = function() {\n let model = get_variable('CustomCacheSettings');\n client.updateAndSaveModel('CustomCacheSettings', client.cacheTable, model);\n};\n\nlet loadCureTable = function() {\n let model = get_variable('CustomCureTable');\n client.updateAndSaveModel('CustomCureTable', client.cureTable, model);\n};\n\nlet loadLustList = function() {\n client.whiteList = get_variable('LustWhiteList') || client.whiteList;\n client.saveModel('LustWhiteList', client.whiteList);\n};\n\nclient.loadCustomSettings = function() {\n loadSystemSettings();\n loadAffSettings();\n loadDefTable();\n loadDefSettings();\n loadBalanceTable();\n loadCacheSettings();\n loadCureTable();\n loadLustList();\n};\n\nclient.saveCustomSettings = function() {\n saveModel('CustomSystemSettings', client.sys.settings);\n saveModel('CustomAffSettings', client.affTable);\n saveModel('CustomDefTable', client.defTable);\n saveModel('CustomDefSettings', client.defPrios);\n saveModel('CustomBalanceTable', client.balTable);\n saveModel('CustomCacheSettings', client.cacheTable);\n saveModel('CustomCureTable', client.cureTable);\n saveModel('LustWhiteList', client.whiteList);\n};\n\n\nclient.loadCustomSettings();"}]},{"type":"group","name":"highlights","enabled":true,"id":369,"items":[{"type":"trigger","name":"","enabled":true,"id":370,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Your paragon completely absorbs the damage.","actions":[{"action":"highlight","highlight":"match","highlight_backref":"1","highlight_fg":"#00ffb1","highlight_bg":"#000000"}]},{"type":"trigger","name":"","enabled":true,"id":371,"matching":"exact","whole_words":true,"case_sensitive":true,"text":"Your shield completely absorbs the damage.","actions":[{"action":"highlight","highlight":"match","highlight_backref":"1","highlight_fg":"#00ffb1","highlight_bg":"#000000"}]}]}]}