| View previous topic :: View next topic |
| Author |
Message |
tahu Voice
Joined: 11 Feb 2005 Posts: 14 Location: bandung
|
Posted: Sun Nov 06, 2005 12:54 pm Post subject: random command in tcl |
|
|
hello ..
anybody can help me to tell about how to make random command for tcl script ?
thanks.. _________________ no limit to learn |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
]Kami[ Owner

Joined: 24 Jul 2003 Posts: 590 Location: Slovenia
|
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sun Nov 06, 2005 9:40 pm Post subject: |
|
|
| Code: | proc rand { {range 100} } {
return [expr {int(rand()*$range)}]
} |
_________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Mon Nov 07, 2005 8:25 am Post subject: |
|
|
| Sir_Fz wrote: | Is that what he meant with random command?  |
I think so. I made an assumption based on dbl dutch.  _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
tahu Voice
Joined: 11 Feb 2005 Posts: 14 Location: bandung
|
Posted: Wed Nov 09, 2005 11:16 am Post subject: random |
|
|
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 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Nov 09, 2005 11:57 am Post subject: Re: random |
|
|
| 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? _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
tahu Voice
Joined: 11 Feb 2005 Posts: 14 Location: bandung
|
Posted: Wed Nov 09, 2005 9:38 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
|