Code: Select all
bind dcc - chanstat dcc:chanstat
proc dcc:chanstat {hand idx text} {
set chan [lindex [split $text] 0]
if {$chan == ""} {
putidx $idx "Usage: .chanstat <#channel>"
return
}
set ops 0; set voice 0; set users 0
foreach user [chanlist $chan] {
if {[isop $user $chan]} {
incr ops
} elseif {[isvoice $user $chan]} {
incr voice
} else {
incr users
}
}
set total [expr $ops+$voice+$users]
putidx $idx "ChanStats $chan: $ops ops, $voice voice, $users users (total $total)"
}
Code: Select all
if {[string first $requestbot $botnicks] != -1} {
if {$channel != ""} {
if {$email != ""} {
putserv "NOTICE $nick :Request send."
join $channel
putserv "NOTICE $nick :The Bot will soon join."
putserv "PRIVMSG $requestbot :.join $channel"
putserv "PRIVMSG $requestbot :.adduser $nick $userhost"
putserv "PRIVMSG $requestbot :.chattr $nick +n $channel"
Code: Select all
putserv "NOTICE $nick :Request send."
join $channel
putserv "NOTICE $nick :The Bot will soon join."
Code: Select all
putserv "NOTICE $nick :Request send."
channel add $channel
putserv "NOTICE $nick :The Bot will soon join."
putbot $requestbot .join $channel"
putbot $requestbot .adduser $nick $userhost"
putbot $requestbot .chattr $nick +n $channel"
Code: Select all
# BotRequest by Domian
# #Domi @ Quakenet
# Version 0.1
# Command:
# !request <Bot> <#Channel> <e-mail adresse>
# Settings
set botnicks "Bello` KriXDesiGn"
# Here are the Botnicks which can requested
# Here beginn the script
bind pub -|- !request pub:request
proc pub:request {nick uhost handle chan text} {
global botnicks receiver waittime
set ipmask [lindex [split [maskhost $nick![getchanhost $nick $chan]] "@"] 1]
set userm [lindex [split [getchanhost $nick $chan] "@"] 0]
set userhost *!*$userm@$ipmask
set requestbot [lindex [split $text " "] 0]
set channel [lindex [split $text " "] 1]
set email [lindex [split $text " "] 2]
if {$requestbot == ""} {
putserv "NOTICE $nick :Wrong !request-format."
putserv "NOTICE $nick :To request use: 4!request <bot-nick> #channel <e-mail adresse>"
putserv "NOTICE $nick :You also need an e-mail acc and 10 or more Members in the requested channel."
} else {
if {$channel == ""} {
putserv "NOTICE $nick :Wrong !request-format."
putserv "NOTICE $nick :To request use: 4!request <bot-nick> #channel <e-mail adresse>"
putserv "NOTICE $nick :You also need an e-mail acc and 10 or more Members in the requested channel."
} else {
if {[string first "#" $channel] == -1} {
putserv "NOTICE $nick :Wrong !request-format."
putserv "NOTICE $nick :To request use: 4!request <bot-nick> #channel <e-mail adresse>"
putserv "NOTICE $nick :You also need an e-mail acc and 10 or more Members in the requested channel."
} else {
if {[string first $requestbot $botnicks] != -1} {
if {$channel != ""} {
if {$email != ""} {
putserv "NOTICE $nick :Request send."
channel add $channel
set total [llength [chanlist $channel]]
if { $total >= 10} {
putserv "NOTICE $nick :The Bot will soon join."
putbot $requestbot .join $channel"
putbot $requestbot .adduser $nick $userhost"
putbot $requestbot .chattr $nick +n $channel"
}} else {
putserv "NOTICE $nick :The Channel is to small, the Bot won't join"
}
}
} else {
putserv "NOTICE $nick :You typed a wrong bot-nick. Known bot-nick's are:"
putserv "NOTICE $nick :$botnicks"
}
}
}
}
}
putlog "Loaded BotRequest 0.1 by Domian"
wrong.YooHoo wrote:join is not a tcl command.
This will not work, as the bot won't join the channel before your proc returns. After joining, eggdrop will perform /MODE #chan +b, /MODE #chan, /WHO #chan. "chanlist" will not be complete untill the END OF /WHO reply (315) is recieved by your bot. You need a delay or a raw bind to make sure you don't check the llength of [chanlist $channel] untill the list is complete. (so you'll need to split your code into two procs)Domian wrote:Code: Select all
channel add $channel set total [llength [chanlist $channel]]
Code: Select all
bind raw <flags> <keyword-mask> <proc>
procname <from> <keyword> <text>