home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 12 / CD_ASCQ_12_0294.iso / vrac / nufilz20.zip / N.PPS < prev    next >
Text File  |  1994-01-26  |  17KB  |  507 lines

  1.  
  2. date reg_date
  3. integer retcode, i, x, z, conf_num, y
  4. string lines, lines_two, file, flag(10), return_value, answer, files(100), file_list
  5. STRING cnames_path, upld_path, conf_path, date_since, dir_range, answer2, view
  6. STRING zip_file, temp, temp2, token_count, scan_conf, conf_to_scan, temp_tok_str
  7. string conf_scan, choose_one, cmdline, scan_date, dir_num(20), total_dir, input_line
  8. string center_text, total_cmdline, position
  9. cls
  10. ;join 0
  11.  
  12. gettoken cmdline
  13.   x = 0
  14.   if (cmdline = "") goto premain
  15.   if (upper(cmdline) = "H") then
  16.      dispfile ppepath() + "newfiles.hlp", ""
  17.      wait
  18.   elseif (cmdline = "1") then
  19.      gettoken cmdline
  20.                                          ; println "date: ", cmdline
  21.         if (cmdline = "") then
  22.                                          ; println " No cmdline"
  23.                                          ; println strip(U_Ldir(), "-")
  24.            cmdline = strip(U_Ldir(), "-")
  25.                                           ; println "Cmdline: ", cmdline
  26.            kbdstuff "N"
  27.            gosub version_num
  28.            gosub check_date
  29.            end
  30.         elseif (cmdline <> "") then
  31.            date_since = cmdline
  32.                                           ; println "you entered somethin ", date_since
  33.            gettoken cmdline
  34.              if (cmdline = "") then
  35.                kbdstuff "N " + date_since
  36.              elseif (cmdline <> "") then
  37.               ; kbdstuff "N " + date_since + " "
  38.                x = 0
  39.                                               ;   println " We are here"
  40.                while (cmdline <> "")do
  41.                   x = x + 1
  42.                                                ; println cmdline + " "
  43.                   dir_num(x) = cmdline
  44.                   total_dir = total_dir + " " +  cmdline
  45.                   gettoken cmdline
  46.                endwhile
  47.             kbdstuff "N " + date_since + " " + total_dir
  48.              endif
  49.           endif
  50.          gettoken cmdline
  51.            if (cmdline = "") then
  52.               println
  53.               input_line = " @X0EPlease input Directories to Scan@X07"
  54.            else
  55.              input_line = " @X06D@X0Eirectories: " + total_dir + "@X07"
  56.            endif
  57.          println "      @X0BYou are scanning from: @X0F", date_since + "@X07" + input_line
  58.          println
  59.                                    ;println "dir: ", cmdline
  60.         if (cmdline = "") then
  61.           end
  62.         elseif (upper(cmdline) = "A") then
  63.                                                ; println "you chose all"
  64.           kbdstuff "A" + chr(34)
  65.  
  66.         elseif (cmdline <>"") then
  67.           println
  68.           println " you got here"
  69.           println "      @X0BYou are scanning from:@X0F " , date_since, "@X0E  Please select directoires to scan@X07"
  70.           println
  71.           kbdstuff cmdline
  72.       endif
  73.     end
  74.  
  75.   elseif (cmdline = "2") then
  76.     gettoken cmdline
  77.                                                       ;println "cmdline (date): " ,cmdline
  78.       if (cmdline = "") then date_since = strip(U_Ldir(), "-")
  79.         gosub version_num
  80.         gosub check_date
  81.         goto main
  82.       elseif (len(cmdline) =>7) then date_since = strip(cmdline, "-")
  83.       else
  84.         date_since = cmdline
  85.        endif
  86.                                             ; println "date: " ,date_since
  87.     gettoken cmdline
  88.       if (cmdline = "") then cmdline = "A"
  89.  
  90.       elseif (cmdline <>"") then
  91.         while (cmdline <> "") do
  92.            total_dir = total_dir + " " + cmdline
  93.            gettoken cmdline
  94.         endwhile
  95.       answer = total_dir
  96.       endif
  97.  
  98.     gosub version_num
  99.     gosub check_date
  100.    println
  101.  
  102.    println "          @X0FYou are @X0Bscanning @X0Ffrom@X0C " + date_since + "@X0F with the following @X0Adirectories@X07"
  103.    println
  104.    goto directories
  105.    end
  106.   elseif (len (cmdline => 7)) then
  107.       gosub version_num
  108.       gosub check_date
  109.       date_since = (strip(cmdline, "-"))
  110.       gettoken cmdline
  111.             println "                 @X0FType @X0DN @X0Fat main prompt for @X0Amenu, @X0FN H for @X0Ehelp@X07"
  112.       println
  113.      IF (CMDLINE = "") then
  114.       println "                           @X0BScanning @X0Ffrom @X0E" + date_since + "@X07"
  115.       println
  116.      else
  117.        while (cmdline <> "") do
  118.           total_cmdline = total_cmdline + " " + cmdline
  119.           gettoken cmdline
  120.        endwhile
  121.        cmdline = total_cmdline
  122.        ;x = len(date_since) + len(cmdline) + 28
  123.        ;println x
  124.        ; y = 40 - (x/2)
  125.         ;println y
  126.        ; position = "@POS" , y , "@"
  127.        println "@POS:16@@X0BScanning @X0Ffrom @X0E" + date_since + "@X0F Directory(s):@X0A " + cmdline + "@X07"
  128.         delay 50
  129.       endif
  130.     cmdline = "N " + date_since + " " + cmdline
  131.     kbdstuff cmdline
  132.     end
  133.  
  134.   else goto premain
  135.   endif
  136. ;end
  137.  
  138. :premain
  139. choose_one = ""
  140.  gosub version_num
  141. println
  142. println "              @X0FWould you like to @X0Escan @X0Ffor all the @X0Cnew files @X0Fusing the "
  143. println " @X0F             standard PCBoard scan or would you like to @X0Escan @X0Ffor @X0Cnew@X07"
  144. println "             @X0C files @X0Fand @X0Ddownload a list @X0Fof new file descriptions.@X07"
  145. println
  146. println "        Enter N 1 for regular PCBoard scan followed by date and directories"
  147. println "        Enter N 2 for newfiles scan with listing of files and descriptions"
  148. println "               Typing N1 or N2 at the main prompt will skip this menu"
  149. println
  150. println "         @X0F              1. @X0BRegular PCBoard New files scan@X07"
  151. println "         @X0F              2. @X0ANew file scan with descriptions@X07"
  152. println
  153. inputstr "               @X0FChoose one of the above(C/R to abort, @X0EH@X0F)elp)@X07", choose_one, 0Eh, 1, "12HhqQ", guide +fieldlen +upcase+lfafter
  154. cls
  155. if (choose_one = "") then
  156.  end
  157. elseif (choose_one = "1") then
  158.  newlines 2
  159.  kbdstuff "N"
  160.  end
  161. elseif (choose_one = "2") then
  162.  goto init
  163. elseif (choose_one = "H")then
  164.  dispfile ppepath() + "newfiles.hlp", ""
  165.  goto premain
  166. else goto init
  167. endif
  168.  
  169.  
  170. :init
  171.  gosub version_num
  172. gosub register_num
  173.  
  174. println
  175. if (x <> "99") gosub check_date
  176.  
  177.  
  178. :main
  179. println
  180. cnames_path = READLINE(PCBDAT(), 31)
  181. upld_path = readline(cnames_path,16)
  182. conf_path = readline (pcbdat(),27)  ; use 179 for temp dir path
  183. println " @X0B ┌─────────────────────────────────────────────────────────────────────────┐@X07"
  184. println "@X0B  │ @X0FThe @X0Enew @X0Afile @X0Dnames  @X0Fwill automatically be placed in a downloadable list @X0B│@X07"
  185. println "@X0B  │ @X0Fcalled @X0CNEWFILZ" + string(pcbnode()) + ".ZIP @X0Fand will be @X0Bflagged for download.                   │@X07"
  186. println "@X0B  └─────────────────────────────────────────────────────────────────────────┘@X07"
  187. println
  188.                                       ;println date_since
  189. temp = temppath() + "flag.lst"
  190. temp2 = temppath() + "newfiles.lst"
  191. if (exist(temp)) delete temp
  192. if (exist(temp2)) delete temp2
  193. if (date_since = "") date_since = strip(U_Ldir(), "-")
  194. if (total_dir = "") answer = "A"
  195. :scan_date
  196. inputstr "@X0A    What date to scan from @X0E(C/R for last date on)@X07 ", date_since, 0Eh, 6 , "0123456789-", fieldlen + guide + lfafter
  197. if (date_since = "") then
  198.   let date_since = U_LDATE()
  199.  else let date_since = date_since
  200.  endif
  201. answer2 = ""
  202. println
  203. println " @X0A   ╔════════════════════════════════════════════════════════════════════╗@X07"
  204. println "@X0A    ║@X07 E@X0Fnter the range of file directories you want to scan for new files.@X0A║@X07"
  205. println "@X0A    ║@X07 Y@X0Fou may enter a @X0Esingle @X0Fdirectory, a @X0Erange @X0Fof directories or        @X0A║@X07"
  206. println "@X0A    ║ @X0DU @X0Ffor the upload directory or @X0CA @X0Ffor all directories and for all    @X0A║@X07"
  207. println "    @X0A║ @X0Fconferences or @X0EQ for Quit                                          @X0A║@X07"
  208. println " @X0A   ╚════════════════════════════════════════════════════════════════════╝@X07"
  209. println
  210. println "         @X0F@X0BIndividual directories @X0Fshould be separated by a @X0Aspace@X07"
  211. println "         @X0ERange of directories @X0Fshould be separated by a @X0Ddash @X0F( - )@X07"
  212. println
  213. :directories
  214. println "           @X0FMain @X0BDirectories - (@X0C A@X0F)ll @X0EQ@X0F)uit @X0Erange @X0For @X0Asingle directory@X0B) @X07"
  215. inputstr "@X0C   Dir # @X07" , answer, 0Ch, 55, "0123456789UuAaQq- ", fieldlen+upcase+guide+newline
  216. answer = upper(answer)
  217. if (answer = "A") then
  218.    conf_scan = readline(pcbdat(),108)
  219.    dir_range = answer
  220.    goto make_list
  221. elseif (answer = "") then
  222.   goto all_done
  223. elseif (answer = "U") then
  224.   dir_range = "U"
  225.   goto make_list
  226. elseif (answer = "Q") then
  227.   goto all_done
  228. else
  229.  dir_range = answer
  230.  goto make_list
  231.  goto all_done
  232. endif
  233. println
  234.  
  235. :make_list
  236.  
  237. if (conf_num < 2 & answer <> "A") then    ;******* change the 2******
  238.    newlines 2
  239.    scan_conf = "N"
  240.    println "       T@X0Fhe @X07m@X0Fain @X07d@X0Firectories @X07s@X0Fcanned @X07i@X0Fs @X0E(@X0F",answer, answer2, "@X0E)@X07"
  241.    println
  242. elseif (conf_num > 1 & answer = "A") then
  243.    scan_conf = "Y"
  244. endif
  245.  
  246. :conf_scans
  247.  
  248.  println "      T@X0Fhe main @X0Afile directories @X07a@X0Fre @X07b@X0Feing @X07s@X0Fcanned @X07f@X0From @X0E(@X0F", date_since, "@X0E)@X07"
  249.  
  250.  println
  251.  println "    @X0B┌──────────────────────────────────────────────────────────────────┐@X07"
  252.  println "    @X0B│ @X0FNow you can scan individual @X0Econferences @X0B(@X0Fall of the directories@X0B) @X0B│@X07"
  253.  println "   @X0B └──────────────────────────────────────────────────────────────────┘@X07"
  254.  println
  255.  println "   W@X0Fhich @X0EConferences @X07w@X0Fould @X07y@X0Fou @X07l@X0Fike @X07t@X0Fo @X07s@X0Fcan - @X07o@X0Fther @X07t@X0Fhan @X07t@X0Fhe @X07m@X0Fain @X07b@X0Foard@X07"
  256.  inputstr "@X0E   (@X0BC/R @X0Ffor main -@X0B Q@X0F)uit - @X0BA@X0F)ll - or individual numbers@X0E)@X07",conf_to_scan, 0Bh, 30, "0123456789QA ", fieldlen + guide + upcase+newline + stacked
  257.   if (conf_to_scan = "") then
  258.     conf_to_scan = 0
  259.    ; kbdstuff chr(13)
  260.    ; join 0
  261.    gosub view_it
  262.    gosub scan_em
  263.    gosub clean_file
  264.    goto zip_it_up
  265.    ;dir "N;" + date_since + ";" + dir_range + ";NS"
  266.   elseif (conf_to_scan = "Q") then
  267.    goto all_done
  268.   elseif (conf_to_scan = "A") then
  269.    dir_range = conf_to_scan
  270.    gosub view_it
  271.    gosub scan_em
  272.    gosub scan_all_conf
  273.    gosub clean_file
  274.    goto zip_it_up
  275.   else
  276.    gosub view_it
  277.    gosub scan_em
  278.    gosub scan_conf
  279.    gosub clean_file
  280.    goto zip_it_up
  281.   endif
  282.  
  283.  ;end
  284.  
  285. ;********************************************************
  286. :view_it
  287. ;********************************************************
  288. view = "N"
  289. println
  290. inputstr "  @X07 W@X0Fould @X07y@X0Fou @X07l@X0Fike @X07t@X0Fo @X0Aview @X0F@X07t@X0Fhe @X0Bscan process @X0F(@X0Eslower if viewed@X0F)(@X0EQ@X0F)@X0Euit@X07 ", view, 0Bh, 1, "YyNnQq", fieldlen+guide+upcase+newline
  291. if (view = "N") showoff
  292. if (view = "Q") goto all_done
  293. dir_range = answer
  294. temp = "newfilz" + string(pcbnode())
  295. temp2 = ".zip"
  296. zip_file = upld_path + temp
  297. opencap  temppath() + "newfile2.lst", retcode
  298. return
  299.  
  300. ;*********************************************************
  301. :scan_em
  302. ;*********************************************************
  303.  println
  304.  println "          @X07M@X0Faking @X07N@X0Few @X07F@X0Files @X07L@X0Fist - @X07T@X0Fhis @X07m@X0Fay @X07t@X0Fake a @X07l@X0Fittle @X07t@X0Fime @X07@X07"
  305. kbdstuff chr(13)
  306. dir "N;" + date_since + ";" + dir_range +";NS"
  307. return
  308.  
  309. ;**********************************************************
  310. :scan_all_conf
  311. ;**********************************************************
  312. showon
  313. i=0
  314.  while (i < 2) do
  315.    i = i + 1
  316.    join i
  317.    kbdstuff chr(13)
  318.    dir "N;" + date_since + ";A;NS"
  319.  endwhile
  320. goto all_done
  321. return
  322.  
  323. ;**********************************************************
  324. :scan_conf
  325. ;**********************************************************
  326.  tokenize conf_to_scan
  327.    while (tokcount() > 0) do
  328.     let conf_to_scan = gettoken()
  329.     temp_tok_str = tokenstr()
  330.     join conf_to_scan
  331.     kbdstuff chr(13)
  332.     dir "N;" + date_since + ";A;NS"
  333.     tokenize temp_tok_str
  334.    endwhile
  335. return
  336.  
  337. ;**********************************************************
  338. :clean_file
  339. ;**********************************************************
  340. closecap
  341. println
  342. println "   @X0FCleaning up the scanned list - this takes a little time@X07"
  343. println
  344. fopen 1, temppath() + "newfile2.lst", O_RD, S_DN
  345. fcreate 2, temppath() + "newfiles.lst", O_RW, S_DN
  346.  
  347. i=0
  348. 'x=0
  349.  while (!FERR(1)) do
  350.    i=i+1
  351.   ; x=x+1
  352.    fget 1, lines
  353.     lines_two = left(lines,79)
  354.     if (left(lines_two,70) = "             ") goto continue_on
  355.  
  356.     lines = rtrim(lines_two, " ")
  357.     if (left(lines, 6) = "L/Msg.") goto continue_on
  358.     if (left(lines, 9) = "High Msg.") goto continue_on
  359.     if (left(lines, 12) = "Active Msgs:") goto continue_on
  360.     if (left(lines,8) = "Scanning") goto continue_on
  361.     if (right(lines, 6) = "Joined") goto continue_on
  362.     if (right(lines, 8) = "missing!") goto continue_on
  363.     if (right(lines, 5) = "DizIt") goto continue_on
  364.     temp = ltrim(lines," ")
  365.     if (left(temp, 6) = "Making") goto continue_on
  366.           let files(i) = lines
  367.    fputln 2, lines_two
  368.  :continue_on
  369. endwhile
  370. fclose 1
  371. fclose 2
  372. showon
  373. return
  374.  
  375. ;***************************************************************
  376. :zip_it_up
  377. ;***************************************************************
  378. println
  379. println "         @X0EZipping @X0FFile list and moving to upload directory@X07"
  380. println
  381. zip_file = upld_path + "newfilz"+ string(pcbnode())
  382. println zip_file
  383. showoff
  384. shell true, retcode, "PKZIP", " -ex " + zip_file + " " + temppath() + "NEWFILES.LST"
  385. println
  386. showon
  387. answer = "N"
  388. println "  @X0F        Would you like to @X0Aflag @X0Fthe @X0Bfile list @X0Fand @X0Aflag @X0Fthe files @X07"
  389. inputstr "          @X0Ffor @X0Edownload @X0F(up to 40 files) @X0Dautomatically@X07", answer, 0Eh, 1,"YyNn",fieldlen+guide+upcase
  390. newlines 2
  391. if (answer = "Y") goto flag_em
  392. println
  393. println " @X0AYou can either download the list now or it will be @X0Eflagged @X0Afor later download@X07"
  394. println
  395. inputstr " @X07W@X0Fould @X07y@X0Fou @X07l@X0Fike @X07t@X0Fo @X07d@X0Fownload @X07t@X0Fhe @X07l@X0Fist @X07n@X0Fow @X07u@X0Fsing @X07Z@X0Fmodem@X07", answer, 0Eh, 1, "YyNn", FIELDLEN + GUIDE+UPCASE+LFAFTER
  396. if (answer = "Y") goto flag_list
  397.  
  398. temp = "newfilz" + string(pcbnode())
  399. println
  400. println "          @X0CPlease @X0Bdont forget to @X0Fdownload@X0E " + temp + ".zip@X0F before logging off.@X07"
  401. println
  402. join 0
  403. kbdstuff "f;flag " + temp + ".ZIP" + chr(13)
  404. kbdstuff chr(13)
  405. ;kbdstuff chr(13)
  406. goto all_done
  407.  
  408. ;*********************************************************************
  409. :flag_list
  410. ;********************************************************************
  411. ;kbdstuff "d;NEWFILES.ZIP;z"
  412. shell 1, return_value, "dsz sz " + rtrim(readline(pcbdat(), 52), ":") + " " + upld_path + "newfiles.zip", ""
  413. println
  414. goto all_done
  415.  
  416. answer = ""
  417. inputstr " @X0FWould you like to flag the new files for download now@X07", answer, 0Eh, 1,"YyNn", fieldlen + guide + upcase + lfafter
  418. if (answer = "") goto all_done
  419. if (answer = "Y") goto flag_em
  420. if (answer = "N") goto all_done
  421.  
  422. ;********************************************************************
  423. :flag_em
  424. ;********************************************************************
  425. join 0
  426. println
  427. println  "    Currently @X0Bmaking @X0Fa list of files to @X0Cflag! @X0FPlease be patient@X07"
  428. println
  429. z = 1
  430. if (exist(temppath() + "flag.lst")) delete temppath() + "flag.lst"
  431. ;showoff
  432. fopen 1, temppath() + "newfiles.lst", O_RD, S_DN
  433. fopen 2, temppath() + "flag.lst", O_RW, S_DN
  434. i=0
  435. x=0
  436.  while (!FERR(1)) do
  437.    i=i+1
  438.    x=x+1
  439.    z=z+1
  440.    fget 1, lines
  441.     lines_two = left(lines,13)
  442.     if (left(lines,13) = "             ") goto continue_it
  443.     if (left(lines,8) = "Scanning") goto continue_it
  444.        let files(i) = lines_two
  445.    lines_two = upper(lines_two)
  446.    lines_two = strip(lines_two, " ")
  447.    lines_two = rtrim(lines_two, "P")
  448.    lines_two = rtrim(lines_two, "I")
  449.    lines_two = rtrim(lines_two, "Z")
  450.    lines_two = rtrim(lines_two, ".")
  451.    LINES_TWO = (lines_two + " ")
  452.   print "."
  453.    fput 2, lines_two
  454.  :continue_it
  455.  endwhile
  456. showon
  457. x=0
  458. for x = 1 to i
  459.    file_list = file_list + files(x)
  460. next x
  461. ;showon
  462. println
  463. println "   The @X0BFiles @X0Fwill now be @X0Cflagged @X0Ffor @X0Adownload@X07"
  464.  
  465. :make_it
  466. kbdstuff "flag"
  467. kbdfile temppath() + "flag.lst"
  468. goto all_done
  469.  
  470. :all_done
  471. if (exist(temppath() + "newfiles.lst")) delete temppath() + "newfiles.lst"
  472. if (exist(temppath() + "newfile2.lst")) delete temppath() + "newfile2.lst"
  473. if (exist(temppath() + "flag.lst")) delete temppath() + "flag.lst"
  474. fclose 1
  475. fclose 2
  476. end
  477.  
  478. :center
  479.  position = 40 - (x/2)
  480. return
  481.  
  482. :check_date
  483.  reg_date = "03-10-94"
  484. if (date() > reg_date) then
  485.  beep
  486.  beep
  487.  println "@X0F      PPE @X0Btrial period @X0Fhas @X0CEXPIRED@X0F - please tell @X0Esysop @X0Fto register it@X07"
  488.  end
  489.  ;println
  490. endif
  491. println "@X0F    This PPE is @X0EUNREGISTERED @X0F- please @X0Cregister @X0Fby " + string(reg_date) + " or it will @X0Dexpire@X07"
  492. beep
  493. delay 90
  494.  
  495. return
  496.  
  497.  
  498. :version_num
  499. newlines 1
  500. println "                         ░▒▓█ @X0BNEWFILES@X0F.ppe v 2.0 █▓▒░"
  501. println
  502. println "                             ░▒▓█ @X07by DM Soft █▓▒░"
  503. return
  504.  
  505. :register_num
  506. return
  507.