Erik M. said: Heyas! So I have a question about Libraries and API calls. I have the following macro: !scriptcard {{ +++Conditions+++ --&Affected|@{selected|token_id} --&ConditionName|Charmed -->ApplyCondition| }} And the library code is: --:ApplyCondition| --?"[&ConditionName]" -eq "Blinded"|[ --+Blinded|[*[&Affected]:t-name] is blinded by the spell. They suffer a –3 penalty to any rolls that rely on vision - including attack rolls - and halves their Defense. --@token-mod|_ignore-selected _ids [&Affected] _set statusmarkers|broken-skull --<| --]| --?"[&ConditionName]" -eq "Charmed"|[ --+Charmed|[*[&Affected]:t-name]'s luck may spare them from serious injury, ensure that she meets someone whose acquaintance will be valuable to them later, guarantee that she isn’t the one who gets the short straw, or help them win an important game of chance. You may invoke this twist of fate at any time as a reflexive action. If used to avoid injury, resolving this Condition reduces the damage to 1. Otherwise, no one knows the exact nature this good fortune will take when it manifests — only that it will have a significant impact. --@token-mod|_ignore-selected _ids [&Affected] _set statusmarkers|angel-outfit --<| --]| When I run the macro, it correctly runs the correct code block, but the status marker isn't applied at all. The debug dump says that call is made but noting happens. "Line Counter: 2, Tag:&Affected, Content:-NOvYsIuFkjFmt6i887s" "Line Counter: 3, Tag:&ConditionName, Content:Charmed" "Line Counter: 4, Tag:>ApplyCondition, Content:" "ContentIn: ?\"[&ConditionName]\" -eq \"Blinded\" Match: [&ConditionName], vName: ConditionName, replacement Charmed" "Line Counter: 7, Tag:?\"Charmed\" -eq \"Blinded\", Content:[" "Condition \"Charmed\" -eq \"Blinded\" evaluation result: false" "ContentIn: ?\"[&ConditionName]\" -eq \"Charmed\" Match: [&ConditionName], vName: ConditionName, replacement Charmed" "Line Counter: 12, Tag:?\"Charmed\" -eq \"Charmed\", Content:[" "Condition \"Charmed\" -eq \"Charmed\" evaluation result: true" "ContentIn: [*[&Affected]:t-name]'s luck may spare them from serious injury, ensure that she meets someone whose acquaintance will be valuable to them later, guarantee that she isn’t the one who gets the short straw, or help them win an important game of chance. You may invoke this twist of fate at any time as a reflexive action. If used to avoid injury, resolving this Condition reduces the damage to 1. Otherwise, no one knows the exact nature this good fortune will take when it manifests — only that it will have a significant impact. Match: [&Affected], vName: Affected, replacement -NOvYsIuFkjFmt6i887s" "Line Counter: 13, Tag:+Charmed, Content:npcsettings's luck may spare them from serious injury, ensure that she meets someone whose acquaintance will be valuable to them later, guarantee that she isn’t the one who gets the short straw, or help them win an important game of chance. You may invoke this twist of fate at any time as a reflexive action. If used to avoid injury, resolving this Condition reduces the damage to 1. Otherwise, no one knows the exact nature this good fortune will take when it manifests — only that it will have a significant impact." "ContentIn: _ignore-selected _ids [&Affected] _set statusmarkers|angel-outfit Match: [&Affected], vName: Affected, replacement -NOvYsIuFkjFmt6i887s" "Line Counter: 14, Tag:@token-mod, Content:_ignore-selected _ids -NOvYsIuFkjFmt6i887s _set statusmarkers|angel-outfit" "ScriptCards: Making API call - !token-mod --ignore-selected --ids -NOvYsIuFkjFmt6i887s --set statusmarkers|angel-outfit" "Line Counter: 15, Tag:<, Content:" "Line Counter: 5, Tag:X, Content:" Can Mod calls happen from a library? Or do I have an error somewhere? Thanks! --@ command should work from module code, but if the script is being run by a non-gm token-mod needs to be configured to allow the user of IDs. If you run the token-mod command by just pasting the text into the chat, does that work? The other thing I would caution against is using code blocks in library code. Code block can't be nested, so if you call a library function that uses a code block from inside code that is also using a code block, you may experience strange behavior. This is something I need to work on addressing in the code, but it is the way it is right now.