Page 1 of 1 1
Topic Options
#48827 - 2000-01-18 09:59 AM Timer
Anonymous
Unregistered


Can anybody tell me how to create a simple timer, without using a message box?

ie - Cause the script to only wait a specified time for a input before moving on regardless.


Top
#48828 - 2000-01-20 01:25 PM Re: Timer
Anonymous
Unregistered


I'm surprised that no one has replied to this...

try the sleep command

sleep xx

xx is the number of seconds

Top
#48829 - 2000-01-21 06:08 AM Re: Timer
Anonymous
Unregistered


I think he wants to do a GET command that waits a certain amount of time for input before moving on, rather than waiting until the user presses a key. SLEEP won't achieve this because it pauses the whole script and won't accept keyboard input.
Top
#48830 - 2000-01-24 11:57 AM Re: Timer
Anonymous
Unregistered


Thanks for both you your replies; Mjray, you're correct, I want to use GET and then move on after a finite time if no response is received.

Any ideas?

Icky

Top
#48831 - 2000-01-24 02:07 PM Re: Timer
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
; To get a default-answer to a question, without using a messagebox in
; a KiXtart-script, you can use the program CHOICE.COM from Win95
; An example of using the program in a KiXtart-script is this:

? "Install program press I"
? "Execute program press X"
? "Skip press S"
? "Chose I/X/S : "

Shell "Choice.com /C:SXI /N /T:S,15"
; /C: followed by accepted keys
; /N do not display anything except value of acceptet key
; /T efault answer,Timeout

$Choice = @Error
; @Error returns position of key pressed in accepted keys (/C:SXI)

Select
Case $Choice = 3
? "I pressed, installing"
; Script part for Installing program
Case $Choice = 2
? "X pressed, executing"
; Script part for Executing program
Case $Choice = 1
? "S pressed, or no legal key pressed in 15 seconds, skipping"
EndSelect

; To get this working on NT, you must copy
; the program: CHOICE.COM to a location in the path
; CHOICE.COM is located in C:\Windows\Command in Win95
;
; parameters for choice.exe is shown by typing choice /?

; Next line is for testing purpose only
Get $x

Top
#48832 - 2000-01-25 10:57 AM Re: Timer
Anonymous
Unregistered


Thanks for the answer, choice.com certainly does the job.

A simple timer would be nice though, instead of calling outside of the script.

Many thanks

Icky

Top
#48833 - 2000-03-21 02:40 AM Re: Timer
Anonymous
Unregistered


Here are a couple of timers I have used...
I cannot think of a way to incorporate with user input such as GET or GETS though.

color w+/g
cls

;timer using DO..UNTIL
$count=6
do
sleep 1
$count=$count-1
at(10,8)"... continuing in another "$count" seconds ..."
until $count=0


:timer using WHILE..LOOP
$count=0
while
$count<6
sleep 1
$count=$count+1
at(15,8)"... counting up to "$count" seconds ..."
loop
? ? ?

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2419 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.055 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org