add MATT request macros

This commit is contained in:
Mike Bloy 2024-02-11 16:18:54 -06:00
parent 92aced8f40
commit 4de06dac03
22 changed files with 182 additions and 63 deletions

37
macros/requuesRollMATT.js Normal file
View File

@ -0,0 +1,37 @@
// This will request rolls from the tile's current collection, assuming
// that collection is tokens.
// call this from MATT's Run Macro with the following arguments,
// 1. roll type: "attribute" or "skill" (in double quotes)
// 2. roll description: attribute or skill name as you want
// it to appear in the request title (in double quotes), eg "Strength"
// or "Common Knowledge"
// 3... paired arguments, each pair a modifier and a description,
// eg: '-2 "Noxious Fog" +1 "Bless Aura"'
// so an entire arguments box in MATT may look like this:
// "skill" "Common Knowledge" -2 "Ugly Wallpaper" +1 "Rousing Speech"
const requestRollFromTokens = game.modules.get('swade-mb-helpers').api.requestRollFromTokens
const tokens = arguments[0].value.tokens.map(t => canvas.tokens.get(t.id))
const rolldata = args
async function main () {
if (tokens.length < 1) {
return
}
const rollType = rolldata.shift()
const rollDesc = rolldata.shift()
const options = { targetNumber: 4 }
const mods = []
while (rolldata.length > 0) {
const value = Number(rolldata.shift())
const label = rolldata.shift()
mods.push({ label, value })
}
if (mods.length > 0) {
options.mods = mods
}
requestRollFromTokens(tokens, rollType, rollDesc, options)
}
main()

View File

@ -1,5 +1,5 @@
2024/01/29-23:43:16.099904 7f72097bd700 Delete type=3 #1 2024/02/11-16:18:00.323096 7fc271fbd700 Delete type=3 #1
2024/01/29-23:43:16.103068 7f6f6bfff700 Level-0 table #5: started 2024/02/11-16:18:00.326138 7fc270d42700 Level-0 table #5: started
2024/01/29-23:43:16.110852 7f6f6bfff700 Level-0 table #5: 15710 bytes OK 2024/02/11-16:18:00.332530 7fc270d42700 Level-0 table #5: 15710 bytes OK
2024/01/29-23:43:16.121887 7f6f6bfff700 Delete type=0 #3 2024/02/11-16:18:00.339263 7fc270d42700 Delete type=0 #3
2024/01/29-23:43:16.122061 7f6f6bfff700 Manual compaction at level-0 from '!folders!0nDRFmMBs5DBJU9M' @ 72057594037927935 : 1 .. '!items.effects!RC1Nz6iph8wPPK1B.g9W5hJisq3MsCpZW' @ 0 : 0; will stop at (end) 2024/02/11-16:18:00.339399 7fc270d42700 Manual compaction at level-0 from '!folders!0nDRFmMBs5DBJU9M' @ 72057594037927935 : 1 .. '!items.effects!RC1Nz6iph8wPPK1B.g9W5hJisq3MsCpZW' @ 0 : 0; will stop at (end)

View File

@ -1,5 +1,5 @@
2024/01/29-23:43:17.011739 7fcd23fff700 Delete type=3 #1 2024/02/11-16:18:01.489576 7f2daffff700 Delete type=3 #1
2024/01/29-23:43:17.014256 7fcd237fe700 Level-0 table #5: started 2024/02/11-16:18:01.491957 7f2daeffd700 Level-0 table #5: started
2024/01/29-23:43:17.021608 7fcd237fe700 Level-0 table #5: 6787 bytes OK 2024/02/11-16:18:01.496159 7f2daeffd700 Level-0 table #5: 6787 bytes OK
2024/01/29-23:43:17.030434 7fcd237fe700 Delete type=0 #3 2024/02/11-16:18:01.500429 7f2daeffd700 Delete type=0 #3
2024/01/29-23:43:17.030575 7fcd237fe700 Manual compaction at level-0 from '!items!JWyBQe4tnOYljFAF' @ 72057594037927935 : 1 .. '!items!tWWSfEMmLmws6Yb1' @ 0 : 0; will stop at (end) 2024/02/11-16:18:01.500570 7f2daeffd700 Manual compaction at level-0 from '!items!JWyBQe4tnOYljFAF' @ 72057594037927935 : 1 .. '!items!tWWSfEMmLmws6Yb1' @ 0 : 0; will stop at (end)

View File

@ -1,5 +1,5 @@
2024/01/29-23:43:17.871203 7fcc2b7fe700 Delete type=3 #1 2024/02/11-16:18:02.043785 7f58057be700 Delete type=3 #1
2024/01/29-23:43:17.874557 7fcc2a542700 Level-0 table #5: started 2024/02/11-16:18:02.046489 7f5803d42700 Level-0 table #5: started
2024/01/29-23:43:17.881745 7fcc2a542700 Level-0 table #5: 1751 bytes OK 2024/02/11-16:18:02.049544 7f5803d42700 Level-0 table #5: 1751 bytes OK
2024/01/29-23:43:17.891265 7fcc2a542700 Delete type=0 #3 2024/02/11-16:18:02.052736 7f5803d42700 Delete type=0 #3
2024/01/29-23:43:17.891403 7fcc2a542700 Manual compaction at level-0 from '!actors!U5v4gFHquo0Y1SAq' @ 72057594037927935 : 1 .. '!actors!U5v4gFHquo0Y1SAq' @ 0 : 0; will stop at (end) 2024/02/11-16:18:02.052843 7f5803d42700 Manual compaction at level-0 from '!actors!U5v4gFHquo0Y1SAq' @ 72057594037927935 : 1 .. '!actors!U5v4gFHquo0Y1SAq' @ 0 : 0; will stop at (end)

Binary file not shown.

View File

@ -1,5 +1,5 @@
2024/01/29-23:43:18.604510 7f21da7be700 Delete type=3 #1 2024/02/11-16:18:02.642184 7fcfc77fe700 Delete type=3 #1
2024/01/29-23:43:18.607134 7f21d8fbb700 Level-0 table #5: started 2024/02/11-16:18:02.644770 7fcfc5d82700 Level-0 table #5: started
2024/01/29-23:43:18.630768 7f21d8fbb700 Level-0 table #5: 18825 bytes OK 2024/02/11-16:18:02.650970 7fcfc5d82700 Level-0 table #5: 21634 bytes OK
2024/01/29-23:43:18.639775 7f21d8fbb700 Delete type=0 #3 2024/02/11-16:18:02.657857 7fcfc5d82700 Delete type=0 #3
2024/01/29-23:43:18.639913 7f21d8fbb700 Manual compaction at level-0 from '!folders!A3iVDJD2cTuTLpBu' @ 72057594037927935 : 1 .. '!macros!wU2mAUnw3RW9qMT8' @ 0 : 0; will stop at (end) 2024/02/11-16:18:02.658018 7fcfc5d82700 Manual compaction at level-0 from '!folders!A3iVDJD2cTuTLpBu' @ 72057594037927935 : 1 .. '!macros!wU2mAUnw3RW9qMT8' @ 0 : 0; will stop at (end)

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
"scope": "global", "scope": "global",
"command": "game.modules.get('swade-mb-helpers').api.fearTable(actor)", "command": "game.modules.get('swade-mb-helpers').api.fearTable(actor)",
"folder": null, "folder": null,
"sort": 0, "sort": 200000,
"ownership": { "ownership": {
"default": 0, "default": 0,
"sVoCvBU1knmXzoYe": 3 "sVoCvBU1knmXzoYe": 3
@ -18,8 +18,8 @@
"systemVersion": "3.2.5", "systemVersion": "3.2.5",
"coreVersion": "11.315", "coreVersion": "11.315",
"createdTime": 1703096862424, "createdTime": 1703096862424,
"modifiedTime": 1703096940207, "modifiedTime": 1707686618258,
"lastModifiedBy": "sVoCvBU1knmXzoYe" "lastModifiedBy": "Aqnn9hCDQPbyTWiq"
}, },
"_key": "!macros!S6HY6RqjPTt0z0yY" "_key": "!macros!S6HY6RqjPTt0z0yY"
} }

View File

@ -29,11 +29,11 @@
"systemVersion": "3.2.5", "systemVersion": "3.2.5",
"coreVersion": "11.315", "coreVersion": "11.315",
"createdTime": 1680966567327, "createdTime": 1680966567327,
"modifiedTime": 1702959790712, "modifiedTime": 1707686618258,
"lastModifiedBy": "sVoCvBU1knmXzoYe" "lastModifiedBy": "Aqnn9hCDQPbyTWiq"
}, },
"folder": null, "folder": null,
"sort": 600000, "sort": 1000000,
"_id": "QMnx9cuyw81kRS2o", "_id": "QMnx9cuyw81kRS2o",
"_key": "!macros!QMnx9cuyw81kRS2o" "_key": "!macros!QMnx9cuyw81kRS2o"
} }

View File

@ -18,10 +18,10 @@
"systemVersion": "3.2.5", "systemVersion": "3.2.5",
"coreVersion": "11.315", "coreVersion": "11.315",
"createdTime": 1693853383361, "createdTime": 1693853383361,
"modifiedTime": 1702959790712, "modifiedTime": 1707686618258,
"lastModifiedBy": "sVoCvBU1knmXzoYe" "lastModifiedBy": "Aqnn9hCDQPbyTWiq"
}, },
"_id": "AjuA11hQ48UJNwlH", "_id": "AjuA11hQ48UJNwlH",
"sort": 500000, "sort": 900000,
"_key": "!macros!AjuA11hQ48UJNwlH" "_key": "!macros!AjuA11hQ48UJNwlH"
} }

View File

@ -18,10 +18,10 @@
"systemVersion": "3.2.5", "systemVersion": "3.2.5",
"coreVersion": "11.315", "coreVersion": "11.315",
"createdTime": 1702933790652, "createdTime": 1702933790652,
"modifiedTime": 1702959790712, "modifiedTime": 1707686618258,
"lastModifiedBy": "sVoCvBU1knmXzoYe" "lastModifiedBy": "Aqnn9hCDQPbyTWiq"
}, },
"_id": "NANSnFATVJntUfL7", "_id": "NANSnFATVJntUfL7",
"sort": 200000, "sort": 600000,
"_key": "!macros!NANSnFATVJntUfL7" "_key": "!macros!NANSnFATVJntUfL7"
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -18,10 +18,10 @@
"systemVersion": "3.2.5", "systemVersion": "3.2.5",
"coreVersion": "11.315", "coreVersion": "11.315",
"createdTime": 1700430548162, "createdTime": 1700430548162,
"modifiedTime": 1703297741362, "modifiedTime": 1707686618258,
"lastModifiedBy": "sVoCvBU1knmXzoYe" "lastModifiedBy": "Aqnn9hCDQPbyTWiq"
}, },
"_id": "pnLnFrfTTJeodFRy", "_id": "pnLnFrfTTJeodFRy",
"sort": 300000, "sort": 700000,
"_key": "!macros!pnLnFrfTTJeodFRy" "_key": "!macros!pnLnFrfTTJeodFRy"
} }

View File

@ -18,10 +18,10 @@
"systemVersion": "3.2.5", "systemVersion": "3.2.5",
"coreVersion": "11.315", "coreVersion": "11.315",
"createdTime": 1700430548162, "createdTime": 1700430548162,
"modifiedTime": 1703297742414, "modifiedTime": 1707686618258,
"lastModifiedBy": "sVoCvBU1knmXzoYe" "lastModifiedBy": "Aqnn9hCDQPbyTWiq"
}, },
"_id": "G9ksuYJo1512PTo9", "_id": "G9ksuYJo1512PTo9",
"sort": 400000, "sort": 800000,
"_key": "!macros!G9ksuYJo1512PTo9" "_key": "!macros!G9ksuYJo1512PTo9"
} }

File diff suppressed because one or more lines are too long

View File

@ -18,10 +18,10 @@
"systemVersion": "3.2.5", "systemVersion": "3.2.5",
"coreVersion": "11.315", "coreVersion": "11.315",
"createdTime": 1702934878750, "createdTime": 1702934878750,
"modifiedTime": 1706592965168, "modifiedTime": 1707686618258,
"lastModifiedBy": "Aqnn9hCDQPbyTWiq" "lastModifiedBy": "Aqnn9hCDQPbyTWiq"
}, },
"_id": "arjbjmgKMjyp9tWE", "_id": "arjbjmgKMjyp9tWE",
"sort": 100000, "sort": 500000,
"_key": "!macros!arjbjmgKMjyp9tWE" "_key": "!macros!arjbjmgKMjyp9tWE"
} }

Binary file not shown.

View File

@ -1,5 +1,5 @@
2024/01/29-23:43:19.357120 7f7d00fbc700 Delete type=3 #1 2024/02/11-16:18:03.450233 7f2b77fff700 Delete type=3 #1
2024/01/29-23:43:19.359763 7f7a63fff700 Level-0 table #5: started 2024/02/11-16:18:03.453241 7f2b767fc700 Level-0 table #5: started
2024/01/29-23:43:19.367310 7f7a63fff700 Level-0 table #5: 16288 bytes OK 2024/02/11-16:18:03.478614 7f2b767fc700 Level-0 table #5: 17541 bytes OK
2024/01/29-23:43:19.376324 7f7a63fff700 Delete type=0 #3 2024/02/11-16:18:03.487798 7f2b767fc700 Delete type=0 #3
2024/01/29-23:43:19.376468 7f7a63fff700 Manual compaction at level-0 from '!journal!HbtPlHNFO1L6RVj0' @ 72057594037927935 : 1 .. '!journal.pages!w4TImRTAiNiqDWeL.vQhO6BVdKZOubTUQ' @ 0 : 0; will stop at (end) 2024/02/11-16:18:03.487939 7f2b767fc700 Manual compaction at level-0 from '!journal!HbtPlHNFO1L6RVj0' @ 72057594037927935 : 1 .. '!journal.pages!w4TImRTAiNiqDWeL.vQhO6BVdKZOubTUQ' @ 0 : 0; will stop at (end)

Binary file not shown.

File diff suppressed because one or more lines are too long