I'm trying to dynamically generate a list of numbers to use on an input box to select the level of a power used. When I use the code below I only get the original value of mList.
[While(count<=mList), code:{[listAppend(mList,count)][h:count=count+1]}]
[h:mLevel=listSort(mList,"N")]
I figured out it was appending but not updating the list after appending the value. So when I adjusted it to this I get an "Error in body of roll.
[While(count<=mList), code:{[h:mList = listAppend(mList,count)][h:count=count+1]}]
[h:mLevel=listSort(mList,"N")]
I dont understand.
Macro Error help
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Re: Macro Error help
In the loop you get while count<=1,2,3 ... Which makes no sense. Hence an error
You probly want something like
You probly want something like
Code: Select all
[count(5):mlist=listappend(mlist, roll.count)]
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
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
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
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
-
- Cave Troll
- Posts: 29
- Joined: Fri Aug 10, 2012 7:23 am
Re: Macro Error help
for example if mList=7
I want count to start at 1 building a list of 7,1,2,3,4,5,6 and then sorting it.
or if mList is 12, 12, 1, 2, ..., 10, 11
then sort it in order putting the largest number in back. so that I end up with a count of 1 to X
maybe i need to specify the first value in the list in the while statement?
I want count to start at 1 building a list of 7,1,2,3,4,5,6 and then sorting it.
or if mList is 12, 12, 1, 2, ..., 10, 11
then sort it in order putting the largest number in back. so that I end up with a count of 1 to X
maybe i need to specify the first value in the list in the while statement?
Re: Macro Error help
That's exactly what my code does.
Just add
[num=mlist] and change count(5) into count(num) to make it generic
Just add
[num=mlist] and change count(5) into count(num) to make it generic
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
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
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
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
-
- Cave Troll
- Posts: 29
- Joined: Fri Aug 10, 2012 7:23 am
Re: Macro Error help
That worked great. Thanks.