Code: Select all
proc pub_lol_join {me host hand chan arg} {
set arg [charfilter $arg]
global lol botnick
global nb_sendcmd
set nb_control "eggie1,eggie2,eggie3"
set chansset "+mc.protect_ops +bitch +shared -statuslog +joinpart"
if {![check $hand $me $host]} {
if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
return 0
}
if {[llength $arg] < 1} {
puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]join <chan> \[chan pass\]"
return 0
}
set chan [lindex $arg 0]
if {$chan != ""} {set chan [chanaddapt $chan]}
set pass [lindex $arg 1]
if {[validchan $chan]} {
puthelp "NOTICE $me :I'm already monitoring $chan. "
if {$pass != ""} {
if {$lol(chankey) == 1} {
puthelp "NOTICE $me :New pass set for $chan: $pass."
channel set $chan need-key "chankey $chan $pass"
} {
puthelp "NOTICE $me :I can't memorize password to keep compatibility with getops.tcl"
}
}
if {![onchan [strlwr $botnick] $chan]} {
puthelp "NOTICE $me :I'll now try to join it."
putserv "JOIN $chan $pass"
return 0
}
puthelp "NOTICE $me :I'm already in $chan."
return 0
}
channel add $chan
tellaboutjoin $me $chan
chattr $me |+moN $chan
nb_sendcmd $nb_control netjoin [list $hand $chan $pass]
channel set $chan chanmode $lol(chanmode)
channel set $chan flood-chan $lol(chan_flood)
channel set $chan flood-deop $lol(deop_flood)
channel set $chan flood-kick $lol(kick_flood)
channel set $chan flood-join $lol(join_flood)
channel set $chan flood-ctcp $lol(ctcp_flood)
puthelp "NOTICE $me :New chan monitoring : $chan."
nb_sendcmd $nb_control netchanset [list $hand $chan $chansset]
foreach param $lol(chan_parameters) { channel set $chan $param }
if {$pass != ""} {
if {$lol(chankey) == 1} {
puthelp "NOTICE $me :New pass set for $chan : $pass. "
channel set $chan need-key "chankey $chan $pass"
} {
puthelp "NOTICE $me :I can't memorize password to keep compatibility with getops.tcl"
}
}
puthelp "NOTICE $me :$chan is now configured. I'll now try to join it."
putserv "JOIN $chan $pass"
}