This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Help for those learning Tcl or writing their own scripts.
Al
Voice
Posts: 3 Joined: Sat Jul 11, 2009 7:16 am
Post
by Al » Mon Dec 16, 2013 7:50 am
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: Select all
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
}
}
}
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Tue Dec 17, 2013 2:18 am
Most likely it doesn't find find any host to ban.
A quick fix would be replacing:
Code: Select all
newchanban $chan *!*@[lindex [split $host @] 1] $::botnick "proxyta sa zabraneni" 60
with:
Code: Select all
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.
Al
Voice
Posts: 3 Joined: Sat Jul 11, 2009 7:16 am
Post
by Al » Tue Dec 17, 2013 12:34 pm
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"
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Wed Dec 18, 2013 2:22 am
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.
Al
Voice
Posts: 3 Joined: Sat Jul 11, 2009 7:16 am
Post
by Al » Wed Dec 18, 2013 5:42 am
Code: Select all
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
}
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Wed Dec 18, 2013 6:46 am
No wonder it's misfiring. Try with this:
Code: Select all
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.