| View previous topic :: View next topic |
| Author |
Message |
K3rN3L_P4nIC Voice

Joined: 17 Nov 2006 Posts: 6
|
Posted: Sat Nov 18, 2006 4:56 pm Post subject: check my little tcl script |
|
|
This scrip intention is a kickban and msg to any nick obtains op from my channel, the nick obtain @ is different to nick access op, for example:
Nick access op official is Jagger, but the boy entry on chan using other nick then bot baned this nick. This is the code:
| Code: | set chanservices "ChanServ@services.dal.net"
set commandwhy "WHY"
set nickchans "Chanserv"
set nickaops {
"nick1"
"nick2"
"nick3"
"nicknn"
}
bind mode - "#iquitos +o" bot:checkop
bind notc - "*" bot:checkwhy
proc bot:checkop {nick host hand chan mode target} {
global chanservices commandwhy nickchans
if {[string compare -nocase $::botnick $target] == 0} {return}
if {[string compare -nocase $nickchans $nick] != 0} {return}
putserv "PRIVMSG $chanservices :$commandwhy $chan $target"
}
proc bot:checkwhy {nick host hand text dest} {
global nickaops
foreach nickaop $nickaops { if {([string match -nocase *$nickaop* $nick])} {return}
if {[string compare -nocase "ChanServ" $nick] !=0} {return}
foreach nickaop $nickaops { if {([string match -nocase *$nickaop* $nick])} {return}
puthelp "PRIVMSG $nick :You are using a nick no equal to nick access on the chan"
putquick "MODE $chan +b $nick"
putquick "KICK $chan $nick :Change your nick and rejoin"
}
} |
|
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Sun Nov 19, 2006 1:58 pm Post subject: |
|
|
Begin with properly indenting the code.
And your foreach's don't appear to be right at all. |
|
| Back to top |
|
 |
K3rN3L_P4nIC Voice

Joined: 17 Nov 2006 Posts: 6
|
Posted: Tue Nov 21, 2006 5:20 pm Post subject: |
|
|
Hi again, this a new code:
| Code: | set chans_bop "*"
set chanservices "ChanServ@services.dal.net"
set commandwhy "WHY"
set nickchans "Chanserv"
set nickaops {
"nick1"
"nick2"
"nick3"
"nicknn"
}
bind mode - "*+*o*" bot:checkop
bind notc - "*" bot:checkwhy
proc bot:checkop:checkop {nick host hand chan mode target} {
if {[string compare -nocase $::botnick $target] == 0} {return}
if {[string compare -nocase "ChanServ" $nick] != 0} {return}
putserv "CHANSERV WHY $chan $target"
}
proc bot:checkwhy {nick host hand text dest} {
global botnick nickaops nickchans
if {(([lsearch -exact [string tolower $chans_bop] [string tolower $chan]] != -1) || ($chans_bop == "*"))} {
foreach nickaop $nickaops { if {([string match -nocase *$nickaop* $botnick])} {return}
foreach nickaop $nickaops { if {([string match -nocase *$nickaop* $nickchans])} {return}
foreach nickaop $nickaops { if {([string match -nocase *$nickaop* $nick])} {return}
puthelp "PRIVMSG $nick :Ud, no esta usando su nick de AOP/SOP no esta permitido, se le dio el acceso a un nick determinado, por favor cambiese de nick"
putquick "MODE $chan +b $nick"
putquick "KICK $chan $nick :Pongase su nick de OP"
}
}
}
} |
|
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Tue Nov 21, 2006 6:00 pm Post subject: |
|
|
| Quote: | | Nick has AOp access to #Channel. Reason: Identification to the nickname Nick. |
The above is the DALnet ChanServ response to a "why" trigger. You do not appear to be checking this, instead a procedure is triggered on any response from ChanServ.
| Code: | | proc bot:checkop:checkop {nick host hand chan mode target} |
The above is incorrect. Try:
| Code: | | proc bot:checkop {nick host hand chan mode target} |
You could improve the procedure.
| Code: | set chanserv "chanserv@Services.dal.net"
setudef flag chk.access
proc bot:checkop {nick host hand chan mode target} {
if {$target == $::botnick} {
if {[channel get $chan chk.access]} {
putserv "PRIVMSG $::chanserv :why $chan $nick" -next
}
}
} |
_________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
|