I have been using this script for months without a problem, now in every campaign I use it in, it crashes as soon as it loads... The script modifies the bar1 and is used to track hit points, as I stated nothing has been altered and the script no longer works... The script was originally created by Honey Badger... -Ajax // USER CONFIGURATION // Set the PREVENT_OVERMAX variable to true to prevent the value of a // token's bar from being greater than its max value. If there is no max // value set, it will not stop the current bar value from increasing. var PREVENT_OVERMAX = true; // Set the ANNOUNCE_CHANGE variable to true to send a message to the chat // window, announcing which token gained or lost points on a bar. var ANNOUNCE_CHANGE = true; // Stops the bar at zero instead of allowing it to go negative. var STOP_AT_ZERO = true; // BAR CONFIGURATION - These are used to identify which bar to adjust. The // example below was made for a specific Roll20 user's preferences. These // bar keys must be lowercase, though players can use any case in their // macro since the script converts everything to lower case. var Bar1Key = "h"; // (H)ealth var Bar2Key = "f"; // (F)atigue var Bar3Key = "m"; // (M)ana // BAR NAMES - These names are used if ANNOUNCE_CHANGE is set to true. The // format of the annoucement is: Name gained/lost # BarName. var BarNames = ["hit points", "fatigue", "mana"]; on("chat:message", function(msg) { // Exit if not an api command if (msg.type != "api") return; // Get the API Command msg.who = msg.who.replace(" (GM)", ""); msg.content = msg.content.replace("(GM) ", ""); var n = msg.content.split(" "); var command = n[0].toLowerCase(); // CSS Stuff... // Target.get("name") + " lost <span title='" + Expression + "' class='a inlinerollresult showtip tipsy-n'" + var AddStyle = "display: inline-block; text-align: center; min-width: 1.75em; font-size: 1em; font-weight: bold; color:#040; background-color: #8C8; border: 1px solid #040; padding: -1px 2px; border-radius: 3px;"; var MinusStyle = "display: inline-block; text-align: center; min-width: 1.75em; font-size: 1em; font-weight: bold; color:#600; background-color: #FAA; border: 1px solid #600; padding: -1px 2px; border-radius: 3px;"; if (command == "!alter") { // Define variables... var Target = getObj("graphic", n[1]); var Bar = 0; Bar = (n[2].toLowerCase() == Bar1Key) ? 1 : 0; Bar = (n[2].toLowerCase() == Bar2Key) ? 2 : Bar; Bar = (n[2].toLowerCase() == Bar3Key) ? 3 : Bar; if (Bar == 0) { sendChat("ERROR", "/w " + msg.who + " That is not a valid bar. Please use the first letter as follows: H(ealth), F(atigue), or M(ana)."); return; } var AlterValue = n[3]; var TargetBarCurrent = parseInt(Target.get("bar" + Bar + "_value")); var TargetBarMax = parseInt(Target.get("bar" + Bar + "_max")); var StartingValue = TargetBarCurrent; // Check for a + or - sign at the start of the AlterValue... var OperandCheck = AlterValue.charAt(0); var DoubleOperandCheck = AlterValue.charAt(1); if (DoubleOperandCheck === "+" || DoubleOperandCheck === "-") { AlterValue = AlterValue.substring(2); } else if (OperandCheck === "+" || OperandCheck === "-") { AlterValue = AlterValue.substring(1); } var Expression = AlterValue; if (AlterValue.indexOf("d") != -1) { sendChat("", "/r " + AlterValue, function(outs) { AlterValue = parseInt(JSON.parse(outs[0].content).total); var Tooltip = "Rolling " + Expression + " = " + AlterValue + "' class='a inlinerollresult showtip tipsy-n'"; if (OperandCheck != "-") { // ADD TO BAR if (PREVENT_OVERMAX) { AlterValue = (AlterValue + TargetBarCurrent > TargetBarMax) ? TargetBarMax - TargetBarCurrent : AlterValue; } Target.set("bar" + Bar + "_value", TargetBarCurrent += AlterValue); if (ANNOUNCE_CHANGE) sendChat("", Target.get("name") + " gains <span title='" + Tooltip + "' style='" + AddStyle + "'>" + AlterValue + "</span> " + BarNames[Bar-1] + "."); } else { // SUBTRACT FROM BAR if (STOP_AT_ZERO && (TargetBarCurrent - AlterValue < 0)) { AlterValue = TargetBarCurrent; } Target.set("bar" + Bar + "_value", TargetBarCurrent -= AlterValue); if (ANNOUNCE_CHANGE) sendChat("", Target.get("name") + " lost <span title='" + Tooltip + "' style='" + " ' style='" + MinusStyle + "'>" + AlterValue + "</span> " + BarNames[Bar-1] + "."); } }); } else { AlterValue = parseInt(AlterValue); var Tooltip = "Rolling " + Expression + " = " + AlterValue + "' class='a inlinerollresult showtip tipsy-n'"; if (OperandCheck != "-") { // ADD TO BAR if (PREVENT_OVERMAX) { AlterValue = (AlterValue + TargetBarCurrent > TargetBarMax) ? TargetBarMax - TargetBarCurrent : AlterValue; } Target.set("bar" + Bar + "_value", TargetBarCurrent += AlterValue); if (ANNOUNCE_CHANGE) sendChat("", Target.get("name") + " gains <span title='" + Tooltip + "' style='" + AddStyle + "'>" + AlterValue + "</span> " + BarNames[Bar-1] + "."); } else { // SUBTRACT FROM BAR if (STOP_AT_ZERO && (TargetBarCurrent - AlterValue < 0)) { AlterValue = TargetBarCurrent; } Target.set("bar" + Bar + "_value", TargetBarCurrent -= AlterValue); if (ANNOUNCE_CHANGE) sendChat("", Target.get("name") + " lost <span title='" + Tooltip + "' style='" + MinusStyle + "'>" + AlterValue + "</span> " + BarNames[Bar-1] + "."); } } } });