home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / BBS / POWPP200.ZIP / POWERPPL.200 / OPPAGE.PPS < prev    next >
Text File  |  1994-09-19  |  5KB  |  147 lines

  1. ;***********************************************************************
  2.  
  3. ; OPPAGE.PPS - An O command (operator page) replacement
  4.  
  5. ;***********************************************************************
  6.  
  7. ; Variable Declarations
  8.  
  9. TIME    pTime    ' The time at which the user requested the page
  10. TIME    sTime    ' The start time at which paging is allowed for all
  11. TIME    eTime    ' The end time at which paging is allowed for all
  12.  
  13. INTEGER x        ' Temporary storage for cursor x position
  14. INTEGER y        ' Temporary storage for cursor y position
  15. INTEGER i        ' Index variable for page loop
  16. INTEGER maxTries ' The maximum tries allowed to page the SysOp
  17.  
  18. STRING  msg      ' A variable to hold the message to be displayed
  19.                  ' to the SysOp
  20. STRING  ynAns    ' A generic variable to hold a yes/no response
  21.  
  22. STRING  BEEP     ' An ASCII beep
  23. STRING  CR       ' An ASCII carriage return
  24. STRING  ANSI     ' ANSI escape sequence header
  25. STRING  HOME     ' ANSI home sequence
  26. STRING  CLREOL   ' ANSI clear to end of line sequence
  27.  
  28. ;***********************************************************************
  29.  
  30. ; Initializations
  31.  
  32. LET pTime    = TIME()                 ' Start time of the page
  33. LET sTime    = READLINE(PCBDAT(),189) ' Read these two from the
  34. LET eTime    = READLINE(PCBDAT(),190) ' PCBOARD.DAT file
  35.  
  36. LET maxTries = 5
  37.  
  38. LET BEEP     = CHR(7)
  39. LET CR       = CHR(13)
  40. LET ANSI     = CHR(27)+"["
  41. LET HOME     = ANSI+"0;0H"
  42. LET CLREOL   = ANSI+"K"
  43.  
  44. ;***********************************************************************
  45.  
  46. ; Main Program
  47.  
  48. ' If pagins is allowed right now or if the user has SysOp level access
  49. IF (((pTime>=sTime) & (pTime<=eTime)) | (CURSEC()>=SYSOPSEC())) THEN
  50.  
  51.   ' If SysOp level access or caller hasn't already paged
  52.   IF ((CURSEC() >= SYSOPSEC()) | !PAGESTAT()) THEN
  53.  
  54.     ' The user may page (either a valid time or high security level)
  55.  
  56.     DISPTEXT 579,LFBEFORE ' Display the paging SysOp message
  57.     DISPTEXT 97,LFBEFORE  ' Display the time and abort information
  58.  
  59.     ' Tell SysOp what to do
  60.     LET msg = SPACE(15)+"Press (Space) to acknowledge Page, "
  61.     LET msg = msg+"(Esc) when done."
  62.     GOSUB topLineMsg
  63.  
  64.     FOR i = 1 TO maxTries
  65.  
  66.       ' Display a walking dot and beep at remote caller and SysOp
  67.       PRINT "."
  68.       MPRINT BEEP
  69.       GOSUB localBeep
  70.  
  71.       ' If SysOp hits the space bar . . .
  72.       IF (KINKEY() = " ") THEN
  73.         LET msg = ""     ' Clear the SysOp message
  74.         GOSUB topLineMsg
  75.         CHAT             ' Start SysOp chat
  76.         PAGEOFF          ' Since we've chatted, turn off page indicator
  77.         END              ' Exit
  78.       ENDIF
  79.  
  80.       ' If user aborted page, set up to exit loop
  81.       IF (ABORT()) LET i = maxTries+1
  82.  
  83.     NEXT
  84.  
  85.     ' Clear the SysOp message
  86.     LET msg = ""
  87.     GOSUB topLineMsg
  88.  
  89.     ' If user aborted page . . .
  90.     IF (ABORT()) THEN
  91.       RESETDISP ' Reset the display so more info may be displayed
  92.       NEWLINE   ' Send a newline
  93.       END       ' Exit
  94.     ELSE
  95.       NEWLINE   ' Otherwise a newline is sufficient
  96.     ENDIF
  97.  
  98.   ENDIF
  99.  
  100. ENDIF
  101.  
  102. ' The user shouldn't be allowed to page (or page not successful), so
  103. PAGEON                                         ' Turn on paged indicator
  104.  
  105. DISPTEXT 128,LFBEFORE+NEWLINE                  ' SysOp not available
  106.  
  107. LET ynAns = NOCHAR()                           ' Default to no
  108. PROMPTSTR 571,ynAns,1,"",YESNO+NEWLINE+LFAFTER+FIELDLEN+UPCASE
  109.  
  110. IF (ynAns = YESCHAR()) KBDSTUFF "C"+CR+"Y"+CR  ' If yes do a comment
  111.  
  112. END
  113.  
  114. ;***********************************************************************
  115.  
  116. :topLineMsg ' Clear the top line of the BBS screen and display a message
  117.  
  118. LET x = GETX()     ' Save the cursor position
  119. LET y = GETY()
  120.  
  121. SPRINT HOME,CLREOL ' Pos in upper left of display and clear the line
  122.  
  123. SPRINT msg         ' Display message to the SysOp
  124.  
  125. SPRINT ANSI+STRING(y)+";"+STRING(x)+"H" ' Restore original position
  126.  
  127. RETURN             ' Return to the calling routine
  128.  
  129. ;***********************************************************************
  130.  
  131. :localBeep ' Routine to alert the SysOp (not the caller)
  132.  
  133. SOUND 110  ' Sound a 110 hertz tone locally
  134. DELAY 2    ' Pause for a couple of clock ticks
  135. SOUND 220  ' Sound a 220 hertz tone locally
  136. DELAY 2    ' Pause for a couple of clock ticks
  137. SOUND 440  ' Sound a 440 hertz tone locally
  138. DELAY 2    ' Pause for a couple of clock ticks
  139. SOUND 880  ' Sound a 880 hertz tone locally
  140. DELAY 2    ' Pause for a couple of clock ticks
  141. SOUND 0    ' Turn off the speaker
  142. DELAY 10   ' Pause for the remainder of the clock ticks
  143.  
  144. RETURN     ' Return to the calling routine
  145.  
  146. ;***********************************************************************
  147.