| View previous topic :: View next topic |
| Author |
Message |
e-force Voice
Joined: 04 Jan 2005 Posts: 23
|
Posted: Wed Aug 24, 2005 11:39 am Post subject: channel notice protect problem |
|
|
Hi there! I have a problem with a tcl script which is working in other version bots.I`m using version 1.4.5 eggdrop and have an error when load that script. Error: Tcl error [NoticeBan]: wrong # args: should be "NoticeBan nick handle uhost dest text"
this is the script:
| Code: | set chanz "#somechannel"
# 1 - kick 2 - server ban 3 - local ban, 4 - global ban
set punishm "3"
set kickr "Don't use channel notice, \002only\002 channel ops(@)/voices(+) can use it."
set bantype "1"
# Ban reason
set banr "You may \002NOT\002 use channel notice."
# Ban time in mins, 0 = perm ban, will be used only if you set punishm to 3 or 4
set btime "120"
bind NOTC - * NoticeBan
proc NoticeBan {nick handle uhost dest text} {
global botnick punishm kickr banr btime chanz bantype
if {(![validchan $dest]) || (![botisop $dest])} { return 0 }
if {[matchattr $nick mo|mo $dest] || [isop $nick $dest] || [isvoice $nick $dest] || [matchattr $nick o|o $dest]} {return 0}
if {([isbotnick $nick]) || ([string tolower $nick] == "chanserv") || (![onchan $nick $dest])} {return 0}
if {($chanz != "") && ([lsearch -exact [split [string tolower $chanz]] [string tolower $dest]] == -1)} {return 0}
if {$punishm != "1"} {
switch -- $bantype {
1 { set banmask "*!*@[lindex [split $uhost @] 1]" }
2 { set banmask "*!$uhost" }
3 { set banmask "*!*$uhost" }
4 { set banmask "*![lindex [split $uhost @] 0]@*" }
5 { set banmask "*!*[lindex [split $uhost @] 0]@*" }
6 { set banmask "$nick!*@*" }
7 { set banmask "$nick![lindex [split $uhost @] 0]@*" }
8 { set banmask "$nick!$uhost" }
9 { set banmask "$nick!*$uhost" }
10 { set banmask "$nick!*@[lindex [split $uhost @] 1]" }
default { set banmask "*!*@[lindex [split $uhost @] 1]" }
return $banmask
}
}
if {$punishm == "1"} {
putserv "KICK $dest $nick :$kickr"
}
if {$punishm == "2"} {
putserv "MODE $dest +b $banmask"
putserv "KICK $dest $nick :$kickr"
}
if {$punishm == "3"} {
newchanban "$dest" "$banmask" "NoticeBan" "$banr done by (\002$nick\002!$uhost)" "$btime"
putserv "KICK $dest $nick :$kickr"
}
if {$punishm == "4"} {
newban "$banmask" "NoticeBan" "$banr done by (\002$nick\002!$uhost)" "$btime"
putserv "KICK $dest $nick :$kickr"
}
return 1
}
putlog "\037N\037oticeBan1.1 by Pulse has been loaded."
|
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Aug 24, 2005 12:07 pm Post subject: |
|
|
From Tcl-commands.doc:
| Code: | NOTC (stackable)
bind notc <flags> <mask> <proc>
procname <nick> <user@host> <handle> <text> <dest>
Description: dest will be a nickname (the bot's nickname,
obviously) or a channel name. mask is matched against the entire
notice and can contain wildcards. It is considered a breach of
protocol to respond to a /notice on IRC, so this is intended for
internal use (logging, etc.) only. Note that server notices do not
trigger the NOTC bind.
New Tcl procs should be declared as
proc notcproc {nick uhost hand text {dest ""}} {
global botnick; if {$dest == ""} {set dest $botnick}
...
}
for compatibility. |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
e-force Voice
Joined: 04 Jan 2005 Posts: 23
|
Posted: Wed Aug 24, 2005 3:33 pm Post subject: |
|
|
| I`ve tried many methods but nothing work... can someone give me working tcl script for eggdrop 1.4.5, which will kick ban user who make CHANNEL notice.Nothing else. |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Wed Aug 24, 2005 4:40 pm Post subject: |
|
|
| I don't think you've tried anything, I also think you don't know and you don't want to learn Tcl, and I think you are on the wrong forum |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Wed Aug 24, 2005 7:56 pm Post subject: |
|
|
eggdrop 1.4.5? A bit ancient aren't we? _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Wed Aug 24, 2005 8:58 pm Post subject: |
|
|
Yeah the eggdrop1.4.x series is quite obsolete. Anyway here is a script I use to remove people who send notices to a channel.
| Code: |
#Channels where the notice script is supposed to work on.
set noticechans "#eggdrops #lcas #awyeah"
bind notc - "*" chan:notice:kick
proc chan:notice:kick {nick uhost hand text {chan ""}} {
global botnick noticechans notice_lock server
if {[string match "*ChanServ*" $text] || [string equal "ChanServ" $nick] || [string match "*Server flood protection activated*" $text] || [string match "*.dal.net" $nick] || [string equal $nick $server] || [string equal "*" [lindex [split $uhost @] 1]] || [string equal "*@*" $uhost]} { return 0 }
if {([lsearch -exact [string tolower $noticechans] [string tolower $chan]] == -1) || ![botisop $chan] || [isbotnick $nick] || [isop $nick $chan] || [isvoice $nick $chan]} { return 0 }
if {![info exists notice_lock($chan)] && ![string match *m* [getchanmode $chan]]} {
putquick "MODE $chan +mR-k notice.lock" -next
set notice_lock($chan) "locked"
utimer 8 [list putquick "MODE $chan -mR" -next]
utimer 10 [list unset notice_lock($chan)]
}
putquick "MODE $chan +b *!*@[lindex [split $uhost @] 1]" -next
timer 180 "pushmode $chan -b *!*@[lindex [split $uhost @] 1]"
putquick "KICK $chan $nick :0,1 Channel Notice Kick 12,0 - The usage of 2*notices* 12in this channel 2is prohibited." -next
foreach user [chanlist $chan] {
if {[string match -nocase "*!*@[lindex [split $uhost @] 1]*" "${user}![getchanhost $user $chan]"] && ![isop $user $chan] && ![isvoice $user $chan]} {
putquick "KICK $chan $user :BANNED: You are terminated - Copyright © 2005 awyeah Inc. All rights reserved." -next
}
}
}
|
_________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
e-force Voice
Joined: 04 Jan 2005 Posts: 23
|
Posted: Thu Aug 25, 2005 8:31 am Post subject: |
|
|
| Tnx, it donesn`t work, but i`ll check in ver 1.6.x! Maybe the problem is in some other tcl ... i don`t know yet, when i have the solutions will tell you. Tnx again for helping |
|
| Back to top |
|
 |
|