<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/6374" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2003-12-12T15:33:06-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/6374</id>

		<entry>
		<author><name><![CDATA[virtuoso]]></name></author>
		<updated>2003-12-12T15:33:06-04:00</updated>

		<published>2003-12-12T15:33:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=31372#p31372</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=31372#p31372"/>
		<title type="html"><![CDATA[tcl bug]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=31372#p31372"><![CDATA[
hello.<br><br>im trying to run this tcl script,but it doesn't works. the error message i<br>see is :<br><br>[06:42] Tcl error in script for 'need-op':<br>[06:42] can't read "randbase": no such variable<br><br>can some one help me to fix it ? thanks<br><br>or if someone knows a better tcl script like this,please tell me...<br><br><br><br>this is the source code :<br><br><br><br>#Distributed Eggdrop Keyserver for eggdrop1.3.22<br><br>#by nullset{} (<a href="mailto:nullset@nullset.resnet.gatech.edu">nullset@nullset.resnet.gatech.edu</a>)<br><br>#<br><br>#This is the way overly secure opping script i wrote.<br><br>#It started off just as an op script, but then i decided to make the<br>distributed key server<br><br>#And use it in the op script<br><br>#It's for those of you who are way overly paranoid, such as myself.<br><br>#Please read through and edit it, as your bot will crash if you don't edit<br>some lines<br><br>#If you edit anything, or have questions/comments (ie it sucks, it rules,<br>it's way overkill)<br><br>#email them to me at the address shown above<br><br>#Future versions (if ever) will include: A C module for PGP encyrption<br>(hehe)<br><br>#Custom sockets<br><br>#More security checking within the script itself<br><br>#A maximum ping time so that it won't op the bot if there is more than XX<br>lag b/w the two<br><br>#(Prevents the bot from 'verifying' itself then lagging off right after this<br>bot puts in the<br><br>#mode. If this were to happen, anyone with the nick 'bot1' will be opped.<br><br>#Anything else overly complex i can think of. Please use my opping script as<br>an example<br><br>#Of how to use the keyserver....don't let it go to waste by jsut opping.<br>Send me anything you<br><br>#do based on this script.<br><br>#The last section of code is the opping script, with usage instructions.<br>Enjoy<br><br>###### INITIAL SETTINGS #######<br><br>#how long to keep a key before generating a new one? (in seconds, but the<br>clock is a bit fast)<br><br>set keepvkey "5000"<br><br># Place the nickname of the 'keyserver' bot here<br><br>set keyserver "Nutellina"<br><br># This is the key used to encrypt the keys. If it's more than 8 chars long,<br>the bot will crash<br><br>#NOTE: edit this or your bot will crash<br><br>set vkey "giustizia"<br><br>#This phrase is used to make sure the other bot knows our vkey.<br><br>set testphrase "sincerita"<br><br>#This is the keyword used for opping.....<br><br>set opvword "amore"<br><br>#A list of bots you want to receive keys/ask for ops from. noticed this bot<br>(bot1) isn't in<br><br>#its own list<br><br>set botlist { ada123 }<br><br>#Number of bots<br><br>set num_of_vbots "1"<br><br>############################################################################<br>############<br><br>#### YOU DONT NEED TO TOUCH ANYTHING BELOW HERE, BUT IF YOU DO, EMAIL ME<br>WHAT YOU CHANGED<br><br>#I'm <a href="mailto:nullset@nullset.resnet.gatech.edu">nullset@nullset.resnet.gatech.edu</a><br><br>############################################################################<br>#############<br><br>#### Keyserver client proc ###########<br><br>proc newkey {from command args} {<br><br>global keyserver randbase sanekey vkey testphrase newkey<br><br>set testkey [lindex "$args" 0]<br><br>set testkeya [decrypt $vkey $testkey]<br><br>if { $testkeya == $testphrase} {<br><br>set newkey [eval lindex "$args" 1]<br><br>set randbase [decrypt $vkey $newkey]<br><br>putlog "New Key Received from $from."<br><br>}<br><br>if { $testkeya != $testphrase } {<br><br>putlog "Invalid Key Sent from $from. Decrypted = $testkeya"<br><br>}<br><br>return 0<br><br>}<br><br>####### Keyserver server proc##############<br><br>proc initialize_random {} {<br><br>global randbase randnum keepvkey vkey testphrase botlist num_of_vbots<br><br>set randbase [eval rand 720]<br><br>set keytosend [encrypt $vkey $randbase]<br><br>set encphrase [encrypt $vkey $testphrase]<br><br>#the catch is there, in case said bot isn't on the botnet<br><br>for {set botname 0} {$botname &lt; $num_of_vbots} {incr botname} {<br><br>catch [putbot [lindex "$botlist" $botname] "NUKEY $encphrase $keytosend"]<br><br>}<br><br>utimer $keepvkey initialize_random<br><br>return 0<br><br>}<br><br>#####This is needed to call the keyserver script initially<br><br>if { $botnick == $keyserver} {<br><br>initialize_random<br><br>}<br><br>###If we aren't keyserver, we want to receive keys....<br><br>if { $botnick != $keyserver} {<br><br>bind bot - NUKEY newkey<br><br>}<br><br>#####################This is the script i wrote to op my bots using the<br>keys################<br><br>#To use it, do '.chanset #yourchan need-op msg_getops #yourchan' and edit<br>the need-op value#<br><br>#In your cfg file #<br><br>############################################################################<br>################<br><br>proc msg_op {nick uhost hand args} {<br><br>global randbase opvword<br><br>set chan [eval lindex "$args" 1]<br><br>set chantoop [decrypt $randbase $chan]<br><br>set testopword [eval lindex "$args" 0]<br><br>set testbase [decrypt $randbase $testopword]<br><br>if { $testbase == $opvword } {<br><br>if { [handonchan $hand $chantoop] } {<br><br>putlog "Opping $nick on $chantoop"<br><br>putserv "MODE $chantoop +o $nick"<br><br>}<br><br>}<br><br>}<br><br>bind msg b OPME msg_op<br><br>proc msg_getops {chan} {<br><br>global botlist randbase opvword num_of_vbots<br><br>putlog "Asking for ops....."<br><br>for {set botnum 0} {$botnum &lt; $num_of_vbots} {incr botnum} {<br><br>set bottomsg [lindex "$botlist" $botnum]<br><br>set encoded [encrypt $randbase $opvword]<br><br>set chann [encrypt $randbase $chan]<br><br>putserv "PRIVMSG $bottomsg :OPME $encoded $chann" }<br><br>}<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3172">virtuoso</a> — Fri Dec 12, 2003 3:33 pm</p><hr />
]]></content>
	</entry>
	</feed>
