mIRC Homepage

on text help

Posted By: Rmont9613

on text help - 04/01/15 02:10 AM

Hello,

I saw from a tutorial,

on $*:text:/!wins (add|remove)/Si:#:{

to create a command to add wins to a user, I searched the internet and can't find anything on the /Si identifier. What exactly does this mean? And what is the ordering of the variables to reference them in the code. Is add/remove $1, the user is $2 and the value to add being $3?

My point is I would like to make an on text command that takes 2 user names as input but I can't get it to work. Going off the above code I would think it would be something like:

on $*:text:/!battle /Si /Si:#:{

But I can't get this to work or know which is $1 or $2 etc.

Thank you,
Robert
Posted By: judge2020

Re: on text help - 04/01/15 02:56 AM

$<number> identifiers are the parameters to a command, separated by spaces. if you had "!hi bye hello" $1 would be !hi, $2 would be bye, and $3 would be hello. for the poster's nickname, the identifier would be $nick.

PS i have no idea what script uses "on $*:text"... as it seems no nicknames would be able to trigger it, and ...":/!wins (" wouldn't ever be triggered since messages starting with / are commands and won't go through to your own client. that said, you need an alias to check for you to use a command, not an on text event.

---end rant---
Posted By: Loki12583

Re: on text help - 04/01/15 02:59 AM

The $ prefix denotes a regex match, /regex/Si is a case insensitive match that strips control codes.
Posted By: Rmont9613

Re: on text help - 04/01/15 03:06 AM

So, If I were to do:
on *:TEXT:!test:#:{
msg $2
}

Assuming the user entered "!test abcabc", should that print abcabc?
Posted By: Sakana

Re: on text help - 04/01/15 04:41 AM

That will only trigger on exactly "!test" and nothing more. You also need to specify where you're msg'ing to.

Code:
on *:TEXT:!test *:#:{
  msg $chan $2
}
© 2021 mIRC Discussion Forums