egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

BotAdmin - Need lil help

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Fri Jan 13, 2006 3:12 pm    Post subject: BotAdmin - Need lil help Reply with quote

Ok I put this script on my bot and set the flags to a|a and restarted..

Code:
#################################################
# 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 a|a]}
        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"


It worked...

[10:09am] <cache> X restart
[10:09am] <@X> [cache] Restarting...
[10:09am] * Parts: @X(X@X)
[10:10am] * Joins: X (X@X)

Problem is.. if I reboot, or end process to bot and reload it by clicking eggdrop.exe and bot reconnects to chat...

It stops working.... weird thing is, it starts working if I go in putty and 'rehash'.

All my nick has is an 'a' flag - didn't want to use owner flags.

Anyone know why? Or have a suggestion of a better script?

Thanks Mad


Last edited by cache on Fri Jan 13, 2006 6:32 pm; edited 1 time in total
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Jan 13, 2006 3:28 pm    Post subject: Reply with quote

That's because $botnick is still unknown before the bot has connected. Change
Code:
bind pub - $botnick admin:sort

to
Code:
bind pub - $nick admin:sort

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Fri Jan 13, 2006 3:35 pm    Post subject: Reply with quote

Thanks Sir, that worked!! Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber