Hi, I'm a coder but never worked with JS and getting this script working is driving me mad. It's simply meant to detect the !wandering command, then parse the level number from page name ("Level 1: Dungeon Level" -> "1") and send to chat "!rtm WM" + LevelNb. Rollable Table Macros will then handle rolling on the correct wandering monster table for that page. However, every time I send the !wandering command, the API errors out. Any advice would be great, thanks. var WanderingMonster = WanderingMonster || ( function() { 'use strict'; var commandListener = function() { // Listens for API command on( 'chat:message', function( msg ) { if( msg.type === 'api' && !msg.rolltemplate ) { if( command === 'wandering' ) { var currentPageID = Campaign().get('playerpageid') , currentPage = getObj( 'page' , currentPageID ) , pageName = currentPage.get('name') , pageNumber = pageName.substring( 7 , pageName.search(':') - 1); sendChat( 'WM', '!rtm WM' + pageNumber ); } } }); }; return { CommandListener: commandListener }; }()); on( 'ready', function(){ 'use strict'; WanderingMonster.CommandListener(); });