Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

AutoInitiative not working

1425059164

Edited 1425061161
Nick S.
Pro
Marketplace Creator
Translator
Hello! I've been using the following Auto Initiative script since I became a Mentor. For some reason though, it's not working on any of my campaigns today while all the rest function properly: <a href="https://app.roll20.net/forum/post/207066/script-au" rel="nofollow">https://app.roll20.net/forum/post/207066/script-au</a>... I'm using PowerCards, the Init script, isGM and TurnMarker. Any idea what may be happening? It's not throwing any errors, and last week they were all working fine, and nothing has changed on my side. Quick Edit: Using !CombatBegins nothing happens, but using !CombatEnds gives me this error: ReferenceError: MovementTracker is not defined at evalmachine.&lt;anonymous&gt;:574:17 at eval ( Edit2: After some more testing, disabling the PowerCards script made the AutoInit one work. But since I need it, for some reason putting the PowerCards script after the Initiative one on the API makes them both work. I am using a slightly older version of the powercards since I wasn't gonna change the format of every macro in all my monsters, but I never had this problem before.. weird. Thanks! Nick
I don't know what the version of PowerCards you're using looks like (or what the latest version looks like, for that matter), but the old version from the original thread doesn't play nicely with other scripts due to the following lines in its "chat:message" callback: msg.who = msg.who.replace(" (GM)", ""); msg.content = msg.content.replace("(GM) ", ""); Because all the callbacks get the same argument, and those lines alter that object, later callbacks get an altered object instead of the original. In your specific case, AutoInit is looking for "(GM)" in msg.who, but the first line above removes it. As a quick hack solution, you can cache the old values and replace them after the call to PowerCardScript.Process as follows: on("chat:message", function (msg) { // Exit if not an api command if (msg.type != "api") return; // Get the API Chat Command var oldWho = msg.who, oldContent = msg.content; msg.who = msg.who.replace(" (GM)", ""); msg.content = msg.content.replace("(GM) ", ""); var command = msg.content.split(" ", 1)[0]; if (command === "!power") { PowerCardScript.Process(msg); } msg.who = oldWho; msg.content = oldContent; if (command === "!power_version") { sendChat("HoneyBadger", "/w " + msg.who + " You are using version " + PowerCards_Version + " of this script.") } });
1425071209
Nick S.
Pro
Marketplace Creator
Translator
Awesome, I'm gonna try it out in a moment! The reason I still have the old one (should be the final v1 version) is that I alrerady have over 150 creatures with macros, and the new one changes the values somewhat and it has a weird result. So i'd need to change all of them. Thank you very much! I'll give it a try soon Nick
Incidentally, I just came across a post from HB when some of us were discussing this problem a few months back. He said that the script would probably work fine without those two problem lines, so you might be able to just comment them out if you prefer.
1425869533
Nick S.
Pro
Marketplace Creator
Translator
I forgot to come back to the post, but removing those lines seems to work! Thanks!