mIRC Homepage
Posted By: Shining_Phoenix on *:INPUT and /. /! /!. commands - 04/09/07 07:44 AM
This is my first on input event, still under construction. I have /say, /me, /msg and /describe aliases which change how text I send is echoed back to me. I want /.command, //command and //.command instances of mIRC commands I've aliased to act just like the mIRC command, ie /.msg will send a message quietly etc. The only method I can think of right now is adding /.msg, /.say, //msg, //.msg, ...aliases which would suck, and I'm not sure if that's doable either. Any help is greatly appreciated!
Code:
on *:INPUT:*: {
  if (%os.input == on) {
    haltdef
    if ($ctrlenter) goto blah
    if ($left($1,1) == $chr(47)) {
      if ($mid($1,2,1) == $chr(47)) {
        if ($mid($1,3,1) == $chr(47)) {
          ;///
          $1-
        }
        elseif ($mid($1,3,1) == $chr(33)) {
          ;//!
          $1-
        }
        elseif ($mid($1,3,1) == $chr(46)) {
          if ($mid($1,4,1) == $chr(33)) {
            ;//.!
            * Sorry, //.! doesn't work. Try //!.
          }
          else {
            ;//.
            if (($1 == //.say) || ($1 == //.msg) || ($1 == //.me) || ($1 == //.describe)) {
              $1-     
            }
            else {
              $1-
            }
          }
        }
      }
      elseif ($mid($1,2,1) == $chr(47)) {
        ;//
        $1-
      }
      elseif ($mid($1,2,1) == $chr(33)) {
        if ($mid($1,3,1) == $chr(46)) {
          ;/!.
          $1-
        }
        else {
          ;/!
          $1-
        }
      }
      elseif ($mid($1,2,1) == $chr(46)) {
        if ($mid($1,3,1) == $chr(33)) {
          ;/.!
          echo -cat info * Sorry, /.! doesn't work. Try /!.
        }
        else {
          ;/.
          if (($1 == /.say) || ($1 == /.msg) || ($1 == /.me) || ($1 == /.describe)) {
            $1-     
          }
          else {
            $1-
          }
        }
      }
      else {
        ;/
        $1-
      }
    }
    else {
      :blah
      ;doesn't start with /
      msg $active $1-
    }
  }
}
Posted By: hixxy Re: on *:INPUT and /. /! /!. commands - 04/09/07 07:50 AM
You don't even need to use an on input event, you can just use something like this:

Code:
alias say { 
  .msg $chan $1-
  echo -abcfilmqrt own $+(<,$nick($chan,$me).pnick,>) $1-
}
Uhh...in aliases:
Code:
say msg $active $1-
msg {
  haltdef
  !.msg $1-
  loads of stuff here
}

When I disable the on input event, my message is echoed back normally by mIRC, despite the fact that I have /say and /msg aliases. I do not want to type /say every time I say something. Is your solution mIRC 6.3 specific?
Posted By: Horstl Re: on *:INPUT and /. /! /!. commands - 04/09/07 08:52 AM
using the $show identifier might help you, too.
Originally Posted By: Horstl
using the $show identifier might help you, too.

Thanks! That solves the /. issue.

What about differentiating between / and // and making the alias act accordingly?
Posted By: hixxy Re: on *:INPUT and /. /! /!. commands - 04/09/07 11:24 AM
Well what you could do is something like this:

Code:
alias say { 
  if ($istok(channel query chat,$window($active).type,32)) {
    .msg $active $1-
    echo -abcfilmqrt own $+(<,$iif($chan,$nick($v1,$me).pnick,$me),>) $1-
  }
}
on *:input:*:{
  if (!$istok(/ $readini($mircini,text,commandchar),$left($1,1),32)) || ($ctrlenter) || ($inpaste) { 
    say $1-
    haltdef
  }
}


..If all you're trying to do is change the way your own messages appear.

I'm not 100% sure what you're trying to do, your code is like spaghetti.
Works, thanks smile
© mIRC Discussion Forums