| View previous topic :: View next topic |
| Author |
Message |
Al Voice
Joined: 11 Jul 2009 Posts: 3
|
Posted: Mon Dec 16, 2013 7:50 am Post subject: After split my bot put ban *!*@* |
|
|
After the split of one of the servers, and when he is back online, my bot decided to put a ban on this mask *! * @ *.
I looked all your tcl`s seemingly everything is fine
bother me only one tcl.
Eggdrop version:1.6.21
| Code: |
bind join - "*" badident
proc badident {nick host hand chan} {
if {[matchattr $hand X]} {
putlog "14Защитен потребител:15 $nick ($host)"
return 0
}
if {![isbotnick $nick] && [botisop $chan]} {
if {[regexp {^~[a-z]{1}[0-9]{2,5}$} [lindex [split $host @] 0]]} {
newchanban $chan *!*@[lindex [split $host @] 1] $::botnick "proxyta sa zabraneni" 60
}
}
}
|
|
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Dec 17, 2013 2:18 am Post subject: |
|
|
Most likely it doesn't find find any host to ban.
A quick fix would be replacing:
| Code: |
newchanban $chan *!*@[lindex [split $host @] 1] $::botnick "proxyta sa zabraneni" 60
|
with:
| Code: |
set banMask "*!*@[lindex [split $host @] 1]"
if {![string match -nocase $banMask $::botname]} {
newchanban $chan $banMask $::botnick "proxyta sa zabraneni" 60
}
|
that will match the ban with it's host. the *!*@* will match him and thus avoid banning itself. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Al Voice
Joined: 11 Jul 2009 Posts: 3
|
Posted: Tue Dec 17, 2013 12:34 pm Post subject: |
|
|
| Quote: |
can't read "chan": no such variable
while executing
"botisop $chan"
invoked from within
"if {![isbotnick $nick] && [botisop $chan]} {
if {[regexp {^~[a-z]{1}[0-9]{2,5}$} [lindex [split $host @] 0]]} {
set banMask "*!*@[lindex [spl..."
(file "scripts/ident.tcl" line
invoked from within
"source scripts/ident.tcl"
|
|
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Wed Dec 18, 2013 2:22 am Post subject: |
|
|
How dose the code look like now? It shouldn't give you that error.. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Al Voice
Joined: 11 Jul 2009 Posts: 3
|
Posted: Wed Dec 18, 2013 5:42 am Post subject: |
|
|
| Code: | bind join - "*" badident
proc badident {nick host hand chan} {
}
if {[matchattr $hand X]} {
putlog "14Защитен потребител:15 $nick ($host)"
return 0
}
if {![isbotnick $nick] && [botisop $chan]} {
if {[regexp {^~[a-z]{1}[0-9]{2,5}$} [lindex [split $host @] 0]]} {
set banMask "*!*@[lindex [split $host @] 1]"
if {![string match -nocase $banMask $::botname]} {
newchanban $chan $banMask $::botnick "proxyta sa zabraneni" 60
} |
|
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Wed Dec 18, 2013 6:46 am Post subject: |
|
|
No wonder it's misfiring. Try with this:
| Code: |
bind join - "*" badident
proc badident {nick host hand chan} {
if {[matchattr $hand X]} {
putlog "14Защитен потребител:15 $nick ($host)"
return 0
}
if {[isbotnick $nick] || ![botisop $chan]} return
if {[regexp {^~[a-z]{1}[0-9]{2,5}$} [lindex [split $host @] 0]]} {
set banMask "*!*@[lindex [split $host @] 1]"
if {![string match -nocase $banMask $::botname]} {
newchanban $chan $banMask $::botnick "proxyta sa zabraneni" 60
}
}
}
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
|