|
Joined: Jun 2004
Posts: 124
Vogon poet
|
OP
Vogon poet
Joined: Jun 2004
Posts: 124 |
how can i use the on " *:NICK: " in just a specified channel?
|
|
|
|
noMen
|
noMen
|
It is not possible to change a nick just for one channel, so on *:NICK: will be triggered on every channel for a specific network.
|
|
|
|
Joined: Dec 2002
Posts: 1,995
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,995 |
You could check to see if they're on a specific channel... Change #mychan to your channel name.
on *:NICK: {
if ($newnick ison #mychan) {
; do stuff here
}
}
|
|
|
|
Joined: Jun 2004
Posts: 124
Vogon poet
|
OP
Vogon poet
Joined: Jun 2004
Posts: 124 |
thankz rock for the reply... nomen i think you miss understood my question on *:NICK: {
if ($newnick ison #mychan) {
if (!$hget(badnick)) hmake badnick 20
var %i = 1
while ($gettok($badnick,%i,32)) {
if ($+(*,$gettok($badnick,%i,32),*) iswm $nick) {
if ($nick !isop $nick) {
hinc badnick $nick
var %badnick = $gettok($badnick,%i,32)
if ($hget(badnick,$nick) == 1) do something heere
if ($hget(badnick,$nick) == 2) do another here
}
}
inc %i
}
}
}
i cant make this work...
Last edited by sigbin; 21/05/08 04:46 AM.
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
1) In the ON NICK event, $nick contains the old nick and $newnick contains the new/current nick 2) You use $badnick but there's no way we can check for possible errors in that identifier without seeing the custom alias for it. ie: alias badnick { 3) Invalid IF statement It's impossible for a nick to be opped on a nick.. if you want to see if the nick is oppedk, use if ($newnick !isop #channel) {
|
|
|
|
Joined: Jun 2004
Posts: 124
Vogon poet
|
OP
Vogon poet
Joined: Jun 2004
Posts: 124 |
alias badnick {
return nick1 nick2 nick3
}
on *:NICK: {
if ($newnick ison #mychan) {
if (!$hget(badnick)) hmake badnick 20
var %i = 1
while ($gettok($badnick,%i,32)) {
if ($+(*,$gettok($badnick,%i,32),*) iswm $newnick) {
if ($newnick !isop $chan) {
hinc badnick $newnick
var %badnick = $gettok($badnick,%i,32)
if ($hget(badnick,$newnick) == 1) do something heere
if ($hget(badnick,$newnick) == 2) do another here
}
}
inc %i
}
}
}
how can i make this work in a channel? i just wnt it to detect new nick that was changed... then if it is bad nick my script will kick warn the user....
Last edited by sigbin; 21/05/08 06:54 AM.
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
alias badnick {
return nick1 nick2 nick3
}
on *:NICK: {
if $nick(#mychannel,$newnick,a,o) {
var %i = 1
while $gettok($badnick,%i,32) {
if $+(*,$gettok($badnick,%i,32),*) iswm $newnick {
hinc -m badnick $newnick
var %badnick = $gettok($badnick,%i,32)
if ($hget(badnick,$newnick) == 1) do something here
elseif ($hget(badnick,$newnick) == 2) do another here
}
inc %i
}
}
}
|
|
|
|
Joined: Jun 2004
Posts: 124
Vogon poet
|
OP
Vogon poet
Joined: Jun 2004
Posts: 124 |
how about if i want to remove this elseif ($hget(badnick,$newnick) == 2) do another here
no more another do?
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
that's fine...you can remove that, or add others using the same format.. I simply used that to show that you're not stuck with only the one if possibility.
|
|
|
|
|