Greetings Code Wizards, I'm attempting to create a first person dungeon experience in roll20 as a project to learn Java. So far, I've been able to stand on the shoulders of others and cobble together some code that will track translation and rotation values when changed (see code below). My issue is two fold, I'm having trouble changing the side of a token from a rollable table via the API. I've tried sendChat for "token mod" and from what I've read It requires a user to submit the command and also have the token selected. The other issue is that I need it to work with a named token rather than whats selected. So I humbly ask, would any of you masters of the code arts know of a solution? (here's the debug UI I made) //Purpose of script: To store the location information of players in a 2D plane, including rotation. //This is the base to have a simple first person dungeon expereience // create var to contain Translation X Values if( ! state.mapTranslationX ) { state.mapTranslationX = { version: 1.0, config: { color1: '#ff0000', color2: '#0000ff' }, count: 0 }; } // Create var to contain Rotation Values if( ! state.mapRotation ) { state.mapRotation = { version: 1.0, config: { color1: '#ff0000', color2: '#0000ff' }, count: 0 }; } // Once code is working, will add Translation Y (though it really should be X and the other Y...) //activate functions using chat command for macro ease on("chat:message", function(msg) { if (msg.type == "api" && msg.content.indexOf("!MoveMapScript") == 0){ var args = msg.content.split(/\s+/); var direction = args[1].toLowerCase(); switch(direction){ case "forward": forward(); break; case "backward": backward(); break; case "right": right(); break; case "left": left(); break; } //sendChat("API",`Did the if statement`); } }); function forward(){ sendChat("GOD", 'Started Forward'); sendChat('FORWARD', (++state.mapTranslationX.count)+' times!' ); //Use Token Mod to change side of token in rollable table. sendChat('', "!token-mod --set currentside|+"); } function backward(){ sendChat("GOD", 'Started Backward'); //Use Token Mod to change side of token in rollable table. sendChat('', "!token-mod --set currentside|-"); sendChat('BACKWARD', (--state.mapTranslationX.count)+' times!' ); } function right(){ sendChat("GOD", 'Started Right') if (state.mapRotation.count <= 3){ sendChat('RIGHT', (++state.mapRotation.count)+' times!' ); } else { sendChat('RIGHT JUMP TO 1', (state.mapRotation.count = 1)+' times!' ); }; } function left(){ sendChat("GOD", 'Started Left') if (state.mapRotation.count >= 2){ sendChat('LEFT', (--state.mapRotation.count)+' times!' ); } else { sendChat('LEFT JUMP TO 4', (state.mapRotation.count = 4)+' times!' ); }; } The way it would work is that I have a series of rollable tokens for the three rings shown in the image. One for the ceiling, one for the floor, one for front facing wall, and finally two for the sides. The tables would cycle depending on the x, y, and rot values. As far as the test right now Im just trying to get progression down a hallway and the ability to turn around. Thank you!