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 

need help with a ban script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Danik
Halfop


Joined: 15 Jun 2008
Posts: 49
Location: Moldova

PostPosted: Mon Aug 18, 2008 10:27 am    Post subject: need help with a ban script Reply with quote

Code:
bind pub o|o !n pub:nickne

proc pub:nickne {nick uhost hand chan txt} {
  set txt [split $txt]
  set who [lindex $txt 0]
  if {[isbotnick $who]} { return }
  if {[llength $txt] > 1} {
    set reason [join [lrange $txt 1 "end"]]
  } else {
    set reason "($nick) Bad nickname, please change it and rejoin the channel!!"
  }
  set x "X"
  putmsg $x "kick $chan $who $reason"
  putkick $chan $who $reason
  return 1
}



ok this is the problem ... when I type on channel !n <nick> ... the eggdrop bans users IP (mask)...

Can someone change this script so the eggdrop won't ban the mask, but just the nickname (ex: nick*!*@* )
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Mon Aug 18, 2008 12:01 pm    Post subject: Reply with quote

Code:
#set the ban-time. (0 = perm)
set eggbantime "60"

bind pub o|o !n pub:nickne

proc pub:nickne {nick uhost hand chan txt} {
  global botnick eggbantime
  set txt [split $txt]
  set who [lindex $txt 0]
  if {[isbotnick $who]} { return }
  if {[llength $txt] > 1} {
    set reason [join [lrange $txt 1 "end"]]
  } else {
    set reason "($nick) Bad nickname, please change it and rejoin the channel!!"
  }
 set mask $who*!*@*
  set x "X"
  newchanban $chan $mask $botnick $reason $eggbantime
  putmsg $x "kick $chan $who $reason"
  putkick $chan $who $reason
  return 1
}


no tested, try it.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Danik
Halfop


Joined: 15 Jun 2008
Posts: 49
Location: Moldova

PostPosted: Mon Aug 18, 2008 1:09 pm    Post subject: Reply with quote

Nor7on wrote:
Code:
#set the ban-time. (0 = perm)
set eggbantime "60"

bind pub o|o !n pub:nickne

proc pub:nickne {nick uhost hand chan txt} {
  global botnick eggbantime
  set txt [split $txt]
  set who [lindex $txt 0]
  if {[isbotnick $who]} { return }
  if {[llength $txt] > 1} {
    set reason [join [lrange $txt 1 "end"]]
  } else {
    set reason "($nick) Bad nickname, please change it and rejoin the channel!!"
  }
 set mask $who*!*@*
  set x "X"
  newchanban $chan $mask $botnick $reason $eggbantime
  putmsg $x "kick $chan $who $reason"
  putkick $chan $who $reason
  return 1
}


no tested, try it.



something is wrong
[20:07] Tcl error [pub:nickne]: invalid command name "б═"
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Mon Aug 18, 2008 1:48 pm    Post subject: Reply with quote

Code:
set eggbantime "60"

proc ban:nick {nick uhost hand chan text} {
    global botnick eggbantime
     if {[botisop $chan]} {
          if {[string length $text] > 0} {
            set badnick [lindex $text 0]
            if {[onchan $badnick $chan]} {
            set bannick [nick2hand $badnick]
            if {[matchattr $bannick +fo $chan]} {
               putquick "NOTICE $nick :I can't ban $bannick."
               return
            }
                     set reason "($badnick) Bad nickname, please change it and rejoin the channel!!"
             set mask $badnick*!*@*
            putquick "PRIVMSG X :ban $chan $mask 2 100 $reason"
                 newchanban $chan $mask $botnick $reason $eggbantime
            } else {
            puthelp "notice $nick :no such nick on channel!"
         }
          } else {
         puthelp "NOTICE $nick :!n <nick>"
      }
     } else {
      puthelp "NOTICE $nick :No tengo OP."
   }
}   


try it work, tested in my eggdrop's.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Danik
Halfop


Joined: 15 Jun 2008
Posts: 49
Location: Moldova

PostPosted: Mon Aug 18, 2008 2:12 pm    Post subject: Reply with quote

Nor7on wrote:
Code:
set eggbantime "60"

proc ban:nick {nick uhost hand chan text} {
    global botnick eggbantime
     if {[botisop $chan]} {
          if {[string length $text] > 0} {
            set badnick [lindex $text 0]
            if {[onchan $badnick $chan]} {
            set bannick [nick2hand $badnick]
            if {[matchattr $bannick +fo $chan]} {
               putquick "NOTICE $nick :I can't ban $bannick."
               return
            }
                     set reason "($badnick) Bad nickname, please change it and rejoin the channel!!"
             set mask $badnick*!*@*
            putquick "PRIVMSG X :ban $chan $mask 2 100 $reason"
                 newchanban $chan $mask $botnick $reason $eggbantime
            } else {
            puthelp "notice $nick :no such nick on channel!"
         }
          } else {
         puthelp "NOTICE $nick :!n <nick>"
      }
     } else {
      puthelp "NOTICE $nick :No tengo OP."
   }
}   


try it work, tested in my eggdrop's.


samo problem
[21:11] Tcl error [ban:nick]: invalid command name "б═б═"
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Mon Aug 18, 2008 2:15 pm    Post subject: Reply with quote

i test this tcl and it work.

Code:

*** tesuser ( ~Nor7on@21.Red-83-56-233.dynamicIP.rima-tde.net ) Entra al Canal #Nor7on
<Nor7on> !n tesuser
* Chasse pone modo: +b tesuser*!*@*
* tesuser ha sido KICKEADO por Chasse (Banned: (tesuser) Bad nickname, please change it and rejoin the channel!!)


maybe u have other script what do troubles.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Mon Aug 18, 2008 3:05 pm    Post subject: Reply with quote

the solved code for u stranger eggdrop, Laughing

Code:
proc ban:nick {nick uhost hand chan txt} {
  set txt [split $txt]
  set who [lindex $txt 0]
  if {[isbotnick $who]} { return }
  if {[llength $txt] > 1} {
    set reason [join [lrange $txt 1 "end"]]
  } else {
    set reason "($nick) Bad nickname, please change it and rejoin the channel!!"
  }
  if {$who == ""} {
  puthelp "NOTICE $nick : use: !n <nickname>"
   return 0
 }
  putquick "MODE $chan +b $who*!*@*"
  putserv "PRIVMSG X :kick $chan $who $reason"
  putkick $chan $who $reason
  return 1
}


Wink
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Aug 18, 2008 3:35 pm    Post subject: Reply with quote

The error message suggests that the error is not with the script itself, but the editor/environment using an extended locale such as utf-8 or similar. Also, the error is not related to any other scripts, as the function containing the error is the same as provided in the posted code.
_________________
NML_375, idling at #eggdrop@IrcNET
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 -> Script Requests 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