diff --git a/module/mosh.js b/module/mosh.js index 6296b79..f04da11 100644 --- a/module/mosh.js +++ b/module/mosh.js @@ -65,12 +65,31 @@ Hooks.once('init', async function () { return outStr; }); - Handlebars.registerHelper('toLowerCase', function (str) { return str.toLowerCase(); }); + + Handlebars.registerHelper('compare', function (varType, varOne, comparator, varTwo) { + if (varType === 'str') { + if (eval('"' + varOne + '"' + comparator + '"' + varTwo+ '"')) { + return true + } else { + return false + } + } else if (varType === 'int') { + if (eval(varOne + comparator + varTwo)) { + return true + } else { + return false + } + } + }); + }); + + + Hooks.once("ready", async function () { // Wait to register hotbar drop hook on ready so that modules could register earlier if they want to Hooks.on("hotbarDrop", (bar, data, slot) => createMothershipMacro(data, slot));