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.

need help with a ban script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
D
Danik
Halfop
Posts: 49
Joined: Sun Jun 15, 2008 12:59 pm
Location: Moldova
Contact:

need help with a ban script

Post by Danik »

Code: Select all

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*!*@* )
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

Code: Select all

#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.
D
Danik
Halfop
Posts: 49
Joined: Sun Jun 15, 2008 12:59 pm
Location: Moldova
Contact:

Post by Danik »

Nor7on wrote:

Code: Select all

#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 "б═"
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

Code: Select all

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.
D
Danik
Halfop
Posts: 49
Joined: Sun Jun 15, 2008 12:59 pm
Location: Moldova
Contact:

Post by Danik »

Nor7on wrote:

Code: Select all

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 "б═б═"
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

i test this tcl and it work.

Code: Select all

*** 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.
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

the solved code for u stranger eggdrop, :lol:

Code: Select all

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:
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
Post Reply