home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
PCBOARD
/
LGSRN110.ZIP
/
LOGSIREN.PPS
< prev
next >
Wrap
Text File
|
1994-02-09
|
3KB
|
114 lines
;*****************************************************************************
;* *
;* *
;* Login-Siren v1.1 *
;* Copyright (c) 1993 by Eric D. Scales *
;* *
;* Sounds a 5-second siren when a problem user logs on... *
;* *
;* *
;* Development Started 10/31/93 11:00am *
;* *
;* Call E.D.S. Development at (812) 423-3394 *
;* *
;*****************************************************************************
;***********************
;* Declare Variables *
;***********************
BOOLEAN Trouble
STRING Name, Prompts(2)
INTEGER Times
;**************************
;* Initialize Variables *
;**************************
Trouble = False
Name = ""
Times = 0
;********************************************
;* Look for Prompt file and open if found *
;********************************************
IF (EXIST(ppepath() + "SIRENTXT" + LANGEXT())) THEN
FOPEN 1, ppepath() + "SIRENTXT" + LANGEXT(), O_RD, S_DN
ELSE
IF (EXIST(ppepath() + "SIRENTXT.")) THEN
FOPEN 1, ppepath() + "SIRENTXT.", O_RD, S_DN
ELSE
PRINTLN "@X0CLOGSIREN FATAL ERROR: @X0FNo prompt file!"
DELAY 4
LOG "LOGSIREN FATAL ERROR: No prompt file!", FALSE
GOTO END
ENDIF
ENDIF
;************************************************************
;* Read all three prompts into the variable array PROMPTS *
;************************************************************
FOR Times = 0 to 2
FGET 1, Prompts(Times)
NEXT
FCLOSE 1
;************************
;* Main Program Start *
;************************
PRINTLN
DISPSTR Prompts(0)
PRINTLN
IF (EXIST(ppepath() + "LOGSIREN.BAD")) GOSUB LOOKUPUSER
IF (Trouble) THEN
DISPSTR Prompts(1)
LOG Prompts(2), FALSE
WHILE (Times<5) DO
Sound 300
Delay 5
Sound 0
Sound 600
Delay 5
Sound 0
Sound 900
Delay 5
Sound 0
Sound 1200
Delay 5
Sound 0
INC Times
ENDWHILE
ENDIF
GOTO END
;*************************************************************
;* LOOKUPUSER Subroutine *
;* *
;* Opens LOGSIREN.BAD file and looks for a substring of *
;* the user's name. *
;*************************************************************
:LOOKUPUSER
FOPEN 1, ppepath() + "LOGSIREN.BAD", O_RD, S_DW
WHILE (FERR(1) == FALSE) DO
FGET 1, Name
IF (INSTR(UPPER(U_NAME()), UPPER(NAME)) != 0) THEN
Trouble = True
FCLOSE 1
RETURN
ENDIF
ENDWHILE
FCLOSE 1
RETURN
;***********************
;* End PPE Execution *
;***********************
:END
End