home *** CD-ROM | disk | FTP | other *** search
/ Backpacker 1 (Norsk) / backpacker.iso / pc / data / misc / bpk.dxr / 00188.ls < prev    next >
Encoding:
Text File  |  1995-02-28  |  3.3 KB  |  105 lines

  1. on CompareHighScores TOF
  2.   global TRAVEL, DAYS, AUKT_JOBS, RANS, WANS, CASH, TWNS, KARM, gPref_path
  3.   if the machineType = 256 then
  4.     openXLib(the pathName & "FILEIO.DLL")
  5.   end if
  6.   set fil to FileIO(mnew, "read", gPref_path)
  7.   set W to EMPTY
  8.   repeat with n = 1 to 500
  9.     set W to W & fil(mReadLine)
  10.     if W contains ".high scores" then
  11.       exit repeat
  12.     end if
  13.   end repeat
  14.   set HS to fil(mReadFile)
  15.   set maxAukt to value(line 2 of HS)
  16.   set maxTowns to value(line 4 of HS)
  17.   set maxSolve to value(line 6 of HS)
  18.   set minDays to value(line 8 of HS)
  19.   set maxDays to value(line 10 of HS)
  20.   set maxAssign to value(line 12 of HS)
  21.   fil(mdispose)
  22.   if TOF then
  23.     repeat with n = 1 to 3
  24.       if getAt(maxAukt, n) <> [] then
  25.         if getAt(getAt(maxAukt, n), 1) <= count(AUKT_JOBS) then
  26.           set maxAukt to SortHS(maxAukt, n, count(AUKT_JOBS))
  27.           exit repeat
  28.         end if
  29.         next repeat
  30.       end if
  31.       set maxAukt to SortHS(maxAukt, n, count(AUKT_JOBS))
  32.       exit repeat
  33.     end repeat
  34.     set numOfDiffTowns to countDiffTravels()
  35.     repeat with n = 1 to 3
  36.       if getAt(maxTowns, n) <> [] then
  37.         if getAt(getAt(maxTowns, n), 1) <= numOfDiffTowns then
  38.           set maxTowns to SortHS(maxTowns, n, numOfDiffTowns)
  39.           exit repeat
  40.         end if
  41.         next repeat
  42.       end if
  43.       set maxTowns to SortHS(maxTowns, n, numOfDiffTowns)
  44.       exit repeat
  45.     end repeat
  46.     repeat with n = 1 to 3
  47.       if getAt(maxSolve, n) <> [] then
  48.         if getAt(getAt(maxSolve, n), 1) < KARM then
  49.           set maxSolve to SortHS(maxSolve, n, KARM)
  50.           exit repeat
  51.         end if
  52.         next repeat
  53.       end if
  54.       set maxSolve to SortHS(maxSolve, n, KARM)
  55.       exit repeat
  56.     end repeat
  57.     repeat with n = 1 to 3
  58.       if getAt(minDays, n) <> [] then
  59.         if getAt(getAt(minDays, n), 1) >= DAYS then
  60.           set minDays to SortHS(minDays, n, DAYS)
  61.           exit repeat
  62.         end if
  63.         next repeat
  64.       end if
  65.       set minDays to SortHS(minDays, n, DAYS)
  66.       exit repeat
  67.     end repeat
  68.     repeat with n = 1 to 3
  69.       if getAt(maxDays, n) <> [] then
  70.         if getAt(getAt(maxDays, n), 1) <= DAYS then
  71.           set maxDays to SortHS(maxDays, n, DAYS)
  72.           exit repeat
  73.         end if
  74.         next repeat
  75.       end if
  76.       set maxDays to SortHS(maxDays, n, DAYS)
  77.       exit repeat
  78.     end repeat
  79.     repeat with n = 1 to 3
  80.       if getAt(maxAssign, n) <> [] then
  81.         if getAt(getAt(maxAssign, n), 1) <= (RANS - WANS) then
  82.           set maxAssign to SortHS(maxAssign, n, RANS - WANS)
  83.           exit repeat
  84.         end if
  85.         next repeat
  86.       end if
  87.       set maxAssign to SortHS(maxAssign, n, RANS - WANS)
  88.       exit repeat
  89.     end repeat
  90.     set fil to FileIO(mnew, "write", gPref_path)
  91.     set W to W & ".max aukt" & RETURN & string(maxAukt)
  92.     set W to W & RETURN & ".max towns" & RETURN & string(maxTowns)
  93.     set W to W & RETURN & ".max solve" & RETURN & string(maxSolve)
  94.     set W to W & RETURN & ".min days" & RETURN & string(minDays)
  95.     set W to W & RETURN & ".max days" & RETURN & string(maxDays)
  96.     set W to W & RETURN & ".max assign" & RETURN & string(maxAssign)
  97.     set err to fil(mWriteString, W)
  98.     fil(mdispose)
  99.   end if
  100.   if the machineType = 256 then
  101.     closeXLib(the pathName & "FILEIO.DLL")
  102.   end if
  103.   PrintHighScores(maxAukt, maxTowns, maxSolve, minDays, maxDays, maxAssign)
  104. end
  105.