| View previous topic :: View next topic |
| Author |
Message |
Danik Halfop
Joined: 15 Jun 2008 Posts: 49 Location: Moldova
|
Posted: Mon Aug 18, 2008 10:27 am Post subject: need help with a ban script |
|
|
| 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 |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Mon Aug 18, 2008 12:01 pm Post subject: |
|
|
| 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 |
|
 |
Danik Halfop
Joined: 15 Jun 2008 Posts: 49 Location: Moldova
|
Posted: Mon Aug 18, 2008 1:09 pm Post subject: |
|
|
| 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 |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Mon Aug 18, 2008 1:48 pm Post subject: |
|
|
| 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 |
|
 |
Danik Halfop
Joined: 15 Jun 2008 Posts: 49 Location: Moldova
|
Posted: Mon Aug 18, 2008 2:12 pm Post subject: |
|
|
| 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 |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Mon Aug 18, 2008 2:15 pm Post subject: |
|
|
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 |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Mon Aug 18, 2008 3:05 pm Post subject: |
|
|
the solved code for u stranger eggdrop,
| 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
} |
 |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Aug 18, 2008 3:35 pm Post subject: |
|
|
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 |
|
 |
|