mIRC Homepage
Posted By: nwmv A Few Things - 04/05/17 01:04 PM
Hi all smile I need help with a few things.

on *:text:*:#: {
if (a b isin $rawmsg) {
msg # c b
}
}

Here's what I currently have.
What I want to do is when someone writes a message and it has 'a b' where a is the constant and b is an undefined word, I want to copy b and put it in my own msg #.

For example: User writes 'a 123'
I would reply 'c 123'

I would also like to know how to make it specific to 'a b' rather than if the user writes something like s3a b129 and it registers because 'a b' is technically there.
Posted By: Wims Re: A Few Things - 04/05/17 01:19 PM
if ($(a &) iswm $1-) { }

iswm is the wildcard operator, '&' is a wildcard matching a word, $() is required because '&' itself can be an operator and mIRC would think you are doing if (a & iswm $1-)

Of course, typically, we put this as the match text of the event:

on *:text:a &:#:{

and this will only match when the message is of the format "a <word>".
You probably don't need $rawmsg, use $1- to refer to the full message.
Posted By: nwmv Re: A Few Things - 10/05/17 10:35 AM
Thanks for the fast response, I've been busy and couldn't check.
I don't understand how I can then use the & in a msg #.

What about two variables?
I would use something like 4:text:a b:#:{ where 4 is a defined user.
© mIRC Discussion Forums