Ok I've put together some timed input. After some introduction you get 30 seconds to guess the code. You have to press enter to verify the code. The inkey$ / entry$ commands weren't working for me so I.. heh.. wrote my own. That's why it's so long winded. The function I wrote is very limited, so the code has to be in capitals and has to only contain letters and numbers. It isn't commented because DBPro didn't like comments near the function for some reason. Anyway, enjoy. Daz, you can take this code and learn from it if you want. It was completely written from scratch in about 20 mins, it doesn't directly contain any of your original code.
Watch for the fading when you enter an incorrect code...
+ Code Snippetsync on
sync rate 60
hide mouse
code$="DARKBASIC"
dim message$(8)
message$(0)="Welcome to MircoSoft Bomb Defuser XP! by The Darthster"
message$(1)="Checking for new hardware..."
message$(2)="Warning, bomb detected!"
message$(3)="Please enter the product code for your bomb."
message$(4)="It should be printed on the Certificate of Authenticity."
message$(5)="You have 30 seconds to comply..."
message$(6)="Thank you. The bomb has successfully been defused."
message$(7)="Warning, your processor will shortly undergo nuclear fusion."
for i=0 to 5
for j=1 to len(message$(i))
text j*8,i*20,mid$(message$(i),j)
sync
wait 50
next j
wait 1000
next i
t#=timer()+30000
set text opaque
do
d=c
c=scancode()
if d<>c
m$=m$+textinput(c)
if c=14 then m$=left$(m$,len(m$)-1)
if c=28
if m$=code$
codeguessed=1
else
ink 0,0
for i=1 to len(m$)+1
text i*8,120,"_"
next i
m$=""
ink rgb(255,0,0),0
incorrectcode=255
endif
endif
endif
if codeguessed=1
ink rgb(255,255,255),0
for j=1 to len(message$(6))
text j*8,160,mid$(message$(6),j)
sync
wait 50
next j
sync
suspend for key
end
endif
ink 0,0
for i=1 to len(m$)+1
text i*8,120,"_"
next i
ink rgb(255,255,255),0
text 8,120,m$
if int(((t#+30000)-timer())/1000)=0
ink rgb(255,255,255),0
for j=1 to len(message$(7))
text j*8,160,mid$(message$(7),j)
sync
wait 50
next j
suspend for key
end
endif
ink rgb(255-(int(((t#)-timer())/1000)*8.5),(int(((t#)-timer())/1000)*8.5),0),0
text 8,140,space$(80)
text 8,140,"You have "+str$((((t#)-timer())/1000))+" seconds remaining."
ink rgb(incorrectcode,0,0),0
text 200,200,"Incorrect code!"
incorrectcode=incorrectcode*0.997
sync
loop
end
function textinput(c)
select c
case 2
n$="1"
endcase
case 3
n$="2"
endcase
case 4
n$="3"
endcase
case 5
n$="4"
endcase
case 6
n$="5"
endcase
case 7
n$="6"
endcase
case 8
n$="7"
endcase
case 9
n$="8"
endcase
case 10
n$="9"
endcase
case 11
n$="0"
endcase
case 16
n$="Q"
endcase
case 17
n$="W"
endcase
case 18
n$="E"
endcase
case 19
n$="R"
endcase
case 20
n$="T"
endcase
case 21
n$="Y"
endcase
case 22
n$="U"
endcase
case 23
n$="I"
endcase
case 24
n$="O"
endcase
case 25
n$="P"
endcase
case 30
n$="A"
endcase
case 31
n$="S"
endcase
case 32
n$="D"
endcase
case 33
n$="F"
endcase
case 34
n$="G"
endcase
case 35
n$="H"
endcase
case 36
n$="J"
endcase
case 37
n$="K"
endcase
case 38
n$="L"
endcase
case 44
n$="Z"
endcase
case 45
n$="X"
endcase
case 46
n$="C"
endcase
case 47
n$="V"
endcase
case 48
n$="B"
endcase
case 49
n$="N"
endcase
case 50
n$="M"
endcase
endselect
endfunction n$