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 

rand command

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
stammer
Voice


Joined: 10 Mar 2003
Posts: 31
Location: Bulgaria

PostPosted: Wed May 21, 2003 7:53 am    Post subject: rand command Reply with quote

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:
         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
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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