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 post has been closed. You can still view previous posts, but you can't post any new replies.

[Script] PowerCards 2 (Thread 2)

Hmmm... Has it all worked for your previously? As in, did your PowerCards work before this past weekend?
Ooooooooooooooooooooooooh.... that very last sentence you made would have helped awhile ago... So, you're on the Dev server having issues?
1430286085

Edited 1430286213
last I know for sure they worked was April 26th, at 20:50 eastern time. I have a campaign i have set up for testing macros for Shadowrun (i tend to break the api a lot) if anyone wants to join it and check this issue out. Link is <a href="https://app.roll20dev.net/join/35639/JyCHkw" rel="nofollow">https://app.roll20dev.net/join/35639/JyCHkw</a> and yes. on the Dev server, Thought I said it before, trying to deal with this mid game :)
Well, you had mentioned a different problem on Dev. I guess I just don't assume that's where this particular problem was, I guess.... :)
I tested a different script, wild dice, since it has inline rolls as well, and it seems to work fine.
1430289165
vÍnce
Pro
Sheet Author
I'm experiencing the same issue as Azul on the Dev. It appears that something between inline rolls in powercards and the API on the Dev causes the entire powercard to break. Test macro; !power --name|Test [[1d20]] results in; API: Console log for the macro: app.js?1430240454:40 Finished after going 2 levels deep. app.js?1430240454:40 Begin processing op! app.js?1430240454:40 Started one at 19 app.js?1430240454:40 Found end of an inline roll at 26 app.js?1430240454:40 Inline roll index: 0 app.js?1430240454:40 Levels deep: 0 app.js?1430240454:40 [[1d20]] app.js?1430240454:40 1d20 app.js?1430240454:40 Levels deep: 0 app.js?1430240454:40 !power --name|Test $[[0]] app.js?1430240454:40 Started one at 20 app.js?1430240454:40 Found end of an inline roll at 24 app.js?1430240454:40 !power --name|Test $[[0]] app.js?1430240454:40 Finished -Jo2rLEXTM_Tr2blThnt for index 0 app.js?1430240454:40 Finished 0 app.js?1430240454:40 Levels deep: 0 app.js?1430240454:40 !power --name|Test $[[0]] app.js?1430240454:40 Inline rolls complete! app.js?1430240454:44 remote Roll!
Blargh... unfortunately I will not be able to look at this deeply until Thursday at the earliest since I have a face to face D&D game to run at 4pm on Wednesday (today). I will take a quick look at it this morning when I get home though, before I go to sleep. Can't promise a quick fix though. Also, if would help if everyone makes sure they're using the most recent version of powercards. Thanks.
I am getting timestamps (and my name) showing up where they did not before. Is there a way to turn this off? The built in timestamps checkbox turns them off for normal chat but the powercards still have the time (and name).
1430308478
Gen Kitty
Forum Champion
If you go into the script and scroll down a little, there's a listing of things you can set true/false, and timestamps will be listed there.
Sorry, I have a habit of leaving it on in my campaign and forgetting to set it back to false before I update the gist.
:update: everything appears to be working again on the dev server. No official post on a second update to the API but i can only guess the problem was on their side of things. Thanks for everyone trying to help out on this.
1430322996
The Aaron
Pro
API Scripter
They commented that it has been fixed in the bug thread: <a href="https://app.roll20.net/forum/post/1890852/power-ca" rel="nofollow">https://app.roll20.net/forum/post/1890852/power-ca</a>... =D
Yay. :D
1430330659

Edited 1430330979
and another question (wow i'm starting to feel like a pest). Is it possible to take the value of a roll from one tag and insert it into another tag ? If i wanted --Tag1| [[2d6]] --Tag2| [[4d6]] --Tag3| [[value of tag1 - value of tag2]] for example. I can give the exact macro i'm working with if needed. If not I think i can do a work around with nesting additional macros.
Not at the moment. It may be an option in the next major update to powercards, when I have time to complete it.
nice! And thanks for all the hard work, has to be one of my favorite APIs out there.
April 29th, 2015 ~ 2:40 pm eastern Version: 2.4.14 Minor Update: Text in custom emotes will wrap around the token/avatar. Minor Update: Removed italics formatting from custom emotes.
GenKitty said: If you go into the script and scroll down a little, there's a listing of things you can set true/false, and timestamps will be listed there. Thank you!
1430349754

Edited 1430349827
vÍnce
Pro
Sheet Author
Anyone else able to see 3d dice on the Dev or Production server with powercards using inline rolls? Nada for me.
Production hasn't shown the 3d dice with PowerCards since they did an update like 2 months ago. I don't know if it was ever fixed, but I know that as of Saturday (when my campaign last played), there were no dice.
1430366568
vÍnce
Pro
Sheet Author
Thanks Sean. I've been running on the Dev for quite a while and just never noticed if it was working on the Prodection. Neither are working with 3d dice right now...
API commands no longer trigger 3D dice.
1430367118

Edited 1430367863
vÍnce
Pro
Sheet Author
HoneyBadger said: API commands no longer trigger 3D dice. Ouch. That sucks. When did that happen? We played last week... I think, and the 3d were working fine with powercards on the Dev. Now I'm not sure if I had 3d dice or not... damn.
I put a bug report in for the 3D dice not working in conjunction with nested inline rolls, it may be related.
Just fyi... PowerCards 3 will most likely not be compatible with 3D dice unless Riley adds a way for the API to trigger them. This is due to the way that I am having to alter the script to add conditional statements for showing/hiding content.
1430450533
Gen Kitty
Forum Champion
Understood, and accepted.
Weighing the possibility of 3D dice against conditional modifiers, I'll take the conditional modifiers every time...
they have 3d dice?
1430506167
Gen Kitty
Forum Champion
They did, at some point. I banned 3d dice in my campaign because --whisper|gm was showing the dice to the person who rolled. And then API stopped showing the dice at all.
1430509509
Gen Kitty
Forum Champion
Bug Alert : You need to make sure to put a space between [[ and [NH] or your powercard will fail in a variety of exciting and obscure ways! BAD: [[[NH]3d6+1]] GOOD: [[ [NH]3d6+1]] I was tearing my hair out trying to find the error. x.x
1430510694
Gen Kitty
Forum Champion
Issue: ~L not being honored in the custom emote I was hoping to use ~L to force the custom emote text to left align instead of center.
GenKitty said: Issue: ~L not being honored in the custom emote I was hoping to use ~L to force the custom emote text to left align instead of center. I'll add justify as well when I get around to fixing this.
1430534377
vÍnce
Pro
Sheet Author
GenKitty said: Bug Alert : You need to make sure to put a space between [[ and [NH] or your powercard will fail in a variety of exciting and obscure ways! BAD: [[[NH]3d6+1]] GOOD: [[ [NH]3d6+1]] I was tearing my hair out trying to find the error. x.x Exciting and obscure... Interesting.
1430536255
Gen Kitty
Forum Champion
Whyyyyy? It's supposed to show: [[1d20cf&lt;3ro20 + @{Silva|Double}[NormalBonus] +?{PointBlank?|1}[PB] +?{MiscToHitBonus?|0}[MiscHitBonus] ]] Is this a powercards issue, or a roll20 issue?
1430539503

Edited 1430540072
PowerCards. I set it as a straight inline roll in the system, and showed fine. The issue its having is with the less than sign. If you reorganize or delete ro20, it still cuts off after cf. It still works, however.
1430540685

Edited 1430540869
Gen Kitty
Forum Champion
Meh, yes, I remember now. Next version of the card will be something like: [[1d20cf&lt;[[?{MaxMisfire (+1 if Paper)|2}]]ro20]] -- Testing it now, actually ... While the card works, I'm still getting the same error. I /need/ to be able to do 'cf&lt;3' as part of the string, dammit, because sometimes the CF is 3. Grf grf grf. :&gt;
The roll still works that is. So, if you set it to cf&lt;15, rolls of 15 or less will highlight red. The tooltip is just messed up.
1430541510
Gen Kitty
Forum Champion
Yeah, but getting the tooltip to be less messed up is the goal :/
I know. :) -- been looking through the code to see where it might need to be altered. Wish I was better than I am.
1430566589

Edited 1430566704
Blargh... I can't recall anything I have changed recently that would be causing this issue. &gt;_&lt; Unfortunately this is my weekend to work three days in a row... so I won't have any real free time until Monday.
1430581839
The Aaron
Pro
API Scripter
GenKitty, can you post a minimal repeatable case, I'll be in a coffee shop for 4 hours today working on scripting. I can probably take a peek. =D
1430591624
Gen Kitty
Forum Champion
Minimal repeatable case: !power --name|test --!1|[[1d20cf&lt;3ro20]] The same dice roll, done as not-API, displays the tooltip perfectly. It's something about API that causes this display error, so I'm 99% sure the problem isn't with this script but scripts in general.
On the flip side, !power --name|test --!1|[[1d20cs&gt;3ro20]] displays perfectly. You don't even need the ro20 to make it not show properly, simply using the following does not either: !power --name|test --!1|[[1d20cf&lt;3]] .
1430593019

Edited 1430593324
HB: I don't think it is on your end, at all. It might be the recent updates pushed out. It may have even quit working around the same time the dice stopped working, I don't know. I'm positive it is related strictly to the &lt; sign because !power --name|test --!1|[[1d20cf1cf2cf3]] works perfectly.
1430593464
The Aaron
Pro
API Scripter
It's the &lt; that is causing the issue. It is being interpreted as the start of an HTML tag: &lt;span style="text-align: center ; font-size: 100% ; font-weight: bold ; display: inline-block ; min-width: 1.75em ; border-radius: 3px ; padding: 2px 2px 1px 2px ; border: 1px solid ; background-color: #fffea2 ; border-color: #87850a ; color: #000000" class="userscript-a userscript-inlinerollresult userscript-showtip userscript-tipsy" original-title="Roll: 1d20cf &lt;3ro20&lt;br&gt; Results: (&lt;span style=''&gt;14&lt;/span&gt;) = 14"&gt;14&lt;/span&gt; I'll see if I can track down the patch for that. Just needs something like .replace(/\&lt;/g,'&lt;'); in the right place...
1430593875

Edited 1430593990
I just inspected the elements for the PowerCard roll, and a standard, and here are the results: PowerCard: &lt;span style="text-align: center ; font-size: 100% ; font-weight: bold ; display: inline-block ; min-width: 1.75em ; border-radius: 0px ; padding: 2px 2px 0px 2px ; border: 1px solid ; cursor: help ; background-color: #fffea2 ; border-color: #87850a ; color: #000000" class="userscript-a userscript-inlinerollresult userscript-showtip userscript-tipsy" original-title="Roll: 1d20cf&lt;3ro20&lt;br&gt;Results: (&lt;span style=''&gt;7&lt;/span&gt;) = 7"&gt;7&lt;/span&gt; Standard: &lt;span class="inlinerollresult showtip tipsy-n" original-title="&lt;img src="/images/quantumrollwhite.png" class="inlineqroll"&gt; Rolling 1d20cf&lt;3ro20 = (&lt;span class="basicdiceroll"&gt;13&lt;/span&gt;)"&gt;13&lt;/span&gt; At first I thought maybe the &lt; was causing the scripting output to think it was an open tag for HTML, but with it also existing in the standard, I'm less inclined to consider that definitively. Edit: LOL -- looks like you and I had the same idea to check on this Aaron.
1430595569

Edited 1430824371
The Aaron
Pro
API Scripter
Since it's going in the tipsy title, it actually ends up needing to be double escaped. I wrote a could functions to handle that dynamically: // escape all the characters in a string that need to be escaped for Regular Expressions esRE = function (s) { var escapeForRegexp = /(\\|\/|\[|\]|\(|\)|\{|\}|\?|\+|\*|\||\.|\^|\$)/g; return s.replace(escapeForRegexp,"\\$1"); }, HE = (function(){ var entities={ //' ' : '&'+'nbsp'+';', '&lt;' : '&'+'lt'+';', '&gt;' : '&'+'gt'+';', "'" : '&'+'#39'+';', '@' : '&'+'#64'+';', '{' : '&'+'#123'+';', '|' : '&'+'#124'+';', '}' : '&'+'#125'+';', '[' : '&'+'#91'+';', ']' : '&'+'#93'+';', '&' : '&'+'amp'+';', '"' : '&'+'quot'+';', '-' : '&'+'mdash'+';' }, re=new RegExp('('+_.map(_.keys(entities),esRE).join('|')+')','g'); return function(s){ return s.replace(re, function(c){ return entities[c] || c; }); }; }()), HE2 = _.compose(HE,HE); I put these both in buildInline, and wrapped both instances of inlineroll.expression with HE2() calls to double escape them. EDIT: This is now fixed in the mainline.
1430595802
The Aaron
Pro
API Scripter
Sean G. said: I just inspected the elements for the PowerCard roll, and a standard, and here are the results: PowerCard: &lt;span style="text-align: center ; font-size: 100% ; font-weight: bold ; display: inline-block ; min-width: 1.75em ; border-radius: 0px ; padding: 2px 2px 0px 2px ; border: 1px solid ; cursor: help ; background-color: #fffea2 ; border-color: #87850a ; color: #000000" class="userscript-a userscript-inlinerollresult userscript-showtip userscript-tipsy" original-title="Roll: 1d20cf&lt;3ro20&lt;br&gt;Results: (&lt;span style=''&gt;7&lt;/span&gt;) = 7"&gt;7&lt;/span&gt; Standard: &lt;span class="inlinerollresult showtip tipsy-n" original-title="&lt;img src="/images/quantumrollwhite.png" class="inlineqroll"&gt; Rolling 1d20cf&lt;3ro20 = (&lt;span class="basicdiceroll"&gt;13&lt;/span&gt;)"&gt;13&lt;/span&gt; At first I thought maybe the &lt; was causing the scripting output to think it was an open tag for HTML, but with it also existing in the standard, I'm less inclined to consider that definitively. Edit: LOL -- looks like you and I had the same idea to check on this Aaron. Yup. Probably the standard one doesn't have this problem either because of some CSS magic, or by virtue of not being next to an unclosed tag like &lt;br&gt;. The standard one is not ambiguous about the intent of that &lt;, whereas the powercard one is. That's just a guess though. I'll have to ask my resident CSS guru. =D
Yeah, I was wondering about that line break in there also, especially since it isn't as though it created the line break.
1430600007
Gen Kitty
Forum Champion
I'll have to wait for Powercards to be officially patched; the GM of the game where I noticed this is v e r y leery of API, and I try to keep his interactions with it to a minimum. (You can imagine how much I look forward to script updating/installing being turned into a few button presses! ^_^ )