intermediate i: ranges and making choices
Last updated
Was this helpful?
Last updated
Was this helpful?
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.
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.
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]
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.
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]
.
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.