Advertisement Create a free account

Confusing macro challenge

for my current campaign i'm attempting to create a macro to streamline a major world mechanic. the macro needs to 1. take a selected token attribute 2. select an operation from a list based upon the value of the attribute 3. give a text response if the roll meets a certain value. While I can figure out #1 & 3 somewhat well. I'm unsure of how to achieve #2
1560180068

Edited 1560180081
Ziechael
Forum Champion
Sheet Author
API Scripter
Could you give some examples of complete equations with a description of what does/did what? It feels doable on the surface...
1560181074

Edited 1560181424
essentially select token attribute (for this case lets say it has a value of 2) From a list it selects the operation performed based on the value if Attribute =1 perform /roll 1d100. if result is <14 print "message" if Attribute =2 perform /roll 1d100. if result is <24 print "message" not really sure myself what the equations would need to look like.
1560181988

Edited 1560182190
Granted now that i think about it, essentially i just need to string along a bunch of if/then statements edit: after a bit more digging it appears that what i need is a script not a macro. thank you for the help though.
1560182195

Edited 1560182380
GiGs
Pro
Sheet Author
You cant do if/then statements in roll20 macros. There might not be any way to do your step #2 without the API (a Pro subscriber perk.) There might  be a way using complex nested menus, but that way lies madness. If anyone can do it, Ziechael can, but you'd need to be very specific about the requirements. Don't be vague: say exactly what the attributes are, and exactly what the conditionals are. The more information you give, the better.
1560183742

Edited 1560183955
specifically it would be using a new attribute that for simplicity of repetition has been named ocv. for each value of ocv between 1-50 a different formula is executed, granted every formula is the same d100 roll with a gradually higher roll fail check . Yes, now that i look around it would be doable with nesting menus but each value would have to be its own button to call a different formula. I'm sorry for any confusion regarding this question, but while i have some rudimentary programming knowledge I'm a novice at programming macros in roll20. At the moment I'm mainly just figuring out what operations are possible with macros.
1560184623
GiGs
Pro
Sheet Author
The the formula is the same with a gradually higher roll fail check, it might be possible to do it without a nesting macro. Without knowing the EXACT numbers, and the specific messages you want outputting, there's no way to know.
1560251132
i could think of solutions with a ton of rollable tables... but as gigs said: please be more specific. :)