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

[Bug/Help] Ghost Script

I do not know what exactly is happening to cause this, but I have what I can only call as a "ghost script" running in the background. Its a previous copy of code I used for my Level of Difficulty script. I noticed this when one of my players started rolling the dice and this script ran twice. I even disabled my scripts and a "Ghost copy" of code is running in the background. So the output should just have one copy but instead I am getting this: Difficulty achieved: Zen (440) Warning: Physical actions require Zen(440+) and Inhumanity (320+) Zen (440) Warning: Physical actions require Zen(440+) and Inhumanity (320+) As you can tell from the following code, there is no reason why I should be getting two outputs. And remember: if I disable all 3 of my scripts, I still get the ouput as if something is running. //Simple level of difficulty announcer. Will look at the roll and declare //the level of difficulty achieved. GM Rolls should be always private. on("chat:message", function(msg){ //Optional: the ability to trigger between announcing public rolls to the GM //and announcing to the public. var LOD_privMsg = false; var LOD_gmOnly = false; if(msg.type == "rollresult" || msg.type == "gmrollresult"){ //log("Parsing the roll"); var rollMsg = JSON.parse(msg.content); if(rollMsg.rolls[0].dice>1 || rollMsg.rolls[0].table != null || msg.content.indexOf("initiative") !== -1 || msg.content.indexOf("Initiative") !== -1 ) return; //So mass rolls and tables aren't confused. //log("Message is a roll"); var total = rollMsg.total; //Total roll var type = rollMsg.rolls[0].sides; //Number of sides var out = ""; //The LoD reached var warning = ""; //A warning on the message if there is any (like limits) //Part 1: get roll result (Future Function) if(type == 100){//d100 //log("Message is a d100"); //log("D100 roll: "+total); if(total<20) out = "Failure"; else if(total<40) out = "Routine (20)"; else if(total<80) out = "Easy (40)"; else if(total<120) out = "Medium (80)"; else if(total<140) out = "Difficult (120)"; else if(total<180) out = "Very Difficult (140)"; else if(total<240) out = "Absurd (180)"; else if(total<280) out = "Almost Impossible (240)"; else if(total<320) out = "Impossible (280)"; else if(total<440){ out = "Inhuman (320)"; warning = "Warning: Physical actions require Inhumanity(320+)"; } else{ out = "Zen (440)"; warning = "Warning: Physical actions require Zen(440+) and Inhumanity (320+)"; } if(msg.content.indexOf("attack") !== -1 || msg.content.indexOf("Attack") !== -1 || msg.content.indexOf("Defense") !== -1 || msg.content.indexOf("defense") !== -1) out = ""; //These keywords used for other macros //log("Got total"); } else if(type == 10){//d10 //log("Message is a d10"); if(rollMsg.rolls[0].results[0].v == 10){ total = total+2; warning = "Notice: Real total is "+total.toString()+" (a 10 counts as a 12)"; } //log("D10 roll: "+total); if(total<6) out = "Failure"; else if(total<10) out = "Simple Actions (6+)"; else if(total<15) out = "Normal Actions (10+)"; else if(total<20) out = "Complex Actions (15+)"; else out = "Extreme Actions (20+)"; //log("Got total"); } else{ //log("it is a dice roll, but I am doing nothing"); return; //Do nothing } if (out != "") log("Output: "+out); if (warning != "") log("Warning: "+warning); if(msg.type == "gmrollresult" || LOD_gmOnly){ if(out != "") out = "/w gm "+out; if(warning != "") warning = "/w gm "+warning; } else if(LOD_privMsg){ if(out != "") out = "/w "+msg.who+" "+out; if(warning!= "") warning = "/w "+msg.who+" "+warning; } //Part 2: Output Result as chat message (Future function) if(out != ""){ sendChat("Difficulty achieved", out); } if (warning != ""){ sendChat("Difficulty achieved",warning); } } //log("Message is not a roll"); return; });
1406692909
The Aaron
Roll20 Production Team
API Scripter
Look to see if you have a tab with no name in the API Scripts. It will show up as an extra wide gap between two script names. When you hover over it, you'll get an outline for a tab. Click it and delete it.
1406692977
The Aaron
Roll20 Production Team
API Scripter
I've brought this up as a bug already, feel free to chime in: <a href="https://app.roll20.net/forum/post/982231/suggesti" rel="nofollow">https://app.roll20.net/forum/post/982231/suggesti</a>...
1406694994

Edited 1406695148
J.A.
Pro
Actually I can honestly and 100% say this is a different bug. I searched "between" each of my scripts and there was no extra-wide gap: So to show it, here is my problem in picture: To further this, let me disable all 3 of those: As you can tell all of my APIs should be disabled (read the blue text and the output box) After I go in and roll a /1d100+500 This is after I disable all of my scripts. The console output is above: If you can read the console output, it is saying I can not load my API due to no scripts being loaded. It also says it in the blue text about how everything I have is disabled. So then, as far as I can tell I have a "ghost script" running in the background. Just to be sure I had everyone leave the game until the message about campaign inactivity showed up. The "ghost script" still ran.
1406695948
The Aaron
Roll20 Production Team
API Scripter
Weird! I'd love to help you fix that... if I had any idea how... I think this is one that Riley will have to look at.
I log on today after 1 night of not using it and the whole problem seems to be fixed. I guess the server went under some reboot since yesterday. Well thanks for your input, Aaron. I will post here again if it shows up once more.
1406748935
The Aaron
Roll20 Production Team
API Scripter
Cool! No problem!