home *** CD-ROM | disk | FTP | other *** search
/ PC/CD Gamer UK 39 / PCGAMER39.bin / games / amber / amberhub.dxr / 00022.ls < prev    next >
Encoding:
Text File  |  1996-11-08  |  4.0 KB  |  111 lines

  1. on xxtest desiredDisc, whichTunnel
  2.   global gAmberPath, gVoid, gCPU, gProjectorPath
  3.   set discInPlace to 0
  4.   set maxCDtries to 3
  5.   set CDtry to 1
  6.   set gAmberPath to gVoid
  7.   repeat while discInPlace = 0
  8.     put "CDtry = " & CDtry
  9.     if gCPU = #PC then
  10.       openXLib("LABELDRV.DLL")
  11.       set ld to labelDrv(mnew)
  12.       put ld(mSetRange, "A", "Z")
  13.       if CDtry <= maxCDtries then
  14.         set cdLetter to ld(mGetDrive, "AMBER_DISC" & desiredDisc)
  15.         put "cdLetter = "
  16.         put cdLetter
  17.         if charToNum(char 1 of cdLetter) <> 0 then
  18.           set gAmberPath to char 1 to 2 of cdLetter & "\"
  19.           put "gAmberPath = "
  20.           put gAmberPath
  21.           set discInPlace to 1
  22.         else
  23.           if stringp(whichTunnel) then
  24.             go(whichTunnel, gProjectorPath & "LIFEBOAT")
  25.           else
  26.             go(1, gProjectorPath & "LIFEBOAT")
  27.           end if
  28.           put "bad string"
  29.           if CDtry < maxCDtries then
  30.             alert("Please insert the " & QUOTE & "AMBER_DISC" & desiredDisc & QUOTE & " CD into any drive")
  31.           else
  32.             alert("Sorry, the CD doesn't seem to be mounted")
  33.           end if
  34.         end if
  35.       end if
  36.       if CDtry = maxCDtries then
  37.         put "xxTest(): gAmberPath (failed to find cd) =" & gAmberPath
  38.         if voidp(gAmberPath) then
  39.           put "final volumeTest = "
  40.           put cdLetter
  41.           put "OK, now I'd really quit.."
  42.           clearGlobals()
  43.           quit()
  44.         end if
  45.       end if
  46.       put ld(mdispose)
  47.       closeXLib("LABELDRV.DLL")
  48.     else
  49.       if the pathName contains "Jumbo" then
  50.         alert("OK, since I'm on Jumbo we'll play from the hard-disk..")
  51.         set gAmberPath to "Jumbo:Desktop Folder:AMBER project:AMBER Disc " & desiredDisc & ":"
  52.         set gSoundPath2 to gAmberPath & "CD_SOUNDS:"
  53.         exit
  54.       else
  55.         if CDtry <= maxCDtries then
  56.           put "ΓÇóΓÇóΓÇótesting for proper disc.."
  57.           set volumeTest to FileIO(mnew, "read", "AMBER Disc " & desiredDisc & ":Read Me")
  58.           if objectp(volumeTest) then
  59.             volumeTest(mdispose)
  60.             set gAmberPath to "AMBER Disc " & desiredDisc & ":"
  61.             set discInPlace to 1
  62.             put "ΓÇóΓÇóΓÇóthe disc is in place!"
  63.           else
  64.             put "ΓÇóΓÇóΓÇóvolumetest = " & volumeTest
  65.             if stringp(whichTunnel) then
  66.               go(whichTunnel, gProjectorPath & "LIFEBOAT")
  67.             else
  68.               go(2, gProjectorPath & "LIFEBOAT")
  69.             end if
  70.             if integerp(volumeTest) then
  71.               put "[!] fileIO error -> " & FileIO(mError, volumeTest)
  72.               if getPos([-35, -120, -43], volumeTest) <> 0 then
  73.                 if CDtry < maxCDtries then
  74.                   set tempCDobject to AppleCD(mnew)
  75.                   tempCDobject(mEject)
  76.                   put "<i>  Disposing of CD-ejector object: " & tempCDobject(mdispose)
  77.                   alert("Please insert the " & QUOTE & "AMBER Disc " & desiredDisc & QUOTE & " CD into any drive")
  78.                 else
  79.                   alert("Sorry, there is an error in trying to find the CD:" & RETURN & RETURN & "   '" & FileIO(mError, volumeTest) & "'")
  80.                 end if
  81.               else
  82.                 alert("Sorry, there is an error in trying to find the CD:" & RETURN & RETURN & "   '" & FileIO(mError, volumeTest) & "'")
  83.               end if
  84.             else
  85.               alert("Sorry, there is an unknown error in trying to find the CD")
  86.             end if
  87.           end if
  88.         end if
  89.         if CDtry = maxCDtries then
  90.           put "xxTest(): gAmberPath =" & gAmberPath
  91.           if voidp(gAmberPath) then
  92.             put "final volumeTest = "
  93.             put volumeTest
  94.             put "OK, now I'd really quit.."
  95.             clearGlobals()
  96.             quit()
  97.           end if
  98.         end if
  99.       end if
  100.     end if
  101.     set CDtry to CDtry + 1
  102.     updateStage()
  103.   end repeat
  104.   if gCPU = #PC then
  105.     set gSoundPath2 to gAmberPath & "CD_DATA\"
  106.   else
  107.     set gSoundPath2 to gAmberPath & "CD_SOUNDS:"
  108.   end if
  109.   put "<i>  new gSoundPath2 = '" & gSoundPath2 & "'"
  110. end
  111.