mIRC Homepage
Hello! So I am trying to have some commands where a user can direct the command at someone else. For example, I am trying to have something like "!rejoice Josh" where the bot will output the message as "Rejoice Josh, welcome to the chat!".

Currently my code is:

on *:text:!rejoice:#: {
msg #chan Rejoice $nick , welcome to the chat!
}

Thanks for the help smile
So you are wanting to make it to where if a specific user types !rejoice it will say, "rejoice to this guy <username>"
Yeah, so if someone in chat types !rejoice Cosmicluck, I want to bot to say "Rejoice Cosmicluck, welcome to the chat!", not the username of the person who typed the command.
Ok so someone actually helped me with this as well. The * means anything so you can type Rejoice potato and the bot will return Rejoice potato.

Code:
on *:TEXT:!rejoice *:#: {
  var %nick = $$2
  msg $chan Rejoice, %nick $+ ! is here!
}
Thank you very much! Works perfectly!
No problem. smile
Not directly related to this topic...

I've always wondered, is there anyway to truncate the response to a certain number of characters?

In this example, !rejoice *, if i do !rejoice <insert 255 characters here> the bot will put a wall of text in the channel.

Any way to shorten the length to 16?
Check $mid-identifier.
Originally Posted By: splinny
Check $mid-identifier.


You are awesome! I just tested this and it works as expected! Thank you so much!
© mIRC Discussion Forums