[Twitch] Autoreply for * arg1 * arg2 * - 08/03/18 10:05 AM
Okay. I want to do sth like this.
on *:TEXT:*ARG1*ARG2*:#: {
if (ARG1 == sth || ARG1 == sthelse) {
if (ARG2 == adjective1) { msg $chan Such reply }
elseif (ARG2 == adjective2) { msg $chan Different reply } }
elseif (ARG1 == another)
etc etc
So You can see, I want it to be specific arguments 1 and 2, done by if statement, but I want it to let people wrote sth before, between and after it.
It would be like
Hey, do You know argument 1 is very argument 2?
It should recognize argument 1 and 2 between words and reply to it.
I can do if statement if there is just one argument. just type :TEXT:*:#: and then I can set $2 in if. But with what I want, I don't know which argument will it be. Second, third, fifth. So what can I do?
I did such thing:
on *:TEXT:*:#: {
if ($1 == Thing) { msg $chan It works }
}
And this works... but only iw Thing is first argument. And I don't want it to be always first. Also I would like argument1 being a string. So like "Some argument".
How to do it? i tried variables, tryign to put $1-, $1+, $n, everything I know. But nothing works.
on *:TEXT:*ARG1*ARG2*:#: {
if (ARG1 == sth || ARG1 == sthelse) {
if (ARG2 == adjective1) { msg $chan Such reply }
elseif (ARG2 == adjective2) { msg $chan Different reply } }
elseif (ARG1 == another)
etc etc
So You can see, I want it to be specific arguments 1 and 2, done by if statement, but I want it to let people wrote sth before, between and after it.
It would be like
Hey, do You know argument 1 is very argument 2?
It should recognize argument 1 and 2 between words and reply to it.
I can do if statement if there is just one argument. just type :TEXT:*:#: and then I can set $2 in if. But with what I want, I don't know which argument will it be. Second, third, fifth. So what can I do?
I did such thing:
on *:TEXT:*:#: {
if ($1 == Thing) { msg $chan It works }
}
And this works... but only iw Thing is first argument. And I don't want it to be always first. Also I would like argument1 being a string. So like "Some argument".
How to do it? i tried variables, tryign to put $1-, $1+, $n, everything I know. But nothing works.