home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / pcboard / ppage10b.zip / PPE-PAGE.PPS < prev    next >
Text File  |  1993-05-03  |  11KB  |  263 lines

  1. ;*****************************************************************************
  2. ;*                                                                           *
  3. ;*                             PPE-PAGE v1.00b                               *
  4. ;*                  PCBOARD 15.0 OPERATOR PAGE PPE PROGRAM                   *
  5. ;*                                                                           *
  6. ;*                Written by Larry Steele and Jerry Claxton                  *
  7. ;*                 Written in PCBoard Programming Language                   *
  8. ;*                         Compiled on 05-03-1993                            *
  9. ;*                                                                           *
  10. ;*                   "The Shoppe Bulletin Board Systems"                     *
  11. ;*               Node 1 - 708-888-0725 - [16.8 DS] - 80486/50                *
  12. ;*               Node 2 - 708-888-1162 - [16.8 DS] - 80486/40                *
  13. ;*               Node 3 - 708-888-0078 - [16.8 DS] - 80486/40                *
  14. ;*               Node 4 - 708-888-4175 - [16.8 DS] - 80486/40                *
  15. ;*               Node 5 - PRIVATE LINE - [16.8 DS] - 80486/66                *
  16. ;*****************************************************************************
  17.  
  18.  
  19. ;*****************************************************************************
  20. ;* Define variable types                                                     *
  21. ;*****************************************************************************
  22.  
  23. INTEGER  DotCount, SecLowLevel, SecHighLevel, XColumn, YRow
  24. INTEGER  TotalUsers, Lp, AbortFlag, SoundCount
  25.  
  26. STRING   PageConfigFile, PageTrashCanFile, PageWelcomeFile, PageCommentFile
  27. STRING   BeginTimeString, EndingTimeString, PageDayString, TrashCanUser(250)
  28.  
  29. STRING   Answer, Reason, KeyPress
  30.  
  31. TIME     BeginTime, EndingTime, CurrentTime
  32.  
  33. ;*****************************************************************************
  34. ;* Parse out the configuration file from the command line.  Open the file so *
  35. ;* we can grab all the information needed to run the program.                *
  36. ;*****************************************************************************
  37.  
  38. ;GETTOKEN PageConfigFile
  39.  
  40. IF (EXIST(PPEPATH() + "PPE-PAGE.CNF") = 0) THEN
  41.      PRINTLN
  42.      PRINTLN "ERROR: File " + PageConfigFile + " not found!  Please nodify SysOp..."
  43.      PRINTLN
  44.      WAIT
  45.      END
  46. END IF
  47.  
  48. FOPEN 1, PPEPATH() + "PPE-PAGE.CNF", O_RD, S_DN
  49.   FGET 1, SecLowLevel
  50.   FGET 1, SecHighLevel
  51.   FGET 1, BeginTimeString
  52.   FGET 1, EndingTimeString
  53.   FGET 1, PageDayString
  54.   FGET 1, PageTrashCanFile
  55.   FGET 1, PageWelcomeFile
  56.   FGET 1, PageCommentFile
  57. FCLOSE 1
  58.  
  59.  
  60. ;*****************************************************************************
  61. ;* Get Information from PCBOARD.SYS for this caller                          *
  62. ;* Write some information to the callerlog                                   *
  63. ;*****************************************************************************
  64.  
  65. GETUSER
  66. LOG U_NAME() + " (" + STRING(U_SEC) + ") SysOp Page at (" + LEFT(STRING(TIME()), 5) + ")", 0
  67.  
  68.  
  69. ;*****************************************************************************
  70. ;* Below we read the PCAN file for a list of users we DON'T won't to be able *
  71. ;* to page for the SysOp.                                                    *
  72. ;*****************************************************************************
  73.  
  74. IF (EXIST(PageTrashCanFile) > 0) THEN
  75.      FOPEN 1, PageTrashCanFile, O_RD, S_DN
  76.      FGET 1, TotalUsers
  77.  
  78.      FOR Lp = 1 TO TotalUsers
  79.           FGET 1, TrashCanUser(Lp)
  80.           IF (U_NAME() = UPPER(TrashCanUser(Lp))) GOTO WRONG_USER
  81.      NEXT Lp
  82.      FCLOSE 1
  83. END IF
  84.  
  85. ;*****************************************************************************
  86. ; Get the current system TIME                                                *
  87. ;                                                                            *
  88. ; If time is in HH:MM format adjust to HH:MM:SS or they won't work right     *
  89. ; then convert from STRING TIME to INTEGER TIME.                             *
  90. ;*****************************************************************************
  91.  
  92. CurrentTime = TIME()
  93.  
  94. IF (LEN(BeginTimeString) = 5) LET BeginTimeString = BeginTimeString + ":00"
  95. IF (LEN(EndingTimeString) = 5) LET EndingTimeString = EndingTimeString + ":00"
  96.  
  97. PageDayString = LEFT(PageDayString + "YYYYYYY", 7)
  98.  
  99. BeginTime = BeginTimeString
  100. EndingTime = EndingTimeString
  101.  
  102.  
  103. ;*****************************************************************************
  104. ; Check the users current security level against command line security level *
  105. ; Check to see if START TIME is before END TIME.                             *
  106. ;*****************************************************************************
  107.  
  108. IF (U_SEC < SecLowLevel | U_SEC > SecHighLevel) GOTO WRONG_SECURITY
  109.  
  110. IF ((BeginTime <= EndingTime) & (BeginTime <> 0) & (EndingTime <> 0)) THEN
  111.    IF (CurrentTime < BeginTime | CurrentTime > EndingTime) GOTO WRONG_TIMES
  112. ELSE
  113.    IF (CurrentTime < BeginTime & CurrentTime > EndingTime) GOTO WRONG_TIMES
  114. END IF
  115.  
  116. IF (UPPER(MID(PageDayString, DOW(DATE()) + 1, 1)) = "N") GOTO WRONG_DAY
  117.  
  118. ;*****************************************************************************
  119. ; Start of Main PPE-PAGE.PPE                                                  *
  120. ;*****************************************************************************
  121.  
  122. CLS
  123. IF (EXIST(PageWelcomeFile)) THEN
  124.     DISPFILE PageWelcomeFile, LANG + SEC + GRAPH
  125. ELSE
  126.     PRINTLN "@X70┌────────────────────────────────────────────────────────────────────────────@X7F┐@X07"
  127.     PRINTLN "@X70│ @X75* @X74PCBOARD @X75*     @X70==@X71 O  P  E  R  A  T  O  R    P  A  G  E @X70==     @X75* @X74PCBOARD @X75* @X7F│@X07"
  128.     PRINTLN "@X70└@X7F────────────────────────────────────────────────────────────────────────────┘@X07"
  129. END IF
  130.  
  131. PRINTLN
  132. INPUTTEXT "Why do you want to page the SysOp", Reason, 0Eh, 43
  133. IF ((Reason = "") | (LEN(Reason) <= 3)) GOTO ABORT_PAGE
  134. IF (Reason <> "") GOSUB DISPLAY_BBSSIDE
  135.  
  136. LOG "Reason: " + Reason, 0
  137.  
  138. CurrentTime = TIME()
  139. NEWLINES 2
  140. PRINT "@X0EPage ends in 30 seconds. @X0C(@X0ECtrl-K@X0C) @X0EAborts @X0F."
  141. WHILE ((CurrentTime + 30) > TIME()) DO
  142.      AbortFlag = (ABORT())
  143.      IF (AbortFlag) GOTO USER_ABORT_PAGE
  144.  
  145.      KeyPress = KINKEY()
  146.      IF (KeyPress = CHR(32)) GOTO SYSOP_CHAT
  147.      
  148.      DotCount = DotCount + 1
  149.      IF ((DotCount % 100) == 0) THEN
  150.           PRINT "@X0F."
  151.           SoundCount = SoundCount + 1
  152.           IF ((SoundCount % 2) == 0) THEN
  153.                PRINT "@X09."
  154.                SOUND (1100)
  155.                DELAY (8)
  156.                SOUND (800)
  157.                DELAY (6)
  158.           END IF
  159.           SOUND (0)
  160.      END IF
  161. ENDWHILE
  162.  
  163. IF (PAGESTAT() = 0) PAGEON
  164. GOTO NOT_HOME
  165.  
  166. ;*****************************************************************************
  167. ; End of Main PPE-PAGE.PPE                                                    *
  168. ;*****************************************************************************
  169. END
  170.  
  171. ;*****************************************************************************
  172. ; This is all the GOTO and GOSUB LABELS                                      *
  173. ;*****************************************************************************
  174.  
  175.  
  176. :DISPLAY_BBSSIDE
  177.      WRUNET PCBNODE(), "Paging SysOp", U_NAME(), U_CITY, "", ""
  178.      XColumn = GETX()
  179.      YRow = GETY()
  180.      ANSIPOS 1, 1
  181.  
  182.      COLOR 63
  183.      SPRINTLN "┌────────────────────────────────────────────────────────────────────────────┐"
  184.      SPRINTLN "│ [SysOp] - Press (SPACE) to acknowledge Operator Page, (ESC) when finished. │"
  185.      SPRINTLN "└────────────────────────────────────────────────────────────────────────────┘"
  186.  
  187.      COLOR DEFCOLOR()
  188.      ANSIPOS XColumn, YRow
  189.      RETURN
  190.  
  191.  
  192. :NOT_HOME
  193.      NEWLINES 2
  194.      IF (EXIST(PageCommentFile)) THEN
  195.          DISPFILE PageCommentFile, LANG + SEC + GRAPH
  196.      ELSE
  197.          PRINTLN "@X0CSorry, the Sysop is not currently available for CHAT!"
  198.      END IF
  199.      GOTO PROMPT_USER
  200.  
  201.  
  202. :WRONG_USER
  203.      FCLOSE 1
  204.      PRINTLN
  205.      PRINTLN "@X0CSorry, the Sysop is not currently available for CHAT!"
  206.      GOTO PROMPT_USER
  207.  
  208.  
  209. :WRONG_SECURITY
  210.      PRINTLN
  211.      PRINTLN "@X0ESorry, insufficient Security to page for SysOp!"
  212.      GOTO PROMPT_USER
  213.  
  214.  
  215. :WRONG_TIMES
  216.      PRINTLN
  217.      PRINTLN "@X70┌────────────────────────────────────────────────────────────────────────────@X7F┐@X07"
  218.      PRINTLN "@X70│ @X71Sorry, @FIRST@, you may only PAGE for the SysOp in the HOURS listed below:@POS:78@@X7F│@X07"
  219.      PRINTLN "@X70└@X7F────────────────────────────────────────────────────────────────────────────┘@X07"
  220.      PRINTLN
  221.      PRINTLN "@X70┌────────────────────────────────────────────────────────────────────────────@X7F┐@X07"
  222.      PRINTLN "@X70│ @X74Beginning Time: @X7E" + STRING(BeginTime) + " am                       @X74Ending Time: @X7E" + STRING(EndingTime) + " pm @X7F│@X07"
  223.      PRINTLN "@X70└@X7F────────────────────────────────────────────────────────────────────────────┘@X07"
  224.      GOTO PROMPT_USER
  225.  
  226.  
  227. :WRONG_DAY
  228.      PRINTLN
  229.      PRINTLN "@X70┌────────────────────────────────────────────────────────────────────────────@X7F┐@X07"
  230.      PRINTLN "@X70│ @X71Sorry, @FIRST@, you may only PAGE for the SysOp in the DAYS listed below: @POS:78@@X7F│@X07"
  231.      PRINTLN "@X70└@X7F────────────────────────────────────────────────────────────────────────────┘@X07"
  232.      PRINTLN
  233.      PRINTLN "@X07@X70┌────────────────────────────────────────────────────────────────────────────@X7F┐@X07"
  234.      PRINTLN "@X70│  @X74SUN@X70=@X71" + MID(PageDayString, 1, 1) + "      @X74MON@X70=@X71" + MID(PageDayString, 2, 1) + "      @X74TUE@X70=@X71" + MID(PageDayString, 3, 1) + "      @X74WED@X70=@X71" + MID(PageDayString, 4, 1) + "      @X74THU@X70=@X71" + MID(PageDayString, 5, 1) + "      @X74FRI@X70=@X71" + MID(PageDayString, 6, 1) + "      @X74SAT@X70=@X71" + MID(PageDayString, 7, 1) + "   @X7F│@X07"
  235.      PRINTLN "@X70└@X7F────────────────────────────────────────────────────────────────────────────┘@X07"
  236.      GOTO PROMPT_USER
  237.  
  238.  
  239. :PROMPT_USER
  240.      PRINTLN
  241.      INPUTYN "Would you like to leave a comment to the Sysop instead Y/N", Answer, 0Ah
  242.      IF (Answer <> YESCHAR()) STOP
  243.  
  244.      KBDSTUFF "C" + CHR(13) + "Y" + CHR(13)
  245.      END
  246.  
  247.  
  248. :SYSOP_CHAT
  249.      CHAT
  250.      END
  251.  
  252.  
  253. :ABORT_PAGE
  254.      END
  255.  
  256.  
  257. :USER_ABORT_PAGE
  258.      RESETDISP
  259.      IF (PAGESTAT() = 0) PAGEON
  260.  
  261.      NEWLINES 1
  262.      END
  263.