Input() with multiple checkboxes?

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
Skyth
Cave Troll
Posts: 39
Joined: Mon Sep 26, 2011 9:21 am
Contact:

Input() with multiple checkboxes?

Post by Skyth »

I was wondering if there was a way to do take a json, and use input to select which of these apply.

For instance, you have a json with ["One", "Two", "Three", "Four"]

Now you want to run a macro that choose which of these to select. Ideally, the macro would process the json and put a checkbox next to each entry for the json to choose if you want it or not.

Then the macro would return a json of the results. The entry json would be of different lengths each time.

I'm basically thinking of a targeting macro that would grab all the PC's (or NPC's) within a certain distance and ask if something applies to them (Think selective channeling in Pathfinder).

I could do this with the macro going through a loop for each token and doing an input question for each one, but that would be tedious (And a lot of clicking). I want every possible choice to show up on the screen.

Ideally, something like this:

Code: Select all

[h: xxx=json.fromList("One, Two, Three, Four")]
[h: input("x|"+json.toList(xxx)+"|Choose|Check")]
[r: x]
Where x returns a json of what was chosen (If you pick One and Three, it would return 0,2).

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Input() with multiple checkboxes?

Post by wolph42 »

so if you have 10 tokens in the neighbourhood with say 5 different 'applications' then you want one list showing 50 choices?

note that if you want checkboxes you need a seperate entry in your input per check. You can loop this to build you input on the fly so no biggie, but its something you should know.

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Input() with multiple checkboxes?

Post by aliasmask »

I use something like this:
Spoiler
Image2.jpg
Image2.jpg (74.77 KiB) Viewed 497 times
You can see my code in my healbot token. I'm not sure if it is completely stand alone, but I think it is.
Attachments
healbot 11-21-15.rptok
(226.39 KiB) Downloaded 27 times

Post Reply

Return to “Macros”