Giter Site home page Giter Site logo

roll20apiscripts's People

Contributors

derammo avatar derholding avatar lostnode avatar pieterhelsen avatar robinkuiper avatar sillvva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

roll20apiscripts's Issues

[LazyCalendar] MonthAdvance breaks when moving past the 12th month

Likely related to issue #58.

When attempting to use !cal month-set, as established in the message pop-up by moving from month 13 to month 14, an overflow appears if attempting to switch to another month, where it iterates 34, the number of days in each month in the day column. Setting the day to a different value does nothing and instead adds NaN to the day column. Setting or advancing the or day simply adds "34," the number of months in a day to the calendar, or "1" to the current day.

Image issue

As an issue that occurred prior to the month overflow, when attempting to use !cal month-set to move past the 13th and 14th month, Roll20 API would crash with this following error.

RangeError: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
    at setCurrentDoM (apiscript.js:7753:30)
    at setCurrentDoM (apiscript.js:7761:13)
    at setCurrentDoM (apiscript.js:7761:13)
    at setCurrentDoM (apiscript.js:7761:13)
    at setCurrentDoM (apiscript.js:7761:13)
    at setCurrentDoM (apiscript.js:7761:13)
    at setCurrentDoM (apiscript.js:7761:13)
    at setCurrentDoM (apiscript.js:7761:13)
    at setCurrentDoM (apiscript.js:7761:13)
    at setCurrentDoM (apiscript.js:7761:13)

[LazyExperience] Doesn't seem to work with certain markers?

Hi there,

  1. When I mark a token as dead it does not trigger the question in chat to add the xp. I have checked that the config is correct (i.e. dead marker selected and characters are active). [UPDATE: it seems to work with some tokens but not others. E.g. if I drag a Giant Wasp token in from the 5e compendium it works but if I drag in a Skeleton from the same compendium it doesn't work.]

  2. Also, although I have set the config to update character sheets and also set the instant update option, it does not update the character sheets if I manually add to the session xp and then end the session, just outputs it to the chat.

Problem 1 is higher priority for me โ€“ would be amazing if dead tokens add to the session xp!

[BeyondImporter] Firebase.update failed: First argument contains undefined in property 'current'

this crash creates a strange async callstack inside Roll20, with no symbols from our code. One thing that causes this crash is incorrect import logic that sets attributes based on Beyond input data without any verification. In one case, the name of a proficiency was undefined in the Beyond JSON and therefore the corresponding repeating attribute was set to undefined also, causing this crash from setAttrs (async crash.)

A workaround is to scan all attributes for null or undefined and changing their values to empty string before writing. This way, incomplete import won't crash.

[BeyondImporter] Slow performance

The last run took about 1 minute to run, whereas before it would take a few seconds. Some changes seem to have slowed down the script considerably.

[Lazy Experience] - Feature Request

Please consider adding some sort of notification inside the LazyExp Config screen that shows that a person is inactive. Currently, you can click on config to get that information, but it would be quite handy to have it displayed right in that window.

Thanks for your great work...

lazyexp

[BeyondImporter] Restrictions shown in spell attack macros

I propose to show the Beyond "restriction" string (if not null or empty string) in the "description" of generated spell Attack macros. This will help with many cases like damage that is only applicable to certain choices of spell features, target restrictions or immunities, and having to choose one damage type rather than getting all of them

[StatusInfo] 6 suggested new statuses

suggestions for new conditions in the default config:
dead, exhausted, falling, squeezing, stable, concentrating.
reaction, bonus action - tokens to be placed if player/npc has used reaction/bonus action

absolutely fantastic script BTW.

Also a quick note to include the text for the 'following macro' as a suggested token action macro

!condition add ?{Condition:|Blinded|Charmed|Deafened|Frightened|Grappled|Incapacitated|Inspiration|Invisibility|Paralyzed|Petrified|Poisoned|Prone|Restrained|Stunned|Unconscious}

and

!condition remove ?{Condition:|Blinded|Charmed|Deafened|Frightened|Grappled|Incapacitated|Inspiration|Invisibility|Paralyzed|Petrified|Poisoned|Prone|Restrained|Stunned|Unconscious}

or

!condition ?{add/remove:|Add|Remove} ?{Condition:|Blinded|Charmed|Deafened|Frightened|Grappled|Incapacitated|Inspiration|Invisibility|Paralyzed|Petrified|Poisoned|Prone|Restrained|Stunned|Unconscious}

[InspirationTracker] Dragging a token that does not represent a character causes an error

When dragging a token that doesn't have "represents" property set to the game board the API console outputs an error - invalid parameter (empty) for getAttrByName(). This is caused by function handleAddToken:
handleAddToken = (obj) => {
setStatusmarker(obj, (getAttrByName(obj.get('represents'), 'inspiration', 'current') === 'on'));
},

There is no validation against undefined or empty "represents". Simplest fix:

handleAddToken = (obj) => {
	if (typeof obj.get('represents') != 'undefined' && obj.get('represents').length > 0) {
		setStatusmarker(obj, (getAttrByName(obj.get('represents'), 'inspiration', 'current') === 'on'));
	}
},

[BeyondImporter Shaped] Edge Case Issues w/ Resolutions

Issue found when no damage.* was found. This can be recreated by adding a net as a weapon the resulting weapons object is

damage: null

lines 176,177

attack_damage_dice: weapon.definition.damage.diceCount,
attack_damage_die: 'd' + weapon.definition.damage.diceValue,

change to

attack_damage_dice: (weapon.definition.damage) ? weapon.definition.damage.diceCount : 0,
attack_damage_die: (weapon.definition.damage) ? 'd' + weapon.definition.damage.diceValue : 0,

Also in the scenario of someone using "blood hunter" or one of the other classes not available in auto_traits you are using:

lines 506,507

if(auto_traits[c.class.name.toLowerCase()].includes(trait.definition.name) || auto_traits.general.includes(trait.definition.name)) return;

The issue here is that if someone is importing "blood hunter" or one of the other classes auto_traits[c.class.name.toLowerCase()] will result in a typeof undefined which doesn't have includes() as an option. This is generating an error in the API the fix is something like this.

change to

if(auto_traits[c.class.name.toLowerCase()]){
    if(auto_traits[c.class.name.toLowerCase()].includes(trait.definition.name)) return;   
}
if(auto_traits.general.includes(trait.definition.name)) return;

[CombatTracker] Script crashes when adding custom marker token

I used "!ct config" to change the marker img and now whenever I roll initiative, the API Sandbox completely crashes.
I then restarted the sandbox and changed the url to nothing, but now no marker shows at all.
I tried a few different images, but it always crashes.

Here's the error:

TypeError: Cannot read property 'get' of undefined
TypeError: Cannot read property 'get' of undefined
at turnorder.forEach.turn (apiscript.js:4334:34)
at Array.forEach (native)
at checkMarkerturn (apiscript.js:4333:19)
at getOrCreateMarker (apiscript.js:4299:19)
at doTurnorderChange (apiscript.js:3989:24)
at handleTurnorderChange (apiscript.js:3815:13)
at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:151:1), <anonymous>:65:16)
at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:151:1), <anonymous>:70:8)
at TrackedObj.set (/home/node/d20-api-server/api.js:1020:14)
at updateLocalCache (/home/node/d20-api-server/api.js:1318:18)

[CombatTracker] 'Next' marker still appears while disabled in config

When the CT config has the next marker disabled, it works as intended when beginning combat and moving the turn order to the next turn, but it overlooks one corner case. The next marker still shows up when the next upcoming token in the turn order moves before it's their turn.

[BeyondImporter] Upcast of spell with no dice

The "Aid" spell has no damage dice, it just uses a flat 5 HP "heal." When upcast, it multiplies the number of upcast dice times "null" instead of times the flat amount.

The spell from the Compendium is set to just generate the spell description instead of the attack.

[Concentration] API script error when attempting to roll a check

Using version0.1.16, imported by copy/pasting from raw github page into a new script, restarting API sandbox. This script worked correctly once for a PC sheet token. It autorolled the check just fine, and all was well. When I went to re-test by casting a spell, it correctly tracks and updates the spells and concentration, but this time it didn't roll when I clicked to check the roll. Switching to autoroll had the same issue. Restarted the API and reloaded and encountered the same issue. Deleted the script, re-imported, and restarted the API and still no success. Disabling other API scripts, reloading the API, and then attempting to use it also did not resolve the issue. Deleting the manually created script and importing the script using the roll20 toolbox resulted in the same issue.

The Roll20 Scipt API console reports the following error:

For reference, the error message generated was: Could not determine result type of: [{"type":"M","expr":1},{"type":"C","text":"d20cf<-1cs>-1+10"}]
undefined

It seems to refer to line# 260 in the sendChat() function.

    roll = (represents, DC, con_save_mod, name, target, advantage) => {
        sendChat(script_name, '[[1d20cf<'+(DC-con_save_mod-1)+'cs>'+(DC-con_save_mod-1)+'+'+con_save_mod+']]', results => {
            let title = 'Concentration Save <br> <b style="font-size: 10pt; color: gray;">'+name+'</b>',
                advantageRollResult;

API Console Crash

On one of my games I am getting the below error message when I attempt to start Combat Tracker. Let me know if you need any additional information to help track this down. I've re-loaded the script from scratch too...

image

[BeyondImporter] Thrown Weapons Support

weapons with property "Thrown" need to either get two separate attacks (one for melee and one for ranged) or need to be considered ranged weapons

Right now, Dueling bonus damage is applied because the weapon is not ranged but the attack has range on it. I believe that they are considered a melee weapon and therefore receive Dueling bonus etc. when used in melee? Beyond only creates the ranged attack, by the way.

[CombatTracker] Ties for highest init rolls are skipped in first round

Steps to replicate:

  • in Turn Order Config:
    • set Auto Roll Ini. to true
    • set Auto Sort to true
  • select tokens for combat
  • start combat either via menu or via !ct start
  • if there are multiple tokens that tie for highest roll, it skips all but the last:
    • e.g if token A, B, C, and D roll 18, 18, 18, 15 respectively, it will automatically mark as done A and B in the first round, moving on to C and D.
    • subsequent rounds progress normally

TypeError: type.indexOf is not a function

Since last night I get the following error whenever I try to use combattracker via initiative. It then disables all my other scripts. Issue persists when it's the only API running as well.

TypeError: type.indexOf is not a function
TypeError: type.indexOf is not a function
at spawnFx (/home/node/d20-api-server/api.js:2847:11)
at spawnFxBetweenPoints (/home/node/d20-api-server/api.js:2986:3)
at doFX (apiscript.js:8830:9)
at doTurnorderChange (apiscript.js:8823:9)
at handleTurnorderChange (apiscript.js:8623:13)
at eval (eval at (/home/node/d20-api-server/api.js:154:1), :65:16)
at Object.publish (eval at (/home/node/d20-api-server/api.js:154:1), :70:8)
at TrackedObj.set (/home/node/d20-api-server/api.js:1023:14)
at updateLocalCache (/home/node/d20-api-server/api.js:1321:18)
at /home/node/d20-api-server/api.js:1611:7

[CombatTracker] Conditions - Multiple Set

No token was selected when I clicked on Frightened inside of CT. The attached screenshot shows 5 non-selected tokens getting frightened. Could there be a dialog box that pops up telling the end-user to select a token before setting a condition?

Please let me know if you need clarification...or if it is working as programmed. Thanks!


I've attached a screen shot... it was the bottom right Goblins turn, fyi.

conditionset

conditionset2

[BeyondImporter Shaped] Skill and Savings proficiencies show up in text field

Shaped 17.0.5, import 0.0.4, json at https://pastebin.com/ynsz0VDk

This might be by design, in which case "wontfix". Skill and savings throw proficiencies show up in the text field as well as under savings throws and skills.

Example:
Shields, Simple Weapons, Martial Weapons, Light Armor, Medium Armor, Strength Saving Throws, Constitution Saving Throws, Intimidation, Animal Handling, Athletics, Religion, Survival

Arguably, this might be shortened to:
Shields, Simple Weapons, Martial Weapons, Light Armor, Medium Armor

Maybe make it a configurable option? I do hasten to add this is truly minor, I'm running out of other things to point out.

[BeyondImporter] Kensei weapons are unimplemented

from forum user Envaris:

Monk Kensei weps should use higher of dex or strength I think no? So Kensei Longsword if Monk's dex is higher (which is normally would be) should be used upon import.

https://app.roll20.net/forum/post/6248700/script-beta-beyondimporter-import-dndbeyond-character-sheets/?pageforid=7052391#post-7052391

Note to implementers:

I just finished reading the code. The kensei part is unimplemented. It does use DEX over STR for monk weapons that it recognizes. However, a Longsword (kensei weapon) on a D&D Beyond character is not marked as 'isMonkWeapon' and that is all the current importer checks. For kensei weapons to work correctly as 'finesse' or 'monk' weapons, we have to check modifiers.class with

      "type": "monk-weapon",
      "subType": "longsword",

where 'longsword' would be the short name of the current weapon's type (WARNING: lower case in modifier, capitalized in weapon type.)

NOTE: (it is also present with 'type': 'kensei' but 'monk-weapon' seems more appropriate in case there will be other ways to gain additional monk weapons)

[BeyondImporter] custom attacks break after import with overwrite

according to this user, custom attacks created by hand break after re-importing the character, suggesting we have a major flaw in how we do overwrite, in terms of keeping identifiers consistent?


from forum user Envaris:

Custom attacks should be ignored by the override toggle which they sorta are. I found what happened is that the details are correct. However, when clicked it does nothing. I had to into the custom attack in Roll20 edit something small, then re-edit back and it worked.

https://app.roll20.net/forum/post/6248700/script-beta-beyondimporter-import-dndbeyond-character-sheets/?pageforid=7052397#post-7052397

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.