mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2018
Posts: 1
J
JayBau Offline OP
Mostly harmless
OP Offline
Mostly harmless
J
Joined: Jun 2018
Posts: 1
I just started using IRC, and it was so cool that I was able to create an autocolored text on input.

ON *:INPUT:*: {
msg $chan 9,1 $$1 $2-
halt
}

But I realized that I messed up, this means /join or any command won't work.

How can I update my script to detect if the input starts with a slash? Thanks in advance.

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
You can use
if (/* !iswm $1) msg $chan message with annoying colors
or
if ($left($1,1) != /) msg $chan message with annoying colors

You may find you want to check whether $ctrlenter is $true or $false to see whether your input was normal or was due to using Control+Enter.

You'll quickly find that everyone else is annoyed because you're overriding the colors *they* want to see. If you want to change the way you see the message without actually sending the color code for everyone else to see, you can echo the text to yourself the way you want to see it but use the "." prefix to hide the display from a /command.

Code:
if ((/* !iswm $1) && ($ctrlenter == $false)) {
  .msg $chan $1-
  echo -t $chan $+(<,$nick($chan,$me).pnick,>) message with colors
}

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
you can also use

Code:
if (!$inpaste) && (!$ctrlenter) && ($comchar !== $left($1,1)) { }


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
If you use mirc-options/other/command-prefix to change the / to another character, mIRC treats that as a supplemental Command Prefix but still recognizes / as a valid Command Prefix too. If I change Command Prefix to the @ character, these both do the same thing in the editbox:

Code:
@@echo -a test $version $comchar $inpaste $ctrlenter
//echo -a test $version $comchar $inpaste $ctrlenter

So you can adapt the statement further:
Code:
if ((!$inpaste) && (!$ctrlenter) && ($left($1,1) isincs / $+ $comchar)) { msg $chan $chr(3) $+ 14,4 $1-}


Link Copied to Clipboard