intermediate ii: locked choices

✎ why should i use locked choices?

  • locked choices are a way to force, or "lock", a given value to a choice that's been randomly chosen.

  • unlike choose, locked choices are not chosen randomly and are only chosen if the choice value it's locked to is chosen.

  • this allows you some control with your choices, and can be used for things like harvest commands where certain foods are worth more, or commands with failure rates (like .crime or .stealcookie).

✎ if this, then that.

  • in essence, locked choices are a way to correspond an answer to whatever choice is chosen in the {choose:} variable.

  • for example, using the variables{choose: a | b | c} followed by {lockedchoose: 1 | 2 | 3}, would make it so whenever "a” is chosen, "1" would also be chosen as it's in the corresponding spot.

  • this is because the order of the choice chosen in {choose:} will lock the choice in the {lockedchoose:}.

  • let's take a quick example:

/autoresponder add trigger:.stealfood reply:{choose: apple | nothing | pie} {lockedchoose: 100 | 0 | 500}{modifybal:[lockedchoice]} you stole [choice] and earned [lockedchoice]

you should always list your choices in {choose:} before using the {lockedchoose:}variable. mimu needs to pick a value in your choose before forcing the locked choice.

  • keep in mind that in order to reference your designated locked choice, you can use the [lockedchoice] placeholder.

  • in this example, you can see that whenever pie is chosen, 500 is also chosen due to it being locked to the choices.

  • you can also think of this like a slot. the slots in choose and locked choose match up.

  • in slot one of choose is apple, while in slot one of locked choose is 100. slot two of choose is nothing, so therefore in slot two of locked choose is 0. and so on and so forth.

for as many choices, there should be the same amount of locked choices. if you're listing 5 choices, you must have 5 locked choices. otherwise, mimu will throw an error at you.

✎ using multiple locked choices

  • similar to choice, you can have up to 4 locked choices with 4 choices.

  • you can do this similarly to choose{choose:} {lockedchoose:} {choose1:} {lockedchoose1:} {choose2:} {lockedchoose2:}{choose3:} {lockedchoose3:}

  • the corresponding placeholders are exactly what you think they will be.[lockedchoice][lockedchoice1][lockedchoice2][lockedchoice3]

Last updated