mIRC Homepage
Posted By: Dertikter on INPUT - 20/01/06 10:36 AM
Hi, I've been testing some things with mIRC, customizing it how I like it etc, however, I have found a problem and request some help in resolving it.

Code:
 on 1:INPUT:#:{
  echo -t # 0 $+ OUT : $me : $1-
  haltdef
} 


I currently use that, however I cannot use slash commands, as they just appear as messages.
E.G: If I type /server or /me in a channel window, they will be messages for everyone to see.

Anyone suggest a way around it?

Thanks, Dertikter.
Posted By: Mentality Re: on INPUT - 20/01/06 10:41 AM
You need to use an if statement to check that the line does not start with a /. You can do this by using the iswm operator.

Example:

on *:input:#:{
if (/* !iswm $1-) {
commands
haltdef
}
}


Another common parameter to check is that CTRL+Enter was not pressed. CTRL+Enter is a key combo in mIRC to send lines to a channel that start with a /, without executing it as a command. In this case, change the if statement to:

if (/* !iswm $1-) && (!$ctrlenter) {

See /help if then else for further information smile

Regards,
Posted By: Dertikter Re: on INPUT - 20/01/06 01:21 PM
Thanks, I didn't even think about using wildcards.

Thanks again, Dertikter.
*EDIT*

Another issue that I didn't even think of.. :|
Now that I have echo and haltdef in there, the message never actually gets sent to the server/channel, I put msg $active $1- in there, but now I get the message twice due to the echo, is there a way to "ghost message" where it doesn't show your message but they are still sent, so my echo would effectively show my text?

Thankyou in advance, Dertikter.
Posted By: landonsandor Re: on INPUT - 20/01/06 02:03 PM
To have only the ECHO show your text, use (as in your example):

/.msg $active $1-

The DOT silences the command
Posted By: Dertikter Re: on INPUT - 20/01/06 02:15 PM
Works perfectly, thankyou to you both. smile
© mIRC Discussion Forums