I am having some trouble coding the following when a character sheet is opened (I am brand new to HTML and CSS and JavaScript)
I have an attribute named attr_modifier
It can have one of two values;
Either it equals: ?{Modifier|0}
Or it equals: ?{Modifier|0} +?{Shock|0} +?{Reeling or Staggered|0} + ?{Off-Hand|0} + ?{Familiarity|0}
If it equals: ?{Modifier|0}, I need to change it to: [[?{Modifier|0}]]
If it equals: ?{Modifier|0} +?{Shock|0} +?{Reeling or Staggered|0} + ?{Off-Hand|0} + ?{Familiarity|0}, I need to change it to: [[?{Modifier|0}]] +[[?{Shock|0}]] +[[?{Reeling or Staggered|0}]] + [[?{Off-Hand|0}]] + [[?{Familiarity|0}]]
I know the code starts as;
on('sheet:opened', function() {
I started the rest of the code (but I know it is all wrong)
getAttr([‘attr_modifier’], function(v){
if(v. attr_modifier)== ?{Modifier|0} {
setAttrs({attr_modifier})== [[?{Modifier|0}]];
}
if(v. attr_modifier)==?{Modifier|0} +?{Shock|0} +?{Reeling or Staggered|0} + ?{Off-Hand|0} + ?{Familiarity|0}{
setAttrs({attr_modifier})== [[?{Modifier|0}]] +[[?{Shock|0}]] + [[?{Reeling or Staggered|0}]] + [[?{Off-Hand|0}]] + [[?{Familiarity|0}]];
}
}
I really need some help here- Thanks.