<?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/256" />

	<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>2001-10-25T20:09:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2001-10-25T20:09:00-04:00</updated>

		<published>2001-10-25T20:09:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=1074#p1074</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=1074#p1074"/>
		<title type="html"><![CDATA[TCL script question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=1074#p1074"><![CDATA[
Trimming the text is not sufficient, as it leaves staces in the text, and if you add a space to the chars it trims off, you end up with a blank string.<br><br>The proper way to get the channel key would be somthing simalar.<blockquote class="uncited"><div>pushmode chan -k [lindex [getchanmode $chan] 1]</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Oct 25, 2001 8:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2001-10-25T19:50:00-04:00</updated>

		<published>2001-10-25T19:50:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=1072#p1072</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=1072#p1072"/>
		<title type="html"><![CDATA[TCL script question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=1072#p1072"><![CDATA[
below is the code to my script. what i would like is to .rkey #chan and have it remove the current key if there is on, and then set a random key. if a key isn't set then just set a random key. the problem is it sorta works now. it just doesn't unset the old key and make a new one.<br>bind dcc o|n rkey dcc:rkey<br><br>proc isnum { number } {<br>   return [regexp ^(-|[0-9]*)[0-9]+$ $number]<br>}<br><br>proc randkey { length } {<br>   if {![isnum $length]} { return "" }<br>   set string ""<br>   for {set i 0} {$i &lt; $length} {incr i} {<br>      set rand [rand 64]<br>      append string [string range "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" $rand $rand]<br>   }<br>   return $string<br>}<br><br><br>proc dcc:rkey {hand xid chan} {<br>  putcmdlog "#$hand# rkey $chan"<br>  if {$chan == ""} {<br>    putdcc $xid "Usage: rkey &lt;channel&gt;"<br>    return 0<br>  }<br>  if {![string match $chan [string tolower [channels]]]} {<br>    putdcc $xid "Error: I'm not on $chan"<br>    return 0<br>  }<br>  if {![botisop $chan]} {<br>    putdcc $xid "I'm not oped on $chan"<br>    return 0<br>  }<br>  if {[string match *k*  [getchanmode $chan]]} {<br>    putdcc $xid "|[string trimright [string trimleft [getchanmode $chan] +ipsmtnkl] 123456789]|"<br>    putdcc $xid "attempting to unset +k"<br>    pushmode $chan -k [string trimright [string trimleft [getchanmode $chan] +ipsmtnkl] 123456789]]<br>    putdcc $xid "attempting to set +k"<br>    pushmode $chan +k [randkey 8]<br>    return 0<br>  }<br>  if {![string match *k*  [getchanmode $chan]]} {<br>    pushmode $chan +k [randkey 8]<br>    return 0<br>  }<br>}<br><p>Statistics: Posted by Guest — Thu Oct 25, 2001 7:50 pm</p><hr />
]]></content>
	</entry>
	</feed>
