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.

random command in tcl

Help for those learning Tcl or writing their own scripts.
Post Reply
t
tahu
Voice
Posts: 14
Joined: Fri Feb 11, 2005 10:45 pm
Location: bandung
Contact:

random command in tcl

Post by tahu »

hello ..
anybody can help me to tell about how to make random command for tcl script ?
thanks..
no limit to learn
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

What random commands?
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

Check this
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Code: Select all

proc rand { {range 100} } {
  return [expr {int(rand()*$range)}]
}
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Is that what he meant with random command? :P
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Sir_Fz wrote:Is that what he meant with random command? :P
I think so. I made an assumption based on dbl dutch. :lol:
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
t
tahu
Voice
Posts: 14
Joined: Fri Feb 11, 2005 10:45 pm
Location: bandung
Contact:

random

Post by tahu »

proc mx_timer_ask {} {
global botnick quizconf
global rankfile
global rankfile userlist timerankreset
global tgcurrentanswer tghinttimer tgtimenext tgchan
global tgnextqtimer tgstreak tgstreakmin
global tgscoresbyname tgranksbyname tgranksbynum
global tgcongrats tgscorestotal tgmissed
global tgtimestart tgshowallscores tgrealnames tgscoresbyrank
global tgtimeanswer
global upasAnswers upasNumAnswered upasQuestionTimer
global upasAdTimer
tmcquiz_rank_save {} {} {}
[no.1] tmcquiz_ask $botnick {} {} $quizconf(quizchannel) {}
[no.2] utimer 5 upasAskQuestion
[no.3] set tgnextqtimer [utimer $tgtimenext tgnextq]
set tgplaying 1
set tgstreak 0
set tgmissed 0
}

i want to random this no.1, no.2, no.3 but i dont know how to do. please help me . thanks
no limit to learn
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Re: random

Post by Sir_Fz »

tahu wrote:i want to random this no.1, no.2, no.3 but i dont know how to do. please help me . thanks
What do you mean by randoming them?
t
tahu
Voice
Posts: 14
Joined: Fri Feb 11, 2005 10:45 pm
Location: bandung
Contact:

Post by tahu »

that script game is 3 proc for next question.
so i mean when this game over for next question move to another script.

sorry for my poor english. i hope u understand what i mean. thanks
no limit to learn
Post Reply