Changeset 39


Ignore:
Timestamp:
02/17/08 18:19:56 (4 years ago)
Author:
james
Message:

add ban option

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GuardChan/guardchan.tcl

    r8 r39  
    88# Instructions: 
    99#  - edit the owner setting below to your nick 
     10#  - choose if you want just kicks or bans too 
    1011#  - load script 
    1112#  - for channels you want to protect: .chanset #channel +guardchan 
    1213 
    13 # Only configurable setting (default has invalid char in to make sure you set it) 
     14# (default has invalid char in to make sure you set it) 
    1415set guardchan_owner "YOUR_NICK_HERE%" 
    1516 
     17# set to 1 to ban users rather than just kick them 
     18set guardchan_ban 0 
     19 
    1620# Stop editing here unless you like TCL 
     21# 
     22# 
     23# 
     24# 
     25# 
     26# 
     27# No really, TCL is a world of pain ;) 
    1728 
    1829bind join - *!*@* guardchan_join 
     
    2132 
    2233proc guardchan_join { nick host handle channel } { 
    23   global guardchan_owner 
     34  global guardchan_owner guardchan_ban 
     35 
    2436  if {![channel get $channel guardchan]} { 
    2537    return 0 
     
    2840  if {$handle == "*"} { 
    2941    if [botisop $channel] { 
    30       putkick $channel $nick "You are not permitted to be in here" 
    31       puthelp "PRIVMSG $guardchan_owner :Kicked $nick from $channel" 
     42                        if {!$guardchan_ban} { 
     43                                putkick $channel $nick "You are not permitted to be in here" 
     44                                puthelp "PRIVMSG $guardchan_owner :Kicked $nick from $channel" 
     45                        } else { 
     46                                set ban [maskhost "$nick!$host"] 
     47                                newchanban $channel $ban "guardchan" "Banned for not being in userfile" 
     48                                puthelp "PRIVMSG $guardchan_owner :Banned $nick from $channel" 
     49                        } 
    3250      return 0 
    3351    } else { 
     
    3755  } 
    3856} 
     57 
Note: See TracChangeset for help on using the changeset viewer.