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.

rand command

Old posts that have not been replied to for several years.
Locked
s
stammer
Voice
Posts: 31
Joined: Mon Mar 10, 2003 9:39 am
Location: Bulgaria

rand command

Post by stammer »

hi there,

when i upgrade my windrop to 6.15 it seems one of my tcl's start to behave strange. I figure that it's in that fragment of code:

Code: Select all

			set chanlist [chanlist $chan -T]
			if {[llength $chanlist]>2} {
				set rndnick $nick
				set strs [lindex $nanypa [rand [llength $nanypa]]] 
				while {($rndnick==$nick)||($rndnick==$botnick)} { 
					set idx [rand [llength $chanlist]] 
					set rndnick [lindex $chanlist $idx] 
					set chanlist [lreplace $chanlist $idx $idx] 
				}
				set strs [string map [list "NiCk" $rndnick] $strs]				
			}
the problem is - bot uses 'rand' command to choose random nickname in channel. In 6.13 this worked ok but after upgrading to 6.15 'rand' start to choose only one nick every time.

Is this is mistake in my tcl or it's bug in the windrop/eggdrop?

10x
Locked