and put this xbanpurge.tcl in my eggdrop y get this error and die my eggdrop.
Code: Select all
[08:56] missing close-brace: possible unbalanced brace in comment
while executing
"proc rawit {from keyword arg} {
global xlistdebug xlistchans xlistaccess xlistuser xlistpass xlistban xlistby xlistlevel xlisttimef
if { $from == "X!c..."
(file "/home/nor7on/Modo/current/Xbanpurge.tcl" line 215)
invoked from within
"source $files"
("foreach" body line 3)
invoked from within
"foreach files $qload(filelist) {
if {$files == ""} {return 0}
source $files
}"
("foreach" body line 3)
invoked from within
"foreach type $qload(types) {
set qload(filelist) [glob -directory $qload(datadir) -nocomplain -- $type]
foreach files $qload(filelist) {
if {$fi..."
(file "scripts/quickload.tcl" line 36)
invoked from within
"sourc
[08:56] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
Code: Select all
#####
# Xbanpurge v1.0 by HigH
# 1. What does it do ?
# - it authenticates to X
# - it unbans the eggdrop if banned, treating <75 bans as well
# - it invites the bot through X to channel, if set +i
# - it ops the bot through X if autoop is not set
# - takes the bans from X banlist and places them inside
# - removes them if it finds them again in X's banlist
# 2. How does it work?
# - it adds X as a user internally, with flags +fX, f(friend) and X for bind raw procedures
# - it provides some commands
# - dcc command .xauth which does authentication ( for o|o )
# - dcc command .xlist which does ban purging from X ( for o|o )
# - msg command xbans which returns bans from X by /msging back ( for everybody )
# - msg command bans which returns internal banlist by /msging back ( only for owners )
# 3. What does it NOT do (yet) ?
# - it can be only used on one channel
# - can not clear limit if it's set, because it is a 400 level or more privilege, and i think that
# a little too much for an eggdrop
# - it has some problems when displaying special characters in bans, like *}*@* .. i will fix that soon
#
# 4. Installation
# Place it into /home/of/eggdrop/scripts and add "source scripts/xbanpurge.tcl" at the end of
# config file
#
# For problems, suggestions and complains please mail to solics@yahoo.com or contact me as HigH on undernet
# channel #bucuresti
#####
# Set is as the channel you want to monitor
set xlistchans "#Madrid"
# Set its user to X
set xlistuser "username"
# Set its pass to X
set xlistpass "Password"
# Set this to 0 if the bot does not have autoop to X
set xlistautoop 1
# Set its access to X
set xlistaccess 100
# Set this to how many minutes do you want between checking
set xlisttimer 20
# Set this if you want X to be ignored
set xlistxignore 1
# Set this to 0 if you want some extra infos printed in partyline
set xlistdebug 1
######### Do not modify, unless you know what you are doing #######
set xlistban ""
set xlistlevel ""
set xlistby ""
set xlisttimef ""
set xlistauthed 0
# This analyzes the raw NOTICEs coming from X
proc xlistraw { from keyword text } {
global xlistauthed xlistautoop xlistchans xlistuser xlistpass botnick xlistdebug
if { $from == "X!cservice@undernet.org" } {
if { [string match "*You must be logged in to use this command*" $text] } {
if { $xlistdebug == "1" } {putlog "We are not logged in to X."}
putquick "ISON X"
set xlistauthed 0
return 2
}
if { [string match "*AUTHENTICATION SUCCESSFUL as*" $text] } {
if { $xlistdebug == "1" } {putlog "We are just authenticated."}
set xlistauthed 1
return 3
}
if { [string match "*are not authorised with me anymo*" $text] } {
if { $xlistdebug == "1" } {putlog "Somebody has just used our pass to X, reauthenticating ..."}
putquick "ISON X"
set xlistauthed 0
return 4
}
if { [string match "*Ban List for channel*" $text] } {
if { $xlistdebug == "1" } {putlog "Analizing banlist for $xlistchans."}
return 5
}
if { [string match "*Channel *" $text] } {
if { $xlistdebug == "1" } {putlog "Analizing status for $xlistchans."}
return 6
}
if { [string match "*are not allowed to be opped on*" $text] } {
if { $xlistdebug == "1" } {putlog "We are banned with level less than 75 on $xlistchans."}
return 7
}
if { [string match "*You are already authenticated as*" $text] } {
if { $xlistdebug == "1" } {putlog "We are already authenticated."}
set xlistauthed 1
return 8
}
} {
return 0
}
}
# This does the auth and oping, if xlistautoop is not set
proc xlistxauth { hand idx arg } {
putquick "ISON X"
}
# this is the dcc command to start analizing the banlist
proc xlistlist { hand idx arg } {
global xlistdebug xlistchans
if { $xlistdebug == "1" } {putlog "Msging X for banlist ..."}
putquick "PRIVMSG X :lbanlist $xlistchans *"
}
# this is for xbans pub command
proc xlistbans { nick uhost handle text } {
global xlistchans xlistdebug
if { $xlistdebug == "1" } {putlog "$nick is asking for X banlist ..." }
putserv "PRIVMSG $nick :\037Some bans may not be displayed correctly, but that will be fixed in the next version."
foreach ban [banlist $xlistchans] {
if { [string match "*Xbanpurge*" $ban] } {
set list [split $ban]
set length [llength $list]
putserv "PRIVMSG $nick :Banning [charfilter [lrange $list 0 [expr $length-5]]]"
}
}
}
#this is for bans pub command
proc xlistbans2 { nick uhost handle text } {
global xlistchans xlistdebug
putserv "PRIVMSG $nick :\037Some bans may not be displayed correctly, but that will be fixed in the next version."
if { $xlistdebug == "1" } {putlog "$nick is asking for banlist ..." }
foreach ban [banlist $xlistchans] {
set list [split $ban]
set length [llength $list]
putserv "PRIVMSG $nick :Banning [charfilter [lrange $list 0 [expr $length-5]]]"
}
}
# This is executed when X joins the channel
proc xlistjoin { nick uhost handle channel } {
global xlistautoop xlistdebug xlistchans xlistuser xlistpass botnick xlistauthed
if { $xlistdebug == "1" } {putlog "X just joined the channel, authenticating ..."}
putquick "PRIVMSG X@channels.undernet.org :login $xlistuser $xlistpass"
if { $xlistdebug == "1" } {putlog "Authenticating ... "}
set xlistauthed 1
if { $xlistautoop == 0 } {
putquick "PRIVMSG X :op $botnick $xlistchans"
}
return 0
}
# ison parsing and authentication
### With compliments for Wcc :>
proc ison_parse {from key text} {
global xlistdebug xlistauthed xlistautoop xlistchans xlistuser xlistpass botnick
if { [lrange [split $text :] 1 1] == "X" } {
if { $xlistauthed == "0" } {
if { $xlistdebug == "1" } {putlog "Authenticating ... "}
set xlistauthed 1
putquick "PRIVMSG X@channels.undernet.org :login $xlistuser $xlistpass"
if { $xlistautoop == 0 } {
putquick "PRIVMSG X :op $botnick $xlistchans"
if { $xlistdebug == "1" } {putlog "Oping ourself ..."}
}
putquick "PRIVMSG X :lbanlist #Madrid *"
return 2
} {
putquick "PRIVMSG X :lbanlist #Madrid *"
return 2
}
} {
if { $xlistdebug == "1" } {putlog "X is not online."}
set xlistauthed 0
}
return 0
}
# this is done when connecting to the server
proc xlistinit { init-server } {
global xlistdebug xlistxignore
if { [validuser X] } {
if { $xlistdebug == "1" } {putlog "X is already added as a user"}
} else {
if { $xlistdebug == "1" } {putlog "Adding X as a user"}
adduser X *!*@undernet.org
chattr X +X
}
if { $xlistxignore=="1" } {
if { [isignore *!*@undernet.org] } {
if { $xlistdebug == "1" } {putlog "Notices from X are already ignored."}
} {
newignore *!*@undernet.org Xbanpurge "leave this untouched" 0
if { $xlistdebug == "1" } {putlog "Ignoring notices coming from X."}
}
}
putquick "ISON X"
return 0
}
# this does the banlist analizing
proc rawit {from keyword arg} {
global xlistdebug xlistchans xlistaccess xlistuser xlistpass xlistban xlistby xlistlevel xlisttimef
if { $from == "X!cservice@undernet.org" } {
set ctamea [split $arg]
set bufferus [lrange [split [lrange $ctamea 1 1] :] 1 1]
if { [string match "*No Match*" $arg] } {
if { $xlistdebug == "1" } {putlog "No bans on $xlistchans."}
return 0
}
if { [string match "*END*" $arg] } {
if { $xlistdebug == "1" } {putlog "End of banlist."}
return 0
}
if { $bufferus == $xlistchans } {
set xlistban [lrange $ctamea 2 2]
set xlistlevel [lrange $ctamea 4 4]
if { $xlistlevel > $xlistaccess } {
if { $xlistdebug == "1" } {putlog "The $xlistban ban is placed by a higher level user."}
set xlistlevel ""
return 0
}
}
if { $bufferus == "ADDED" } {
set xlistby [lrange $ctamea 3 end]
}
if { $bufferus == "EXP" } {
set xlisttime [lrange $ctamea 2 end]
set xlisttimedays [lrange [split $xlisttime] 0 0]
set onething [split [lrange [split $xlisttime] 2 2] :]
set xlisttimehours [lrange $onething 0 0]
set xlisttimemins [lrange $onething 1 1]
set xlisttimef [expr $xlisttimedays*24*60+[string index $xlisttimehours 0]*600+[string index $xlisttimehours 1]*60+[string index $xlisttimemins 0]*10+[string index $xlisttimemins 1]]
if { $xlistban != "" && $xlistby !="" && $xlistlevel!="" && $xlisttimef!=""} {
if { [isban $xlistban $xlistchans]} {
foreach ban [banlist $xlistchans] {
if { [string match "*Xbanpurge*" $ban] && [string match "*$xlistban*" $ban] } {
killchanban $xlistchans $xlistban
putquick "PRIVMSG X :unban $xlistchans $xlistban"
if { $xlistdebug == "1" } {putlog "Removing chanban $xlistban on $xlistchans"}
break
}
}
if { $xlistdebug == "1" } {putlog "Removing chanban $xlistban on $xlistchans, it was found on general banlist too"
putquick "PRIVMSG X :unban $xlistchans $xlistban"
} {
set user [lrange $xlistby 0 0]
set reason [lrange $xlistby 1 end]
set by "by $user with reason $reason for $xlisttime since [strftime %d%h] [time]"
newchanban $xlistchans $xlistban Xbanpurge $by $xlisttimef
if { $xlistdebug == "1" } {putlog "Banning $xlistban $by"}
putquick "PRIVMSG X :unban $xlistchans $xlistban"
set xlistban ""
set xlistlevel ""
set xlistby ""
set xlisttimef ""
return 0
}
}
}
}
return 0
}
# timers management and starting procedure
proc xlistkill {} {
foreach j [timers] {
if {[string compare [lindex $j 1] xlistdoitnow ] == 0} {
killtimer [lindex $j 2]
}
}
return 0
}
proc xliststart {} {
global xlisttimer
timer $xlisttimer xlistdoitnow
return 0
}
proc xlistdoitnow {} {
putquick "ISON X"
xlistkill
xliststart
return 0
}
# for need-unban
proc xlistunban { channel type } {
global xlistdebug username botnick xlistchans
if { $xlistdebug == "1" } {putlog "We need unban on $xlistchans."}
putquick "PRIVMSG X :unban $xlistchans $botnick"
return 0
}
# for need-op
proc xlistop { channel type } {
global xlistdebug username botnick xlistchans
if { $xlistdebug == "1" } {putlog "We need op on $xlistchans."}
putquick "PRIVMSG X :op $xlistchans $botnick"
return 0
}
# for need-invite
proc xlistinvite { channel type } {
global username xlistdebug botnick xlistchans
if { $xlistdebug == "1" } {putlog "We need invite on $xlistchans."}
putquick "PRIVMSG X :invite $xlistchans $botnick"
return 0
}
# this does some filtering on special chars like {}
proc charfilter {x {y ""} } {
for {set i 0} {$i < [string length $x]} {incr i} {
switch -- [string index $x $i] {
"\\" {append y ""}
"\}" {append y ""}
"\{" {append y ""}
default {append y [string index $x $i]}
}
}
return $y
}
# Finnaly
xlistkill
xliststart
# binds
bind RAW X|X NOTICE xlistraw
bind RAW X|X NOTICE rawit
bind dcc o|o xauth xlistxauth
bind dcc o|o xlist xlistlist
bind msg o|o xbans xlistbans
bind msg n|n bans xlistbans2
bind JOIN X|X "$xlistchans X!cservice@undernet.org" xlistjoin
bind JOIN X|X "$xlistchans $botnick!$username@*" xlistjoin
bind evnt - init-server xlistinit
bind raw - 303 ison_parse
bind need X|X "$xlistchans unban" xlistunban
bind need X|X "$xlistchans op" xlistop
bind need X|X "$xlistchans invite" xlistinvite
putlog "X authentication and ban purger by HigH loaded and timer set at $xlisttimer minute(s)."