BotAdmin v0.2

By FriedCPU on Dec 04, 2005

Provides commands you can use within the channel if you are the owner of the bot (+m flag). Commands are: rehash, restart, hop, die
which usually you need to be on the partyline for, just makes it easier.

How to use:
ie: somebot rehash
and it should respond with [yournick] rehash complete
if you dont have access it will respond with [yournick] access denied.

hope some people find this useful :)

#################################################
# Script: BotAdmin              Version: 0.2    #
# Author: FriedCPU                              #
#-----------------------------------------------#
#              What Does It Do?                 #
# Provides commands that usually need to be     #
# executed on the partyline, saving time having #
# tobe in dcc-chat / telnet with bot.           #
#-----------------------------------------------#
#              What Commands?                   #
# rehash - rehashes bot                         #
# restart - restarts bot                        #
# hop - makes bot hop (part then join) the chan #
# die - kills the bot                           #
# Note: if a command is not specified, then it  #
# responds with a random come back              #
#-----------------------------------------------#
#              How?                             #
# Usage: <botname> <command>                    #
# if the bots name was charlie...               #
# charlie rehash                                #
# charlie restart                               #
# charlie hop                                   #
# etc...etc...                                  #
#################################################

bind pub - $botnick admin:sort

proc formatize { text } { return "\002\00314\[\002$text\002\]\003\002" }
proc admincheck { handle } {
    if {![matchattr $handle m|m]} {
        return "no"
    } else {
        return "yes"
    }
}
proc axxdenied { n } {
    return "[formatize "$n"] Access Denied"
}

set randresponce {
    "What?"
    "Huh?"
    "What do you want?"
    "Arrrrghh"
    "Stop calling my name!"
    "What you talkin' about Willis?"
    "I am Reptar hear me rawrr!"
    "Rawwrrr"
    "Again Again!"
    "I'l Be Back"
    "Astalavista, Baby"
    "When it all gets to much, fukitol"
}
proc admin:sort { n u h c t } {
    global randresponce
    if {$t == "rehash"} {
        if {[admincheck $h] == "yes"} {
            rehash
            putserv "PRIVMSG $c :[formatize "$n"] Rehash Complete"
        } else {
            putserv "PRIVMSG $c :[axxdenied]"
        }
    } elseif {$t == "restart"} {
        if {[admincheck $h] == "yes"} {
            putserv "PRIVMSG $c :[formatize "$n"] Restarting..."
            utimer 2 "restart"
        } else {
            putserv "PRIVMSG $c :[axxdenied]"
        }
    } elseif {$t == "hop"} {
        if {[admincheck $h] == "yes"} {
            putserv "PRIVMSG $c :[formatize "$n"] Hopping Channel"
            putserv "PART $c :Hop Hop Hop"
        } else {
            putserv "PRIVMSG $c :[axxdenied $n]"
        }
    } elseif {$t == "die"} {
        if {[admincheck $h] == "yes"} {
            die "Connection Rest by $n"
        } else {
            putserv "PRIVMSG $c :[axxdenied]"
        }
    } else {
        putserv "PRIVMSG $c :[lindex $randresponce [rand [llength $randresponce]]]"
    }
}

putlog "\002BotAdmin\002 v\0020.2\002 by \002FriedCPU\002 Loaded"

Comments

Sign in to comment.
FriedCPU   -  Dec 05, 2005

Just replied to your PM, but basically, this is intended for owners of the bot, which if you are, you have a m flag.

 Respond  
vampslim   -  Dec 05, 2005

And if there is no +m flag for the user? What then?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.