intermediate i: ranges and making choices

✎ why use a range or make mimu choose?

  • sometimes, you want varying amounts or varying responses to switch things up!

  • this allows you to expand and teach mimu to make random responses or amounts.

variables used in here are also mentioned in the variables list.

✎ the range variable

♪ choosing from a range of numbers

let's take an example currency command we've made from beginner ii: using simple functions.

/autoresponder add trigger:give me 10 reply:{modifybal:+10} {cooldown:60} okay, i've given you 10 {server_currency}, you have {user_balance} now!

  • as you can see, this example only gives you 10 currency. but what if we wanted mimu to give an amount between 10-100 instead?

  • we can use the {range:} variable to do this! let's look at this:

/autoresponder add trigger:give me more reply:{range:10-100} {modifybal:[range]} {cooldown:60} okay, i've given you [range] {server_currency}, you have {user_balance} now!

  • the {range:} variable takes an input of a minimum to maximum amount which returns a range of numbers.

  • once mimu decides, it stores the number chosen from the range into [range].

  • that way, you can use [range] as a placeholder in the rest of your AR.

it is vital that you put the {range:} variable before using [range]. this is because you need to have mimu choose between the range before you can refer to the chosen number from the range.

♪ using multiple ranges

  • you can use multiple ranges, up to a total of 4 of them.

  • you can do so by {range:} {range1:} {range2:} {range3:}.

  • and just as you'd expect, the corresponding placeholders are [range] [range1] [range2] [range3].

here's an example!

/autoresponder add trigger:choose numbers reply:{range:1-10} {range1:10-20} {range2:20-30} {range3:30-40} a number from 1 to 10: [range] a number from 10 to 20: [range1] a number from 20 to 30: [range2] a number from 30 to 40: [range3]

✎ the choose variable

♪ choosing from a list of choices

  • using the {choose:} function, you can make mimu choose from a list of predefined variables.

  • let's take an example. maybe you'd like mimu to choose between "pancakes", "cookies" or "yogurt".

/autoresponder add trigger:.chooseforme reply:{choose:pancakes|cookies|yogurt} i choose [choice]!

  • as you can see, the {choose:} variable takes an input of choices separated with the pipe | symbol

  • once mimu decides, it stores the result in the variable [choice].

  • that way, you can use [choice] as a placeholder for the rest of the AR.

  • by manipulating the number of times the choice is mentioned in the variable, you can also vary the "rarity" of a response.

similarly, remember to use {choose:} before [choice]! this is to make sure it chooses before it shows the choice. otherwise, you will get the CHOICE_NOT_CHOSEN_YET error.

♪ making several choices

  • similar to ranges, you can have mimu make more choices, up to 4 of them.

  • you can do so by {choose:} {choose1:} {choose2:} {choose3:}.

  • and just as you'd expect, the corresponding placeholders are [choice] [choice1] [choice2] [choice3].

✎ extended - doing weird stuff

this part is just for people who want to go above and beyond in complicating things. feel free to skip if this isn't for you.

♪ put a range in a choice or a choice in a range

  • you can put a range in a choice, or a choice in a range, like this:

/autoresponder add trigger:why would you even do this reply:{range:1-5} {range1: 10-20} {range2:30-50} {range3:1000-10000} {choose:[range]|[range]|[range]|[range1]|[range1]|[range1]|[range2]|[range2]|[range3]} {modifybal: [choice]} you earned [choice] {server_currency}

  • although extremely complex, this allows you to make some ranges rarer than others. in this example, [range] is more likely than [range1] which is more likely than [range2] and so on.

  • similarly, remember to put your {range:} variables BEFORE using the corresponding [range] in the {choose:} variable.

Last updated