BotRequest1.3.0/help/004075500015410000146000000000000702267717100151075ustar00shortystud00002600022411BotRequest1.3.0/help/BotRequest.help010074400015410000146000000001660702267715500200610ustar00shortystud00002600022411%{help=doneed}%{+n|+n} ### %bdoneed%b Set the 's setting so that the BotRequest script is used. BotRequest1.3.0/instruc.doc010074400015410000146000000012270702267621700163350ustar00shortystud00002600022411 step 1: copy "scripts/BotRequest.tcl" to your script directory step 2: copy "help/BotRequest.help" to you help directory step 3: edit your config file so it contains the following lines "source scripts/BotRequest.tcl" "loadhelp BotRequest.help" step 4: start/rehash your bot Remember, if you change the bind to allow other users then owners to use doneed, to change the help file in the help area so that it will be showed to other then the owners (ie change %{n|n} to %{+m|n} to let global master see the help file). Comment and suggestions are welcome, and I know I can't spell :))))) - Nils Ostbjerg BotRequest1.3.0/scripts/004075500015410000146000000000000702267676500156565ustar00shortystud00002600022411BotRequest1.3.0/scripts/BotRequest.tcl010064400015410000146000000234640702267675400204630ustar00shortystud00002600022411# BotRequest.tcl by Nils Ostbjerg # (C) Copyright (1999) # # This script will allow bots to request ops and other thing form each # other. So far it only work fully on IRCnet type nets because of my # lazyness and lack of knowlage of how the other nets works. # On IRCnet types nets /invite overrides bans and limit, so there is not # unban or lower limit routine. # # To get the function working on a channel either edit your config/channel # file so that the following is inside the channel add command: # need-op "bot:request op #channel" # need-invite "bot:request invite #channel" # need-key "bot:request key #channel" # need-unban "bot:request invite #channel" # need-limit "bot:request invite #channel" # or simply do a .doneed #channel # # This version of the BotRequest script is useable with Eggdrop version # 1.4.x # # Please report any bugs to me at shorty@business.auc.dk. # Idea and suggestion to new features are also welcome. # # - Nils Ostbjerg # # Version 1.4.0 - 30 Nov 1999 The script is inspired by the getops # script by The_0, dtM, poptix, DarkDruid, # beldin, Ernst, Cron, Profou and brainsick. # This is the first version and should work # ok. # I have written is so that it is easy to # add a flag that tells a bot to ignore a # bot for X min when requesting something. # Maybe I'll add it in the next version. # # - Nils Ostbjerg # ########################################################################## # Binds # ########################################################################## bind bot - Request bot:grant bind bot - Responce bot:accept bind dcc n|n doneed dcc:doneed ########################################################################## # dcc:doneed start # ########################################################################## proc dcc:doneed {hand idx paras} { if {![validchan $paras]} { putdcc $idx "Usage: doneed " return 0 } channel set $paras need-op "bot:request op $paras" channel set $paras need-invite "bot:request invite $paras" channel set $paras need-key "bot:request key $paras" channel set $paras need-unban "bot:request invite $paras" channel set $paras need-limit "bot:request invite $paras" return 1 } ########################################################################## # dcc:doneed end # ########################################################################## ########################################################################## # bot:request start # ########################################################################## proc bot:request {cmd chan} { global botnick set botop 0 switch -exact $cmd { "op" { if {[chanhasop $chan]} { foreach bot [localbots] { if { [matchattr $bot +o|+o $chan] && [isop [hand2nick $bot $chan] $chan] } { putbot $bot "Request $cmd $chan $botnick" putcmdlog "BotRequest: Requested $cmd from $bot on $chan" set botop 1 } } if {!$botop} { putnotc $chan "Please op me. (This is an automated message)" foreach user [chanlist $chan] { if {[isop $user $chan]} { putnotc $user "Please op me on $chan. Im a channel bot. (This is an automated message.)" } } } } else { putnotc $chan "Please leave the channel for a while so that the bots can get ops back. (This is an automated message.)" foreach user [chanlist $chan] { putnotc $user "Please leave $chan for a while so the channel bots can get ops back.(This is an automated message.)" } } } default { foreach bot [localbots] { if {[matchattr $bot +o|+o $chan]} { putbot $bot "Request $cmd $chan $botnick" putcmdlog "BotRequest: Requested $cmd from $bot on $chan" } } } } } ########################################################################## # bot:request end # ########################################################################## ########################################################################## # bot:grant start # ########################################################################## proc bot:grant {bot command paras} { global botnick set cmd [lindex $paras 0] set chan [lindex $paras 1] set nick [lindex $paras 2] set logline "BotRequest:" set botline "Responce:" set qos 0 switch -exact $cmd { "op" { set logline "$logline Op on" set botline "$botline op" } "invite" { set logline "$logline Invite to" set botline "$botline invite" } "key" { set logline "$logline Key to" set botline "$botline key" } default { set logline "$logline Unknown command ($cmd) for" set botline "$botline command error" set qos 1 } } if {![validchan $chan] && ($qos == 0)} { set logline "$logline invalid channel ($chan) requested by" set botline "$botline error invalid channel" set qos 1 } elseif {![onchan $botnick $chan] && ($qos == 0)} { set logline "$logline unavaible channel ($chan) requested by" set botline "$botline error unavaible channel" set qos 1 } else { set logline "$logline $chan requested by" } if {![matchattr $bot b]} { putcmdlog "$logline UNKNOWN $bot" return 0 } elseif {$qos == 1} { putbot $bot "$botline" set logline "$logline $bot" return 0 } elseif {![matchattr $bot +o|+o $chan]} { putbot $bot "$botline error You dont have +o for $chan" putcmdlog "$logline NONOP $bot" return 0 } elseif {![botisop $chan]} { putbot $bot "$botline error Im not opped on $chan" putcmdlog "$logline $bot. Request denied. Im not opped on $chan." return 0 } putcmdlog "$logline $bot" switch -exact $cmd { "op" { if {![onchan $nick $chan]} { putbot $bot "$botline error I cant find you on $chan" putcmdlog "BotRequest: $bot is not on $chan" return 0 } elseif {[nick2hand $nick $chan] != $bot} { putbot $bot "$botline error Your host and nick dont comply" putcmdlog "BotRequest: $nick is not $bot" return 0 } putserv "mode $chan +o $nick" putbot $bot "$botline ok" putcmdlog "BotRequest: Gave $bot op on $chan" } "invite" { putserv "invite $nick $chan" putbot $bot "$botline ok" putcmdlog "BotRequest: Invited $bot to $chan" } "key" { set chanmode [getchanmode $chan] if {![string match *k* [lindex $chanmode 0]]} { putbot $bot "$botline error No key needed for $chan" putcmdlog "BotRequest: No key on $chan" return 0 } putbot $bot "$botline ok [lindex $chanmode 1] is key on $chan" putcmdlog "BotRequest: Gave $bot key to $chan" } } } ########################################################################## # bot:grant end # ########################################################################## ########################################################################## # bot:accept start # ########################################################################## proc bot:accept {bot command paras} { global botnick set cmd [lindex $paras 0] set stt [lindex $paras 1] set comt [lrange $paras 2 end] switch -exact $cmd { "op" { putcmdlog "BotRequest: $cmd $stt $comt" } "invite" { putcmdlog "BotRequest: $cmd $stt $comt" } "key" { putcmdlog "BotRequest: $cmd $stt $comt" if {$stt == "ok"} { if {[validchan [lindex $comt 4]] && ![onchan $botnick [lindex $comt 4]]} { putserv "JOIN [lindex $comt 4] [lindex $comt 0]" } } } "command" { putcmdlog "BotRequest: $cmd $stt $comt" } } } ########################################################################## # bot:accept end # ########################################################################## ########################################################################## # localbots start # ########################################################################## proc localbots {} { set localbots "" foreach bot [bots] { if {[matchattr $bot +b]} { lappend localbots $bot } } return $localbots } ########################################################################## # localbots end # ########################################################################## ########################################################################## # chanhasop start # ########################################################################## proc chanhasop {chan} { foreach user [chanlist $chan] { if {[isop $user $chan]} { return 1 } } return 0 } ########################################################################## # chanhasop end # ########################################################################## ########################################################################## # putlog # ########################################################################## putlog "Loaded BotRequest (DLF)"eave the channel for a while so that the bots can get ops back. (This is an automated message.)" foreach user [chanlist $chan] { putnotc $user "Please leave $chan for a while so the channel bots c