mIRC Home    About    Download    Register    News    Help

Print Thread
#260520 04/05/17 01:04 PM
Joined: May 2017
Posts: 9
N
nwmv Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
N
Joined: May 2017
Posts: 9
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.

nwmv #260521 04/05/17 01:19 PM
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #260542 10/05/17 10:35 AM
Joined: May 2017
Posts: 9
N
nwmv Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
N
Joined: May 2017
Posts: 9
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.

Last edited by nwmv; 10/05/17 11:22 AM.

Link Copied to Clipboard