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.

join part

Help for those learning Tcl or writing their own scripts.
Post Reply
e
eggi
Voice
Posts: 11
Joined: Thu Sep 15, 2005 4:45 pm

join part

Post by eggi »

my oper bot dont ban j/p when it s deoped. i use this code

Code: Select all

setudef flag joinpart
bind part - * ban:jp

proc ban:jp {nick uhost hand chan arg} {
  global jp botnick jpchan
  if {[isbotnick $nick] || ![botisop $chan] || ![channel get $chan joinpart]} {
    return
  }
  if {![info exists jpchan($chan)]} {
    set jpchan($chan) 0
  }
  if {($chan == $botnick) || [matchattr $hand b] || [matchattr $hand fom|fom $chan]} {
    return
  }
  if {[getchanjoin $nick $chan] >= [expr {[clock seconds]-$jp(part)}]} {
    set banmask [jp:banmask $uhost $nick]
    putquick "MODE $chan +$jp(lock_modes)b $banmask" 
    putserv "KICK $chan $nick :$jp(reason)"
    utimer $jp(unlock) [list putquick "MODE $chan -$jp(lock_modes)"]
  }
}
C
CrazyEgg
Halfop
Posts: 47
Joined: Thu Jul 28, 2005 4:02 pm

Post by CrazyEgg »

Code: Select all

putquick "MODE $chan +$jp(lock_modes)b $banmask" 
putserv "KICK $chan $nick :$jp(reason)" 
how to make kick or ban?

change that with
privmsg to chanserver(if is undernet then X)
example for undernet:

putserv "PRIVMSG X : ban $chan $banmask <hours> <access> <reason>"

command on undernet is
/msg x ban #chanell <hours> <access level> <reason>
/msg x kick #channel nick

resume:
if bot is deoped ONLY via chanserv commands you can give.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

eggi said oper bot which I presume (for whatever silly reason is an IRCOp).

Change:

Code: Select all

  if {[isbotnick $nick] || ![botisop $chan] || ![channel get $chan joinpart]} {
    return
  }
to:

Code: Select all

  if {[isbotnick $nick] || ![channel get $chan joinpart]} {
    return
  }
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply