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

Script Syntax Error: Unexpected Identifier

I've got two scripts I'm running at the moment. When each is enabled on its own, it runs fine, no problem.
When I enable both scripts I get "Syntax error: Unexpected identifier."
I think it has something to do with how I'm activating the scripts (both via chat messages). I copied that part of my script from Warklaw's script here: https://github.com/Warklaw/roll20/blob/master/roll...
I've tried everything I can think of with my limited knowledge so I'm turning to you guys now. How can I get these scripts to play nice with each other?
Critical Script: https://gist.github.com/GoCorral/1297d794e80e78f62...
Melee Fumble Script: https://gist.github.com/GoCorral/9240004810d0667c5..
June 15 (9 years ago)
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I don't have enough experience to help, but wanted to let you know that your links to the critical and fumble scripts give page 404 errors.
Ah... That would be a problem. Let me sort that out.
June 15 (9 years ago)
The Aaron
Pro
API Scripter
Put a semicolon at the end of the Critical Script, or the beginning of the Melee Fumble script.

The API Server concatenates all the scripts together, which can lead to code that isn't correct when a programmer relies on automatic semicolon insertion.   When these two are getting concatenated, you end up with:
/* The rest of Critical Script... */

return;}});
var trimString = function(src) {
    return src.replace(/^\s+|\s+$/g, '');}on('chat:message', function(mel) {
    var cmdNam;
    var msgtxt;

/* The rest of Melee Fumble Script... */
Note the underlined characters in the above, which are invalid.

The links should be working now.
Thanks Aaron! Works perfectly now.
June 16 (9 years ago)
The Aaron
Pro
API Scripter
No problem!  =D