Page 1 of 1 1
Topic Options
#53839 - 2001-02-13 11:53 AM Timer with bypass ??
Wizard Offline
Hey THIS is FUN
*****

Registered: 2000-12-05
Posts: 264
Loc: Bristol, England
I currently show my users a short MOTD with a delay of about 15 seconds - annoying I know

The code I use is..

code:

$count = 15
DO
AT(20,74) $count " "
AT(20,74)
SLEEP 1
$count = $count - 1
UNTIL $count = -1

Is there any way I can add to this so that I can press a key sequence, or just one key, to bypass this delay.

I suppose I could add my userID, but if I am logging on as a different user, I would still need to wait.

Thanks

Wiz

_________________________
Wizard
There's no place like 127.0.0.1

vb | kix | batch | html | cfm | js | english

Top
#53840 - 2001-02-14 12:40 AM Re: Timer with bypass ??
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Hi Wizard ,

something like this ?:

code:

?"Hit any key to cancel"
while $key = " " AND $count < 15 ; ca. 15 seconds
sleep 1
$count = $count + 1
$=sendkeys(" ")
get $key
AT(3,$ypos)"."
$ypos = $ypos + 1
loop

Jochen

_________________________



Top
#53841 - 2001-02-14 12:46 AM Re: Timer with bypass ??
Wizard Offline
Hey THIS is FUN
*****

Registered: 2000-12-05
Posts: 264
Loc: Bristol, England
Thanks.
I am usually quite good with kix, but this was a simple 'Duh' moment.

Wiz

_________________________
Wizard
There's no place like 127.0.0.1

vb | kix | batch | html | cfm | js | english

Top
#53842 - 2002-03-06 11:32 PM Re: Timer with bypass ??
celusil Offline
Fresh Scripter

Registered: 2000-07-13
Posts: 9
Loc: Chicago, IL
It looks like this should work, I thought it was an answer to my problem, but I couldn't get it to work.

windows 2000 machine.

I use the code in a script, I'm going to try using it by itself and see if it works without any other code around it.

questions: is the $key " " a space or empty and the sendkeys(" "} has to match I assume.

I tried putting a character in the two variables without success

Top
#53843 - 2002-03-07 09:28 AM Re: Timer with bypass ??
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
With the release of KiXtart 2001 there is another solution - KBHit()

This is similar to the original solution, rewritten with KBHit(). If you don't want the count down, leave out the lines marked "; Countdown"
code:
? "Hit any key to cancel: "
$iTimer=15
While KBHit()==0 AND $iTimer
$iTimer ; Countdown
sleep 1
If $iTimer > 9 Chr(8) Endif ; Countdown
Chr(8) " " Chr(8) Chr(8) ; Countdown
$iTimer=$iTimer-1
Loop
Get $sKeyHit

The $sKeyHit is set to the first key pressed.

Top
#53844 - 2002-03-11 07:05 AM Re: Timer with bypass ??
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear Celusil,

Why you are using the function MessageBox, which can wait 15 seconds
but after pressing key it will continue.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

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 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.053 seconds in which 0.024 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