Discussion and Support

Skip to content

It is currently Tue Sep 19, 2017 10:07 am 

Reply to topic  [ 3 posts ] 

Previous topic | Next topic 

  Print view

Author Message
Cave Troll
Joined: Mon Sep 26, 2011 8:21 am
Posts: 52
 Post subject: Input() with multiple checkboxes?
PostPosted: Sat Jul 22, 2017 10:22 am 
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:
[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  Offline
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9373
Location: Netherlands
 Post subject: Re: Input() with multiple checkboxes?
PostPosted: Sat Jul 22, 2017 1:50 pm 
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.


My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS

User avatar  Offline
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7854
Location: Bay Area
 Post subject: Re: Input() with multiple checkboxes?
PostPosted: Sat Jul 22, 2017 3:16 pm 
I use something like this:

Image2.jpg [ 74.77 KiB | Viewed 150 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.

healbot 11-21-15.rptok [226.39 KiB]
Downloaded 4 times

Display posts from previous:  Sort by  
Reply to topic  [ 3 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 2 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman