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

This API command is now broken

After the rollout the following API command is broken and it has been working perfectly fine for the past 3 months. It is a modification of Honeybadger's power card script. !power --ddn| --name|@{selected|token_name} @{WeaponType} --usage|@{Weapon} --action|Standard --attack|[[1d20+@{AttackBonus}+@{Proficiency}]] | [[1d20+@{AttackBonus}+@{Proficiency}]] --defense|AC --damage|[[@{Damage}+@{DamageBonus}]] --dmgtype|@{DamageType} --extradamage|[[@{ExtraDamage}]] --extradmgtype|@{ExtraDamage|max} --secondextradamage|[[@{SecondExtraDamage}]] --secondextradmgtype|@{SecondExtraDamage|max} AttackScript @{selected|token_id} Standard @{target|AC} @{target|token_id} I need some help. What has changed in the rollout to cause this to stop working? I keep getting this error message in the chat box: TypeError: undefined is not a function. It has something to do with the inline rolls. Has the syntax changed?
Okay so I have narrowed it down... It does not like this syntax for the inline roll: [[1d20+@{AttackBonus}+@{Proficiency}]] How does this now need to be written?
Callum, I'm not a code guy, but I know I had to go into the api settings for my campaign and re-save my scripts to "restart the sandbox" or whatever to get my scripts to work again after the update. But, it looks like a lot of api scripts are going to have to be updated or trashed due to the new character sheets. I even decided NOT to use the new character sheets in one of my campaigns because I've got a good system set up that doesn't need the extra work of the new character sheets. Until things get up to speed with the data delve updates, some of us may just have to pick and choose... I'm patient enough to wait on someone else to do the coding ;)
I have the character sheets disabled. (None selected) Can a Dev please explain to me what I need to alter in my macro to make it work? [[1d20+@{Strength}]] works fine While [[1d20+@{AttackBonus}]] Does not... Both attributes are defined on the character so I do not understand why this is happening.
What is AttackBonus defined as?
AttackBonus is simply another attribute the same as Strength AttackBonus is defined as a number eg 0, 1, 2, etc.. Strength is also defined as a number eg 0, 1, 2, etc... They are set up as attributes on the character sheet
A lot of my 'defined' attributes on my character's are not registering. Strength is fine while: AC, HP, AttackBonus, DamageBonus are all messed up. I have changed absolutely nothing in my macros or my API script. It's treating a lot of these attributes as 'undefined'
Also please note that I have deliberately disabled the new character sheet option in the campaign settings and I have selected 'none' to ensure that it is not causing any interference.
some people have had issues with duplicate attributes..might want to scroll through the list and see if there are more than one "AttackBonus" in the list.
I had a look... I cannot see any duplicates. I even created a new character using my character generator script and it has the same issues.
I have now noticed that all of my scripts are running in duplicate. Eg I cast a fireball and it does it twice.
i'm using that script and its working fine... I am however using @{selected|attribute} throughout the whole thing, based one what you posted you're only doing it on the first reference.
I just tried the @{selected|attribute} eg @{selected|AttackBonus} and it made no difference. It still tells me that the attribute is undefined through the same error: TypeError: undefined is not a function.
You must have changed something somewhere, cause my current power card script still functions just fine... and the players in the game I'm in on Saturday's have some complex power card macros built, with full @{attribute} linking.
I have not changed a thing Honeybadger. I might try and make a new campaign with my scripts transferred across and see what happens.
Not sure if my issue is related, but when I am in the API script window - i can start the sandbox etc and everything is fine. As soon as I Launch my campaign I get hit with a Unexpected identifier error and nothing works. I don't have any polling scripts - they are only called via macros and they just capture and modify attributes with flow control..
Still bugged :( I tried my scripts in a brand new campaign and I still receive the same error in the chat box even though the attributes are defined on the character. This was working perfectly before the update and has been for at least 3 months. I am at a loss at what to do.
Also on my original campaign everything is now duplicated. Whenever I use a script it is calling it twice.
I just did another test Riley. I made a brand new character where I manually inserted the attributes as shown in the picture below. Here is my macro: !power --ddn| --name|@{selected|token_name} @{WeaponType} --usage|@{Weapon} --action|Standard --attack|[[d20+@{AttackBonus}+@{Proficiency}]] | [[d20+@{AttackBonus}+@{Proficiency}]] --defense|AC --damage|[[@{Damage}+@{DamageBonus}]] --dmgtype|@{DamageType} --extradamage|[[@{ExtraDamage}]] --extradmgtype|@{ExtraDamage|max} --secondextradamage|[[@{SecondExtraDamage}]] --secondextradmgtype|@{SecondExtraDamage|max} AttackScript @{selected|token_id} Standard @{target|AC} @{target|token_id} Every single attribute is defined on the character using the macro above and yet it still gives me this error in the chatbox 'TypeError: undefined is not a function' This has been working without error for months. The update yesterday has done something and I cannot figure out how to make this work. I have even made a new campaign and the error persists.
1401369096

Edited 1401370344
I seem to recall something similar when I was working with character sheets on the Dev server. It happened when I had used an API to load values as numbers when they all need to be strings. I'm not sure how that would happen if you loaded the values manually. Also, I am now getting the same thing on the 3.5 sheet for several macros.The funny thing is, they are values that the sheet derives and are not the ones I've fed it. Examples are Grapple, Melee & Ranged rolls.
So the typeerror is happening client-side, not in the API console?
1401403023

Edited 1401403929
Correct. It is in the client side, not the API. I should have made this more clear in the original post. My title is a little misleading. It's the macro command that is broken, the API is fine.
Okay, I have a bit of a complicated thing for you to do but if you can do it it will help tremendously. Load up your game, then open up your error console. It should be in a mode where you can "type" commands into the console. Then type this: window.logRolls = true; and press Enter. It will say "true". Then do your roll as normal, and you will see some additional logging info in your console where it goes through each step of how it's translating your variables into numbers and whatnot. Paste all that in here and I can see more about what it's doing that's causing the error, hopefully.
I opened up the error console (I think) and I typed in the command as you have requested. It printed the word 'true' in the output. I then used the macro and it came up with the usual error 'TypeError: undefined is not a function' but it gave me no further output in the error console. My error console did have 2 errors before I did this though. Here is a full copy of the console (I assume that this is the error console that you are talking about?): TB.setLogLevel(5) <a href="http://www.tokbox.com/opentok/webrtc/docs/js/release-notes.html" rel="nofollow">http://www.tokbox.com/opentok/webrtc/docs/js/release-notes.html</a> <a href="http://www.tokbox.com/opentok/webrtc/docs/js/release-notes.html#knownIssues" rel="nofollow">http://www.tokbox.com/opentok/webrtc/docs/js/release-notes.html#knownIssues</a> <a href="https://app.roll20.net/editor/" rel="nofollow">https://app.roll20.net/editor/</a> ' was loaded over HTTPS, but displayed insecure content from ' <a href="http://www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png" rel="nofollow">http://www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png</a> ': this content should also be loaded over HTTPS. app.roll20.net/:1 init active page! <a href="https://app.roll20.net/editor/" rel="nofollow">https://app.roll20.net/editor/</a> ' was loaded over HTTPS, but displayed insecure content from ' <a href="http://www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png" rel="nofollow">http://www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png</a> ': this content should also be loaded over HTTPS. app.roll20.net/:1 initiatlizing video chat <a href="https://app.roll20.net/editor/" rel="nofollow">https://app.roll20.net/editor/</a> ' was loaded over HTTPS, but displayed insecure content from ' <a href="http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=55" rel="nofollow">http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=55</a> ': this content should also be loaded over HTTPS. app.roll20.net/:1 8The page at ' <a href="https://app.roll20.net/editor/" rel="nofollow">https://app.roll20.net/editor/</a> ' was loaded over HTTPS, but displayed insecure content from ' <a href="http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=555" rel="nofollow">http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=555</a> ': this content should also be loaded over HTTPS. app.roll20.net/:1 9The page at ' <a href="https://app.roll20.net/editor/" rel="nofollow">https://app.roll20.net/editor/</a> ' was loaded over HTTPS, but displayed insecure content from ' <a href="http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=5555" rel="nofollow">http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=5555</a> ': this content should also be loaded over HTTPS. app.roll20.net/:1 The page at ' <a href="https://app.roll20.net/editor/" rel="nofollow">https://app.roll20.net/editor/</a> ' was loaded over HTTPS, but displayed insecure content from ' <a href="http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=555" rel="nofollow">http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=555</a> ': this content should also be loaded over HTTPS. app.roll20.net/:1 9The page at ' <a href="https://app.roll20.net/editor/" rel="nofollow">https://app.roll20.net/editor/</a> ' was loaded over HTTPS, but displayed insecure content from ' <a href="http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=5555" rel="nofollow">http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=5555</a> ': this content should also be loaded over HTTPS. app.roll20.net/:1 The page at ' <a href="https://app.roll20.net/editor/" rel="nofollow">https://app.roll20.net/editor/</a> ' was loaded over HTTPS, but displayed insecure content from ' <a href="http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=555" rel="nofollow">http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=555</a> ': this content should also be loaded over HTTPS. app.roll20.net/:1 9The page at ' <a href="https://app.roll20.net/editor/" rel="nofollow">https://app.roll20.net/editor/</a> ' was loaded over HTTPS, but displayed insecure content from ' <a href="http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=5555" rel="nofollow">http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=5555</a> ': this content should also be loaded over HTTPS. app.roll20.net/:1 The page at ' <a href="https://app.roll20.net/editor/" rel="nofollow">https://app.roll20.net/editor/</a> ' was loaded over HTTPS, but displayed insecure content from ' <a href="http://imgsrv.roll20.net:5100/?src=&cb=5" rel="nofollow">http://imgsrv.roll20.net:5100/?src=&cb=5</a> ': this content should also be loaded over HTTPS. app.roll20.net/:1 The page at ' <a href="https://app.roll20.net/editor/" rel="nofollow">https://app.roll20.net/editor/</a> ' was loaded over HTTPS, but displayed insecure content from ' <a href="http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=555" rel="nofollow">http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=555</a> ': this content should also be loaded over HTTPS. app.roll20.net/:1 The page at ' <a href="https://app.roll20.net/editor/" rel="nofollow">https://app.roll20.net/editor/</a> ' was loaded over HTTPS, but displayed insecure content from ' <a href="http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=5555" rel="nofollow">http://imgsrv.roll20.net:5100/?src=www.dundjinni.com/forums/uploads/Kepli/A2B_Flare_KPL-c.png&cb=5555</a> ': this content should also be loaded over HTTPS. app.roll20.net/:1 Swapping <a href="https://s3.amazonaws.com/files.d20.io/marketplace/11238/jNF7baVz-InJXd78zDCRDA/thumb.png?13619279035" rel="nofollow">https://s3.amazonaws.com/files.d20.io/marketplace/11238/jNF7baVz-InJXd78zDCRDA/thumb.png?13619279035</a> to <a href="https://s3.amazonaws.com/files.d20.io/marketplace/11238/jNF7baVz-InJXd78zDCRDA/max.png?13619279035" rel="nofollow">https://s3.amazonaws.com/files.d20.io/marketplace/11238/jNF7baVz-InJXd78zDCRDA/max.png?13619279035</a> <a href="https://s3.amazonaws.com/files.d20.io/marketplace/11238/jNF7baVz-InJXd78zDCRDA/med.png?136192790355" rel="nofollow">https://s3.amazonaws.com/files.d20.io/marketplace/11238/jNF7baVz-InJXd78zDCRDA/med.png?136192790355</a> to <a href="https://s3.amazonaws.com/files.d20.io/marketplace/11238/jNF7baVz-InJXd78zDCRDA/max.png?136192790355" rel="nofollow">https://s3.amazonaws.com/files.d20.io/marketplace/11238/jNF7baVz-InJXd78zDCRDA/max.png?136192790355</a> <a href="https://s3.amazonaws.com/files.d20.io/marketplace/11238/jNF7baVz-InJXd78zDCRDA/med.png?1361927903555" rel="nofollow">https://s3.amazonaws.com/files.d20.io/marketplace/11238/jNF7baVz-InJXd78zDCRDA/med.png?1361927903555</a> to <a href="https://s3.amazonaws.com/files.d20.io/marketplace/11238/jNF7baVz-InJXd78zDCRDA/max.png?1361927903555" rel="nofollow">https://s3.amazonaws.com/files.d20.io/marketplace/11238/jNF7baVz-InJXd78zDCRDA/max.png?1361927903555</a> <a href="https://s3.amazonaws.com/files.d20.io/marketplace/24474/y01t5ytuvuq6k5xJ_l12CQ/max.png?13759711945" rel="nofollow">https://s3.amazonaws.com/files.d20.io/marketplace/24474/y01t5ytuvuq6k5xJ_l12CQ/max.png?13759711945</a> to <a href="https://s3.amazonaws.com/files.d20.io/marketplace/24474/y01t5ytuvuq6k5xJ_l12CQ/thumb.png?13759711945" rel="nofollow">https://s3.amazonaws.com/files.d20.io/marketplace/24474/y01t5ytuvuq6k5xJ_l12CQ/thumb.png?13759711945</a> <a href="https://app.roll20.net/editor/" rel="nofollow">https://app.roll20.net/editor/</a> ' was loaded over HTTPS, but displayed insecure content from ' <a href="http://imgsrv.roll20.net:5100/?src=&cb=5" rel="nofollow">http://imgsrv.roll20.net:5100/?src=&cb=5</a> ': this content should also be loaded over HTTPS. app.roll20.net/:1 Image from origin ' <a href="http://imgsrv.roll20.net:5100" rel="nofollow">http://imgsrv.roll20.net:5100</a> ' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' <a href="https://app.roll20.net" rel="nofollow">https://app.roll20.net</a> ' is therefore not allowed access. app.roll20.net/:1 Failed to load resource: the server responded with a status of 503 (Service Unavailable) <a href="http://imgsrv.roll20.net:5100/?src=&cb=5" rel="nofollow">http://imgsrv.roll20.net:5100/?src=&cb=5</a> Cols: 2 Rows: 2 app.js?1401382307:21 Took 89ms to generate cache. app.js?1401382307:21 Cols: 2 Rows: 2 app.js?1401382307:21 Took 3ms to generate cache. app.js?1401382307:21 Cols: 2 Rows: 2 app.js?1401382307:21 Took 82ms to generate cache. app.js?1401382307:21 Error loading image, probably due to cors. Trying once without CORS for app.js?1401382307:22 29Updating character sheet values app.js?1401382307:29 Reorder by ZORDER app.js?1401382307:26 49Updating character sheet values app.js?1401382307:29 Connected to session app.js?1401382307:33 Someone just connected. app.js?1401382307:33 It's us? app.js?1401382307:33 window resize app.js?1401382307:35 UPDATE GL SIZE! app.js?1401382307:23 6Reorder by ZORDER app.js?1401382307:26 window resize app.js?1401382307:35 UPDATE GL SIZE! app.js?1401382307:23 window resize app.js?1401382307:35 UPDATE GL SIZE! app.js?1401382307:23 window resize app.js?1401382307:35 UPDATE GL SIZE! app.js?1401382307:23 window.logRolls = true; true Notice the line "Failed to load resource:" Does this have something to do with my problem?
Screenshot:
It looks like the error is just an image file failing to load. Am I in the right console Riley? It made no output when I clicked the macro and received the error.
I think you did it right but apparently this isn't going to help as much as I thought. Where's the Typeerror: undefined is not a function line in your console log output that you pasted?
There was no output in the error console, only in the chatbox. The screenshot that I posted above has the error showing in the chatbox but it is not in the error console. When I click on other macros that are working I receive information in the console.
Any news on this Riley?
1401587147

Edited 1401588499
Riley D.
Roll20 Team
Just now back at the computer since last time I posted, due to the weekend. As far as I can tell this isn't a regression in general in our code, so it must be something going on with your specific campaign. Can you give me a link to the campaign it's happening in? I'll hop in and promote myself to GM and see if I can figure out what's going on. Also you mentioned further up-thread that you had it narrowed down to this not working: [[1d20+@{Strength}]] works fine While [[1d20+@{AttackBonus}]] Does not... Is that still a simple test-case to reproduce the error? If we don't have to worry about the API script that will greatly speed up my ability to figure out what the issue is.
I will send you a pm with the link Riley.
1401593769

Edited 1401593795
Riley D.
Roll20 Team
Should be fixed now. Thanks! (Reload if you're already in-game).
That was fast! Thanks Riley. It is working again.