Here's a simple example:
create a lib token named: "Lib:Utility"
on that token, create a new button, and place following code in it:
Code: Select all
[h, if( isFrameVisible("myHand") ), code: {}; { [resetFrame("myHand")] } ]
[frame("myHand"): {
[h: processorLink = macroLinkText("processForm@Lib:Utility", "all")]
<form action="[r:processorLink]" method="json">
<input type="submit" name="B1" value="1">
<input type="submit" name="B2" value="2">
<input type="submit" name="B3" value="3">
</form>
}]
Code: Select all
[r: macro.args ]
The full example I'm trying to handle is a frame with several image buttons (ie cards).
The player would click on a card, and then some code would fire.
So I need to know:
1) which player triggered the event (still not sure how I'm going to do that - perhaps getImpersonatedName or such ??)
2) which card they clicked on. the problem with this one, is that the code returns only:
Code: Select all
{"B2"."2"}
I tried to name all the buttons the same:
Code: Select all
<input type="submit" name="B" value="1">
<input type="submit" name="B" value="2">
<input type="submit" name="B" value="3">
Then I could just ask for:
Code: Select all
[json.get ( arg, "B")]
Code: Select all
value=3
What's the simplest way to get that value without knowing which button was clicked ?