mIRC Home    About    Download    Register    News    Help

Print Thread
#196898 24/03/08 11:11 PM
Joined: Mar 2008
Posts: 47
N
nok Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2008
Posts: 47
Because it does not work in private?

Code:

on 1:INPUT:*: {
  if (/ !isin $1) {
    IF $me ISOP $chan ECHO -ti15 $chan 2,9* $+ $str($chr(160),$calc(10-$len($me)))) <@ $+ $me $+ > $1- 
    IF $me ISHOP $chan ECHO -ti15 $chan 2,9* $+ $str($chr(160),$calc(10-$len($me)))) <% $+ $me $+ > $1- 
    IF $me ISVOICE $chan ECHO -ti15 $chan 2,9* $+ $str($chr(160),$calc(10-$len($me)))) <+ $+ $me $+ > $1- 
    IF $me ISREG $chan ECHO -ti15 $chan 2,9* $+ $str($chr(160),$calc(11-$len($me)))) < $+ $me $+ > $1- 
    .msg $active $1-
    halt
  }
}
on 1:INPUT:?: {
  if (/ !isin $1) {
    ECHO -a 2,9* $+ $str($chr(160),$calc(11-$len($me)))) < $+ $me $+ > $1- 
    .msg $active $1-
    halt
  }
}


nok #196900 24/03/08 11:17 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Don't have two on Input events, try and determine if the active window is a query and go from there. smile

Code:
alias isquery {
  return $iif($window($1).type == query,$true,$false)
}

on 1:INPUT:*: {
  if (/ !isin $1) {
    if ($isquery($active)) {
      ECHO -a 2,9* $+ $str($chr(160),$calc(11-$len($me)))) < $+ $me $+ > $1-
    }
    else {
      IF $me ISOP $chan ECHO -ti15 $chan 2,9* $+ $str($chr(160),$calc(10-$len($me)))) <@ $+ $me $+ > $1- 
      IF $me ISHOP $chan ECHO -ti15 $chan 2,9* $+ $str($chr(160),$calc(10-$len($me)))) <% $+ $me $+ > $1- 
      IF $me ISVOICE $chan ECHO -ti15 $chan 2,9* $+ $str($chr(160),$calc(10-$len($me)))) <+ $+ $me $+ > $1- 
      IF $me ISREG $chan ECHO -ti15 $chan 2,9* $+ $str($chr(160),$calc(11-$len($me)))) < $+ $me $+ > $1- 
    }
    .msg $active $1-
    halt
  }
}

Last edited by SladeKraven; 24/03/08 11:30 PM.
nok #196902 24/03/08 11:33 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
It doesn't work in private, because the first ON INPUT event uses the wildcard *. This causes the first ON INPUT event to work in all cases. Since you obviously want that for channel usage, change the * to # and the two will work fine.

Alternatively, combining the two into one event, and maintaining the * wildcard, would also require checking if $chan has a value, since it will for channel input, but not for pm input.

SladeKraven #196903 25/03/08 12:15 AM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
the isquery alias is a little overkill, you can just check if $chan is the target window


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
argv0 #196905 25/03/08 12:29 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
True, but in some cases it could be useful? smile


Link Copied to Clipboard