This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

tcl bug

Old posts that have not been replied to for several years.
Locked
v
virtuoso
Halfop
Posts: 90
Joined: Fri May 16, 2003 6:52 pm

tcl bug

Post by virtuoso »

hello.

im trying to run this tcl script,but it doesn't works. the error message i
see is :

[06:42] Tcl error in script for 'need-op':
[06:42] can't read "randbase": no such variable

can some one help me to fix it ? thanks

or if someone knows a better tcl script like this,please tell me...



this is the source code :



#Distributed Eggdrop Keyserver for eggdrop1.3.22

#by nullset{} (nullset@nullset.resnet.gatech.edu)

#

#This is the way overly secure opping script i wrote.

#It started off just as an op script, but then i decided to make the
distributed key server

#And use it in the op script

#It's for those of you who are way overly paranoid, such as myself.

#Please read through and edit it, as your bot will crash if you don't edit
some lines

#If you edit anything, or have questions/comments (ie it sucks, it rules,
it's way overkill)

#email them to me at the address shown above

#Future versions (if ever) will include: A C module for PGP encyrption
(hehe)

#Custom sockets

#More security checking within the script itself

#A maximum ping time so that it won't op the bot if there is more than XX
lag b/w the two

#(Prevents the bot from 'verifying' itself then lagging off right after this
bot puts in the

#mode. If this were to happen, anyone with the nick 'bot1' will be opped.

#Anything else overly complex i can think of. Please use my opping script as
an example

#Of how to use the keyserver....don't let it go to waste by jsut opping.
Send me anything you

#do based on this script.

#The last section of code is the opping script, with usage instructions.
Enjoy

###### INITIAL SETTINGS #######

#how long to keep a key before generating a new one? (in seconds, but the
clock is a bit fast)

set keepvkey "5000"

# Place the nickname of the 'keyserver' bot here

set keyserver "Nutellina"

# This is the key used to encrypt the keys. If it's more than 8 chars long,
the bot will crash

#NOTE: edit this or your bot will crash

set vkey "giustizia"

#This phrase is used to make sure the other bot knows our vkey.

set testphrase "sincerita"

#This is the keyword used for opping.....

set opvword "amore"

#A list of bots you want to receive keys/ask for ops from. noticed this bot
(bot1) isn't in

#its own list

set botlist { ada123 }

#Number of bots

set num_of_vbots "1"

############################################################################
############

#### YOU DONT NEED TO TOUCH ANYTHING BELOW HERE, BUT IF YOU DO, EMAIL ME
WHAT YOU CHANGED

#I'm nullset@nullset.resnet.gatech.edu

############################################################################
#############

#### Keyserver client proc ###########

proc newkey {from command args} {

global keyserver randbase sanekey vkey testphrase newkey

set testkey [lindex "$args" 0]

set testkeya [decrypt $vkey $testkey]

if { $testkeya == $testphrase} {

set newkey [eval lindex "$args" 1]

set randbase [decrypt $vkey $newkey]

putlog "New Key Received from $from."

}

if { $testkeya != $testphrase } {

putlog "Invalid Key Sent from $from. Decrypted = $testkeya"

}

return 0

}

####### Keyserver server proc##############

proc initialize_random {} {

global randbase randnum keepvkey vkey testphrase botlist num_of_vbots

set randbase [eval rand 720]

set keytosend [encrypt $vkey $randbase]

set encphrase [encrypt $vkey $testphrase]

#the catch is there, in case said bot isn't on the botnet

for {set botname 0} {$botname < $num_of_vbots} {incr botname} {

catch [putbot [lindex "$botlist" $botname] "NUKEY $encphrase $keytosend"]

}

utimer $keepvkey initialize_random

return 0

}

#####This is needed to call the keyserver script initially

if { $botnick == $keyserver} {

initialize_random

}

###If we aren't keyserver, we want to receive keys....

if { $botnick != $keyserver} {

bind bot - NUKEY newkey

}

#####################This is the script i wrote to op my bots using the
keys################

#To use it, do '.chanset #yourchan need-op msg_getops #yourchan' and edit
the need-op value#

#In your cfg file #

############################################################################
################

proc msg_op {nick uhost hand args} {

global randbase opvword

set chan [eval lindex "$args" 1]

set chantoop [decrypt $randbase $chan]

set testopword [eval lindex "$args" 0]

set testbase [decrypt $randbase $testopword]

if { $testbase == $opvword } {

if { [handonchan $hand $chantoop] } {

putlog "Opping $nick on $chantoop"

putserv "MODE $chantoop +o $nick"

}

}

}

bind msg b OPME msg_op

proc msg_getops {chan} {

global botlist randbase opvword num_of_vbots

putlog "Asking for ops....."

for {set botnum 0} {$botnum < $num_of_vbots} {incr botnum} {

set bottomsg [lindex "$botlist" $botnum]

set encoded [encrypt $randbase $opvword]

set chann [encrypt $randbase $chan]

putserv "PRIVMSG $bottomsg :OPME $encoded $chann" }

}
Locked