mIRC Home    About    Download    Register    News    Help

Print Thread
#250141 04/01/15 02:10 AM
Joined: Jan 2015
Posts: 2
R
Bowl of petunias
OP Offline
Bowl of petunias
R
Joined: Jan 2015
Posts: 2
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

Rmont9613 #250150 04/01/15 02:56 AM
Joined: Mar 2014
Posts: 215
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
$<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---


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
judge2020 #250151 04/01/15 02:59 AM
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
The $ prefix denotes a regex match, /regex/Si is a case insensitive match that strips control codes.

judge2020 #250152 04/01/15 03:06 AM
Joined: Jan 2015
Posts: 2
R
Bowl of petunias
OP Offline
Bowl of petunias
R
Joined: Jan 2015
Posts: 2
So, If I were to do:
on *:TEXT:!test:#:{
msg $2
}

Assuming the user entered "!test abcabc", should that print abcabc?

Rmont9613 #250155 04/01/15 04:41 AM
Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
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
}


Link Copied to Clipboard