おみくじMenu
UserScriptでPage Menuを拡張する例
https://gyazo.com/7bbe1194f96e01b07808be6a64d5ea05
code:script.js
const choice = (arr) => arrMath.floor(Math.random()*arr.length)
scrapbox.PageMenu.addMenu({
title: 'おみくじ',
icon: 'fas fa-torii-gate'
})
scrapbox.PageMenu('おみくじ').addItem({
title: () => choice('大吉', '吉', '中吉', '小吉', '凶', '大凶'),
onClick: () => null
})
addItemのtitleにstringを返す関数を渡すと、Menu開閉毎に実行してくれる