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.

channel notice protect problem

Old posts that have not been replied to for several years.
Locked
e
e-force
Voice
Posts: 23
Joined: Tue Jan 04, 2005 7:10 pm

channel notice protect problem

Post by e-force »

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: Select all

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."
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

From Tcl-commands.doc:

Code: Select all

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.
e
e-force
Voice
Posts: 23
Joined: Tue Jan 04, 2005 7:10 pm

Post by e-force »

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.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

eggdrop 1.4.5? A bit ancient aren't we?
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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: Select all

#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.
==================================
e
e-force
Voice
Posts: 23
Joined: Tue Jan 04, 2005 7:10 pm

Post by e-force »

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
Locked