I know how to set up a repeat-link that adds to a variable every time you click it:
(link-repeat: "Click")[(set:$clicks to it + 1)]
And I have implemented cycling links, so that the text in the link changes every time you click it:
(set: $weapon to "Sword")<tw-link class='cyclingLink' data-cycling-texts='["Sword", "Axe", "Harsh language"]' onclick='clickCyclingLink(this, "$weapon");'>&weapon</tw-link>
But how can I combine the two? I tested the following:
(set: $weapon to "Sword")<tw-link class='cyclingLink' data-cycling-texts='["Sword", "Axe", "Harsh language"]' onclick='clickCyclingLink(this, "$weapon");'>(link-repeat: "$weapon")[(set:$clicks to it + 1)]</tw-link>
It doesn't work because 'link-repeat' only operates properly with a string inside the inverted commas, not a variable. I suspect there are other reasons why it doesn't work as well.
I expect you have to add a second command after 'onclick=' but I'm not sure what.