mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2015
Posts: 4
C
Self-satisified door
OP Offline
Self-satisified door
C
Joined: May 2015
Posts: 4
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

Joined: Jan 2015
Posts: 168
P
Vogon poet
Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
So you are wanting to make it to where if a specific user types !rejoice it will say, "rejoice to this guy <username>"

Last edited by powerade661; 18/05/15 05:18 PM.
Joined: May 2015
Posts: 4
C
Self-satisified door
OP Offline
Self-satisified door
C
Joined: May 2015
Posts: 4
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.

Joined: Jan 2015
Posts: 168
P
Vogon poet
Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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!
}

Last edited by powerade661; 18/05/15 05:28 PM.
Joined: May 2015
Posts: 4
C
Self-satisified door
OP Offline
Self-satisified door
C
Joined: May 2015
Posts: 4
Thank you very much! Works perfectly!

Joined: Jan 2015
Posts: 168
P
Vogon poet
Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
No problem. smile

Joined: May 2015
Posts: 133
K
Vogon poet
Offline
Vogon poet
K
Joined: May 2015
Posts: 133
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?


twitter @keyeslol
Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
Check $mid-identifier.


Dont give a fish - teach to fish!
Joined: May 2015
Posts: 133
K
Vogon poet
Offline
Vogon poet
K
Joined: May 2015
Posts: 133
Originally Posted By: splinny
Check $mid-identifier.


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


twitter @keyeslol

Link Copied to Clipboard