mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2006
Posts: 60
S
Babel fish
OP Offline
Babel fish
S
Joined: Aug 2006
Posts: 60
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-
    }
  }
}

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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-
}

Joined: Aug 2006
Posts: 60
S
Babel fish
OP Offline
Babel fish
S
Joined: Aug 2006
Posts: 60
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?

Last edited by Shining_Phoenix; 04/09/07 08:25 AM.
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
using the $show identifier might help you, too.

Joined: Aug 2006
Posts: 60
S
Babel fish
OP Offline
Babel fish
S
Joined: Aug 2006
Posts: 60
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?

Last edited by Shining_Phoenix; 04/09/07 09:30 AM.
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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.

Joined: Aug 2006
Posts: 60
S
Babel fish
OP Offline
Babel fish
S
Joined: Aug 2006
Posts: 60
Works, thanks smile


Link Copied to Clipboard