egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

After split my bot put ban *!*@*

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Al
Voice


Joined: 11 Jul 2009
Posts: 3

PostPosted: Mon Dec 16, 2013 7:50 am    Post subject: After split my bot put ban *!*@* Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Tue Dec 17, 2013 2:18 am    Post subject: Reply with quote

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
View user's profile Send private message
Al
Voice


Joined: 11 Jul 2009
Posts: 3

PostPosted: Tue Dec 17, 2013 12:34 pm    Post subject: Reply with quote

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 Cool
invoked from within
"source scripts/ident.tcl"
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Wed Dec 18, 2013 2:22 am    Post subject: Reply with quote

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
View user's profile Send private message
Al
Voice


Joined: 11 Jul 2009
Posts: 3

PostPosted: Wed Dec 18, 2013 5:42 am    Post subject: Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Wed Dec 18, 2013 6:46 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber