430 likes | 589 Views
;***************************************************************************. ; ICONS.PPE by Scot Thompson. ; (freeware). ; version 1.0. ;***************************************************************************. ; PPE to see if remote user 1) is using RIP, 2) has the icons for my BBS,.
E N D
;***************************************************************************;***************************************************************************
;***************************************************************************;***************************************************************************
; PPE to see if remote user 1) is using RIP, 2) has the icons for my BBS,
;--------------------Main Procedure------------------------------
STRING prog, ppe_path, key, config_file, rip_loc, files(10), filelist
IF (GRAFMODE() = "R") THEN • LOG "ICONS.PPE: PPE executed", FALSE • IF (ONLOCAL()) END • IF (!EXIST(config_file)) THEN • LOG "ICONS.PPE: config file does not exist", FALSE • END • ENDIF • rip_loc = READLINE(config_file,1) • i = 0 • WHILE (READLINE(config_file,i+2) != "") INC i • IF (testing) PRINTLN "Number read: ", i • IF (i > 11) THEN • REDIM files,i • REDIM flags,i • ENDIF • j = 0 • WHILE (j < i) DO • files(j) = READLINE(config_file, j+2) • flags(j) = rip_file_query (files(j)) • IF (testing) PRINTLN "Flag ", j," is ", flags(j) • INC j • ENDWHILE
; if the files exist, then we just go on, but if they do not exist, then
; we send them using zmodem to the terminal system (AFTER asking the user
; if they want them • j = 0 • big_flag = TRUE • WHILE (j < i) DO • big_flag = big_flag & flags(j) • INC j • ENDWHILE • IF (big_flag) THEN • LOG "ICONS.PPE: User has all icons", FALSE • END • ELSE • DISPFILE ppe_path+"XFER", SEC+LANG+GRAPH • KEYFLUSH • WHILE ( key = "") DO • key = INKEY() • DELAY 2 • ENDWHILE • IF (UPPER(key) = "Y") THEN • LOG "ICONS.PPE: User will d/l the missing icons", FALSE • chan = FNEXT() • IF ( chan = -1) THEN • LOG "ICONS.PPE: NO AVAILABLE FILE CHANNELS -- ABORTING!", FALSE • END • ELSE • FCREATE chan, filelist, O_WR, S_DN • FDEFOUT chan • j = 0 • WHILE (j < i) DO • IF (!flags(j)) FDPUTLN rip_loc+files(j) • INC j • ENDWHILE • IF (FERR(chan)) THEN • LOG "ICONS.PPE: FILE I/O ERROR -- ABORTING!", FALSE • END • ENDIF • FCLOSE chan • MPRINTLN "|9",CHR(27),"07020000<>" • SHELL TRUE, rc, prog, "1 1 @"+filelist • LOG "ICONS.PPE: icon file(s) transferred", FALSE • DELETE filelist • ENDIF • ELSE • LOG "ICONS.PPE: User didn't want to D/L the missing icons", FALSE • ENDIF • ENDIF
;---------------------RIP_FILE_QUERY FUNCTION----------------------
;sends the RIPscrip rip_file_query function to determine if the filename
;is present in the terminal. function returns an integer: 1 if filename
;does exist and 0 if it does not (true if exist/false if not exist)
WHILE ( key = "" ) DO • key = INKEY() • DELAY 2
IF ( key = "1" ) THEN • rip_file_query = TRUE