|
Joined: Mar 2008
Posts: 47
Ameglian cow
|
OP
Ameglian cow
Joined: Mar 2008
Posts: 47 |
Because it does not work in private?
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
}
}
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
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.
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.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
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.
|
|
|
|
Joined: Oct 2003
Posts: 3,918
Hoopy frood
|
Hoopy frood
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"
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
True, but in some cases it could be useful?
|
|
|
|
|