I apologize for my inability to express my thoughts easily - comes with the territory. My original code looked identical to yours, except instead of count, I tried for, foreach, and another while, but for some reason, the second [while] that checks for the repeatCheck, kept spitting the same result into the list.
Example: With a 'Reflexes' property of 3, it would put 4 numbers in the list (3+1), but each number would come up the exact same from the while() loop, say 13,13,13,13. It seemed as though the inner nested WHILE ran first, and then completed before the repeat, thus filling the list with the same number over and over.
To clarify in the way you mentioned, this macro is emulating a card deck with 2 jokers (1d54). I send a list (rollList) so that no two cards can ever repeat themselves, which is what the while() was for. I just couldn't find the right code to make the while() work for players who got to take the 'best' of multiple draws. The While wouldn't function multiple times until I put it into a second macro, but I'll now try 'Count' and see if that fixes it.
Thanks for your time - I really don't intend to be vague, I just don't really know what to explain without trying to get you guys to write an entire bit of code for me, I feel like that's not really learning or trying to improve, but rather just have people do it for me. I'll try to be more concise.
EDIT: I tried it with COUNT instead, and got the same results.
Code: Select all
[h, COUNT(howManyTimes), CODE:{
[h, while(repeatCheck>0), CODE:{
[h: roll=1d54]
[h: repeatCheck=listContains(rollList,roll)]
}]
[h: newRollList=listAppend(newRollList,roll)]
}]
This returns a list with the exact same roll repeated n times. So yeah, for now, I'll keep my two macro approach, which works - it just seems a bit slow, but that's probably just my perception from how huge the initiative macro is, anyway.
"An arrogant person considers himself perfect. This is the chief harm of arrogance. It interferes with a person's main task in life - becoming a better person." - Leo Tolstoy