It looks like you're new here. If you want to get involved, click one of these buttons!
window.getInv = function() { return state.active.variables.inventory; } macros.initInv = { handler: function(place, macroName, params, parser) { state.active.variables.inventory = []; } }; macros.addToInv = { handler: function(place, macroName, params, parser) { if (params.length == 0) { throwError(place, "<<" + macroName + ">>: no parameters given"); return; } if (state.active.variables.inventory.indexOf(params[0]) == -1) { state.active.variables.inventory.push(params[0]); } } }; macros.removeFromInv = { handler: function(place, macroName, params, parser) { if (params.length == 0) { throwError(place, "<<" + macroName + ">>: no parameters given"); return; } var index = state.active.variables.inventory.indexOf(params[0]); if (index != -1) { state.active.variables.inventory.splice(index, 1); } } }; macros.inv = { handler: function(place, macroName, params, parser) { if (state.active.variables.inventory.length == 0) { new Wikifier(place, 'nothing'); } else { new Wikifier(place, state.active.variables.inventory.join(',')); } } }; macros.invWithLinks = { handler: function(place, macroName, params, parser) { if (state.active.variables.inventory.length == 0) { new Wikifier(place, 'nothing'); } else { new Wikifier(place, '[[' + state.active.variables.inventory.join(']]<br>[[') + ']]'); } } }; macros.emptyInv = { handler: function(place, macroName, params, parser) { state.active.variables.inventory = [] } }; var today = new Date(); var birthday = new Date('December 17, 1995 03:24:00'); var birthday = new Date('1995-12-17T03:24:00'); var birthday = new Date(1995, 11, 17); var birthday = new Date(1995, 11, 17, 3, 24, 0); var unixTimestamp = Date.now(); // in milliseconds new Date(); new Date(value); new Date(dateString); new Date(year, month[, day[, hour[, minutes[, seconds[, milliseconds]]]]]);
Comments
The last three lines in your example are invalid Javascript, this is causing an error, and this is why you are getting the <<initInv>> does not exist error message.
If you want/need to include information in your Story Javascript when you are working on code then you should wrap that text within a comment block /* */
Replace the last three lines of your example with the following and it should work again: