home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
BBS
/
AUTOP2_0.ZIP
/
AUTOPLUS.PPS
< prev
next >
Wrap
Text File
|
1994-11-18
|
14KB
|
519 lines
;*******************************************************************************
;* *
;* Autoplus.PPE *
;* Written by Kyle Eli *
;* *
;*******************************************************************************
;*******************************************************************************
;* *
;* This is a easy-to-use and popular addition to PCBoard BBSs. Will allow user *
;* to enter a message that will be seen every time someone logs on. *
;* *
;* NEW to 2.0 *
;* Basically nothing. Just re-wrote the code from scratch and cleaned it up a *
;* a little. Also used the new FUNCTIONS/PROCEDURES. *
;* *
;* COMING SOON to 2.5 (4th Quarter '94 - 1st Quarter '95) *
;* + RIP Support *
;* + Arrow-key Interface *
;* + Sysop Configuration *
;* + Word Filtering *
;* *
;*******************************************************************************
;***********************************
;* Declare Functions and Procedures
;*
DECLARE PROCEDURE display_message() ;Displays the Automessage
DECLARE PROCEDURE display_menu() ;Displays Menu Selections
DECLARE PROCEDURE new_message() ;Makes a new message
DECLARE PROCEDURE reply_message() ;Replies to a message
DECLARE FUNCTION getch() STRING ;Gets user Input (Thanks CDC)
*USEFUNCS
;***********************************
;* Declare Global Variables
;*
STRING automessage
STRING selection
STRING YourName
STRING firstname
STRING lastname
BEGIN
;Initialize all Global Variables
automessage = PPEPATH()+"AUTOM.PLS" ;Change this to suit you
yourname = U_NAME()
Tokenize yourname
gettoken firstname
gettoken lastname
:DO_IT
display_message()
display_menu()
getuser
while (UPPER(selection) != "G") do ;While the user has not entered G
selection = getch() ;Get User Input
SELECT CASE (selection) ;Act on User Input
CASE "Q","q"
GOTO END
CASE "N","n"
new_message()
goto do_it
CASE "R","r"
reply_message()
fclose 1
goto do_it
END SELECT
endwhile
GOODBYE
:END
END
;***********************************
;* PROCEDURE reply_message Replies to a message
PROCEDURE reply_message()
STRING OldText[5]
STRING QuotedText[2]
STRING GarbageVar[4]
STRING GarbageLine[3]
STRING IsItQuoted
DATE Blah
STRING ByWhom
STRING ByWhomLast
STRING WhoDunIt
STRING WhoDunItLast
String NewText[5]
STRING today
STRING PressIt
STRING Cursor_Up
STRING Cursor_Down
STRING Your_name
STRING SaveNew
STRING OnLine
STRING TextToQuote[2]
INTEGER NewCounter
INTEGER Counter
INTEGER TICK
INTEGER Point
Counter = 1
NewCounter = 1
Cursor_Up = "UP"
Cursor_Down = "DOWN"
Your_Name = U_NAME()
Today = DATE()
Point = 1
GETUSER
FCLOSE 1
Point = 2
; WHILE (!FERR(1)) DO
Point = 7777
FOPEN 1,Automessage,O_RW,S_DN
Point = 3
FGET 1,GarbageLine[1]
FGET 1,GarbageLine[2]
FGET 1,GarbageLine[3]
Point = 4
TOKENIZE GarbageLine[1]
GETTOKEN GarbageVar[3]
GETTOKEN GarbageVar[4]
GETTOKEN ByWhom
GETTOKEN ByWhomLast
TOKENIZE GarbageLine[2]
GETTOKEN GarbageVar[1]
GETTOKEN IsItQuoted
GETTOKEN GarbageVar[2]
IF (GarbageVar[2] = "NONE") THEN
GOTO GOONDUDE
ENDIF
GETTOKEN WhoDunIt
GETTOKEN WhoDunItLast
:GOONDUDE
IF (IsItQuoted = "YES") THEN
Point = 5
FGET 1,QuotedText[1]
FGET 1,QuotedText[2]
FGET 1,OldText[1]
FGET 1,OldText[2]
FGET 1,OldText[3]
FGET 1,OldText[4]
FGET 1,OldText[5]
ELSEIF (IsItQuoted = "NO") THEN
Point = 6
FGET 1,OldText[1]
FGET 1,OldText[2]
FGET 1,OldText[3]
FGET 1,OldText[4]
FGET 1,OldText[5]
ENDIF
Point = 7
FCLOSE 1
:Sub_1
Pressit = "BLAH"
CLS
If (Counter = 1) THEN
Tick = 1
ElseIf (Counter = 2) Then
Tick = 2
ENDIF
PRINTLN "@X0AUse The Arrow Keys to Select A Line. Press [@X02ENTER@X0A] To "
PRINTLN "@X0AConfirm Your Choice. Choose Quote Line #@X09",Tick
PRINTLN ""
PRINTLN "@X0A┌─────────────────────────────────────────────────────┐"
PRINTLN "@X0A│ │"
PRINTLN "@X0A│ │"
PRINTLN "@X0A│ │"
PRINTLN "@X0A│ │"
PRINTLN "@X0A│ │"
PRINTLN "@X0A└─────────────────────────────────────────────────────┘"
ANSIPOS 3,5
PRINT "@X0E"+OldText[1]
ANSIPOS 3,6
PRINT "@X08"+OldText[2]
ANSIPOS 3,7
PRINT "@X08"+OldText[3]
ANSIPOS 3,8
PRINT "@X08"+OldText[4]
ANSIPOS 3,9
PRINT "@X08"+OldText[5]
ANSIPOS 3,5
OnLine = 1
WHILE (Pressit != CHR(13)) DO
Pressit = getch()
IF (Pressit = Cursor_Up) THEN
IF (OnLine = 1) THEN
ANSIPOS 3,5
PRINT "@X08"+OldText[1]
ANSIPOS 3,9
PRINT "@X0E"+OldText[5]
OnLine = 5
ELSEIF (OnLine = 2) THEN
ANSIPOS 3,6
PRINT "@X08"+OldText[2]
ANSIPOS 3,5
PRINT "@X0E"+OldText[1]
OnLine = 1
ELSEIF (OnLine = 3) Then
ANSIPOS 3,7
PRINT "@X08"+OldText[3]
ANSIPOS 3,6
PRINT "@X0E"+OldText[2]
OnLine = 2
ELSEIF (OnLine = 4) Then
ANSIPOS 3,8
PRINT "@X08"+OldText[4]
ANSIPOS 3,7
PRINT "@X0E"+OldText[3]
OnLine = 3
ELSEIF (OnLine = 5) Then
ANSIPOS 3,9
PRINT "@X08"+OldText[5]
ANSIPOS 3,8
PRINT "@X0E"+OldText[4]
OnLine = 4
ENDIF
ELSEIF (PressIt = Cursor_Down) Then
IF (OnLine = 1) THEN
ANSIPOS 3,5
PRINT "@X08"+OldText[1]
ANSIPOS 3,6
PRINT "@X0E"+OldText[2]
OnLine = 2
ELSEIF (OnLine = 2) THEN
ANSIPOS 3,6
PRINT "@X08"+OldText[2]
ANSIPOS 3,7
PRINT "@X0E"+OldText[3]
OnLine = 3
ELSEIF (OnLine = 3) Then
ANSIPOS 3,7
PRINT "@X08"+OldText[3]
ANSIPOS 3,8
PRINT "@X0E"+OldText[4]
OnLine = 4
ELSEIF (OnLine = 4) Then
ANSIPOS 3,8
PRINT "@X08"+OldText[4]
ANSIPOS 3,9
PRINT "@X0E"+OldText[5]
OnLine = 5
ELSEIF (OnLine = 5) Then
ANSIPOS 3,9
PRINT "@X08"+OldText[5]
ANSIPOS 3,5
PRINT "@X0E"+OldText[1]
OnLine = 1
ENDIF
ENDIF
ENDWHILE
Counter = Counter + 1
IF (Online = 1) Then
IF (Counter = 2) Then
TextToQuote[1] = OldText[1]
GOTO Sub_1
ELSEIF (Counter = 3) Then
TextToQuote[2] = OldText[1]
GOTO End
ENDIF
ELSEIF (Online = 2) Then
If (Counter = 2) Then
TextToQuote[1] = OldText[2]
GOTO Sub_1
ELSEIF (Counter = 3) Then
TextToQuote[2] = OldText[2]
GOTO End
ENDIF
ELSEIF (Online = 3) Then
If (Counter = 2) Then
TextToQuote[1] = OldText[3]
GOTO Sub_1
ELSEIF (Counter = 3) Then
TextToQuote[2] = OldText[3]
GOTO End
ENDIF
ELSEIF (Online = 4) Then
If (Counter = 2) Then
TextToQuote[1] = OldText[4]
GOTO Sub_1
ELSEIF (Counter = 3) Then
TextToQuote[2] = OldText[4]
GOTO End
ENDIF
ELSEIF (Online = 5) Then
If (Counter = 2) Then
TextToQuote[1] = OldText[5]
GOTO Sub_1
ELSEIF (Counter = 3) Then
TextToQuote[2] = OldText[5]
GOTO End
ENDIF
ENDIF
:END
DELAY 18
CLS
PRINTLN "@X0AAutoPlus Message Editor [@X02REPLY MODE@X0A]"
PRINTLN "@X0AEnter your Text. 50 Chars. Per Line, 5 Lines. Word-Wrap Enabled"
PRINTLN "@X0A────────────────────────────────────────────────────────────────"
NewCounter = 1
While (NewCounter != 6) DO
PRINT "@X0A",NewCounter,"@X0A:"
INPUTSTR "_",NewText[NewCounter],@X0A,50,MASK_ASCII(),NEWLINE+WORDWRAP
NewCounter = NewCounter + 1
EndWhile
Newline
:ReAsk
INPUTSTR "@X0ASave Automessage(@X09Y@X0A/@X09N@X0A)_",SaveNew,@X0A,1,MASK_ASCII(),NEWLINE
IF (UPPER(SaveNew) = "Y") THEN
FCLOSE 1
FCREATE 1,Automessage,O_RW,S_DN
FPUT 1,"Automessage By: "+U_NAME()+" On: "
FPUTLN 1,DATE()
FPUT 1,"Quote: YES Quoted: "+ByWhom
FPUTLN 1," "+ByWhomLast
FPUTLN 1,"──────────────────────────────────────────"
FPUTLN 1,TextToQuote[1]
FPUTLN 1,TextToQuote[2]
FPUTLN 1,NewText[1]
FPUTLN 1,NewText[2]
FPUTLN 1,NewText[3]
FPUTLN 1,NewText[4]
FPUTLN 1,NewText[5]
FCLOSE 1
GOTO TheEnd
ELSEIF (UPPER(SaveNew) = "N") THEN
GOTO TheEnd
ELSE GOTO ReAsk
ENDIF
; ENDWHILE
; PRINTLN "FERR: Error in Using File (",AutoMessage,") At Point #",Point,"."
:TheEnd
FCLOSE 1
ENDPROC
;***********************************
;* PROCEDURE new_message Makes a new message
PROCEDURE new_message()
STRING line[5]
STRING save
STRING edit
INTEGER counter
LINE[0] = " "
COUNTER = 1
EDIT = "n"
SAVE = "y"
GETUSER
:BLAH
CLS
PRINTLN "@X0AAutomessage Editor. @X095@X0A Lines, @X0950@X0A Chars per line."
PRINTLN "─────────────────────────────────────────────────────"
while (counter != "6") do
PRINT "@X0A",counter,":"
INPUTSTR "_",line[counter],@X0A,50,MASK_ASCII(),NEWLINE+WORDWRAP
counter = counter + 1
endwhile
NEWLINE
INPUTSTR "@X0AEdit Automessage(@X09Y@X0A/@X09N@X0A)_",edit,@X0A,1,"yYnN",NEWLINE+UPCASE
if (edit = "Y") then
COUNTER = 1
GOTO BLAH
endif
NEWLINE
INPUTSTR "@X0ASave Automessage(@X09Y@X0A/@X09N@X0A)_",save,@X0A,1,"yYnN",NEWLINE+UPCASE
if (save = "Y") then
GOTO SAVE
elseif (save = "N") then
GOTO END
endif
:SAVE
FCREATE 1,automessage,O_RW,S_DN
FPUT 1,"Automessage By: "+u_name()+" On: "
FPUTLN 1,DATE()
FPUTLN 1,"Quote: NO Quoted: NONE"
FPUTLN 1,"───────────────────────────────────────────"
FPUTLN 1,line[1]
FPUTLN 1,line[2]
FPUTLN 1,line[3]
FPUTLN 1,line[4]
FPUTLN 1,line[5]
FCLOSE 1
GOTO END
:END
ENDPROC
;***********************************
;* PROCEDURE display_menu Displays Menu Selections
PROCEDURE display_menu()
ANSIPOS 1,13
PRINTLN "@X1F┌────────────────────────────────────────────@X10┐@X0F"
ANSIPOS 1,14
PRINTLN "@X1F│ (@X1E@TIMELEFT@ @X1Fmins.) (@X1EN@X1F)ew (@X1ER@X1F)eply (@X1EQ@X1F)uit (@X1EG@X1F)oodbye @X10│@X0F"
ANSIPOS 1,15
PRINTLN "@X1F└@X10────────────────────────────────────────────┘@X0F"
ENDPROC
;***********************************
;* PROCEDURE display_message Displays Automessage
PROCEDURE display_message()
STRING byline
STRING aline
STRING g1
STRING g2
STRING g3
STRING g4
STRING g5
STRING bname
STRING bnamelast
STRING wdate
STRING qinfo
STRING qname
STRING qnamelast
STRING maybe
STRING qline1
STRING qline2
STRING opline1
STRING line1
STRING line2
STRING line3
STRING line4
STRING line5
CLS
FOPEN 1,automessage,O_RW,S_DN
while (!FERR(1)) do
FGET 1,byline
TOKENIZE byline
GETTOKEN g1
GETTOKEN g2
GETTOKEN bname
GETTOKEN bnamelast
GETTOKEN g3
GETTOKEN wdate
FGET 1,qinfo
TOKENIZE qinfo
GETTOKEN g4
GETTOKEN maybe
GETTOKEN g5
GETTOKEN qname
GETTOKEN qnamelast
if (maybe = "YES") then
FGET 1,aline
FGET 1,qline1
FGET 1,qline2
FGET 1,opline1
FGET 1,line1
FGET 1,line2
FGET 1,line3
FGET 1,line4
FGET 1,line5
PRINTLN "@X0AAutomessage By: @X09"+bname+" "+bnamelast+" @X0AOn: @X09"+wdate
PRINTLN "@X0AQuoted Text By: @X09"+qname+" "+qnamelast
PRINTLN "@X0A"+aline
PRINTLN "@X0B-> @X09"+qline1
PRINTLN "@X0B-> @X09"+qline2
PRINTLN opline1
PRINTLN "@X09"+line1
PRINTLN "@X09"+line2
PRINTLN "@X09"+line3
PRINTLN "@X09"+line4
PRINTLN "@X09"+line5
NEWLINE
GOTO END
elseif (maybe = "NO") then
FGET 1,aline
FGET 1,line1
FGET 1,line2
FGET 1,line3
FGET 1,line4
FGET 1,line5
PRINTLN "@X0AAutomessage By: @X09"+bname+" "+bnamelast+" @X0AOn: @X09"+wdate
PRINTLN "@X0A"+aline
PRINTLN "@X09"+line1
PRINTLN "@X09"+line2
PRINTLN "@X09"+line3
PRINTLN "@X09"+line4
PRINTLN "@X09"+line5
NEWLINE
GOTO END
endif
endwhile
PRINTLN "@X0CError! ("+automessage+")"
FCLOSE 1
WAIT
END
:END
FCLOSE 1
ENDPROC
;***************************
;* FUNCTION getch Gets a Character from the User
FUNCTION getch() STRING
while (getch = "") do
getch = INKEY()
endwhile
ENDFUNC