Code: Select all
bind pub n|n !join makejoin
proc makejoin {nick uhost handle chan text} {
if {![check:auth $nick $hand]} {return 0}
if {![matchattr $hand n|n $chan]} {
puthelp "NOTICE $nick :$::fzcom(logo): You do not have access to use this command."
return 0
}
if {[llength [split $text]]!=1} {
puthelp "NOTICE $nick :$::fzcom(logo): the command is !join #newchannel"
return 0
}
if {[string index $text 0]!="#"} {
puthelp "NOTICE $nick :$::fzcom(logo): the channel name must begin with #"
return 0
}
if {[validchan [string tolower $text]} {
puthelp "NOTICE $nick :$::fzcom(logo): I'm already on $text"
return 0
}
channel add [string tolower $text]
}
Code: Select all
if {![matchattr $hand n|n $chan]} {
puthelp "NOTICE $nick :$::fzcom(logo): You do not have access to use this command."
return 0
}
Code: Select all
bind pub n|n !join makejoin
Code: Select all
if {[llength [split $text]]!=1} {
puthelp "NOTICE $nick :$::fzcom(logo): the command is !join #newchannel"
return 0
}
if {[string index $text 0]!="#"} {
puthelp "NOTICE $nick :$::fzcom(logo): the channel name must begin with #"
return 0
}
Code: Select all
if {[scan $text {%s} c] != 1} {
puthelp "NOTICE $nick :$::fzcom(logo): the command is !join #newchannel"
return
}
if {[string first # $c] != 1} {
puthelp "NOTICE $nick :$::fzcom(logo): the channel $c doesn't seem valid as must start with an #"
return
}
With our contributions, you have all the elements to add this part.Goga wrote:Ceaser Sir, can you please add this into fzcommands.tcl?
Code: Select all
"join" {
if {![check:auth $nick $hand]} {return 0}
if {![matchattr $hand n|n $chan]} {
puthelp "NOTICE $nick :$fzcom(logo): You do not have access to use this command."
return 0
}
if {[validchan $chan} {
puthelp "NOTICE $nick :$::fzcom(logo): I'm already on $chan"
return 0
}
if {![validchan $chan]} {
channel add $chan
puthelp "NOTICE $nick :$fzcom(logo):$chan added in my chanlist."
}
return 0
}
Code: Select all
set c [join [lindex [split $arg] 0]]
Code: Select all
if {[validchan $chan} {
puthelp "NOTICE $nick :$::fzcom(logo): I'm already on $chan"
return 0
}
if {![validchan $chan]} {
channel add $chan
puthelp "NOTICE $nick :$fzcom(logo):$chan added in my chanlist."
}
Code: Select all
if {[validchan $chan} {
puthelp "NOTICE $nick :$::fzcom(logo): I'm already on $chan"
} else {
channel add $chan
puthelp "NOTICE $nick :$fzcom(logo):$chan added in my chanlist."
}
Code: Select all
if {[validchan $chan} {
if {![botonchan $chan]} {
puthelp "NOTICE $nick :$::fzcom(logo): $chan channel is in my chanlist, but for some reason I'm not on it."
} else {
puthelp "NOTICE $nick :$::fzcom(logo): I'm already on $chan"
}
} else {
channel add $chan
puthelp "NOTICE $nick :$fzcom(logo):$chan added in my chanlist."
}
Code: Select all
if {[channel get $chan inactive]} {
# your message here
}