home *** CD-ROM | disk | FTP | other *** search
/ Experience Hawaii / HAWAII.ISO / pc / hawaii.dir / 00018_read prefs.ls < prev    next >
Encoding:
Text File  |  1996-04-12  |  10.9 KB  |  403 lines

  1. on handleOnline
  2.   set the cursor of sprite 16 to [14075, 14076]
  3.   set the cursor of sprite 6 to [14075, 14076]
  4.   set the cursor of sprite 2 to [14075, 14076]
  5.   set the cursor of sprite 1 to -1
  6.   if rollOver(2) then
  7.     repeat while rollOver(2) = 1
  8.       set the castNum of sprite 2 to 14248
  9.       updateStage()
  10.       if the mouseDown = 1 then
  11.         repeat while the mouseDown = 1
  12.           set the castNum of sprite 2 to 14249
  13.           updateStage()
  14.         end repeat
  15.         updateStage()
  16.         resetSprites()
  17.         cursor(4)
  18.         installMenu(0)
  19.         go("ITVC")
  20.         initFirstFrame()
  21.         cursor(0)
  22.         abort()
  23.       end if
  24.     end repeat
  25.     set the castNum of sprite 2 to 14247
  26.     updateStage()
  27.   end if
  28.   if rollOver(16) then
  29.     repeat while rollOver(16) = 1
  30.       set the castNum of sprite 16 to 388
  31.       updateStage()
  32.       if the mouseDown = 1 then
  33.         repeat while the mouseDown = 1
  34.           set the castNum of sprite 16 to 389
  35.           updateStage()
  36.         end repeat
  37.         updateStage()
  38.         quit()
  39.       end if
  40.     end repeat
  41.     set the castNum of sprite 16 to 387
  42.     updateStage()
  43.   end if
  44.   if rollOver(6) then
  45.     if the mouseDown = 1 then
  46.       set the castNum of sprite 6 to 276
  47.       updateStage()
  48.       cursor(0)
  49.       handleServices()
  50.     else
  51.       set the castNum of sprite 6 to 277
  52.       updateStage()
  53.     end if
  54.   end if
  55.   go(the frame)
  56. end
  57.  
  58. on initOnline
  59.   repeat with x = 9 to 12
  60.     puppetSprite(x, 1)
  61.     set the visible of sprite x to 0
  62.   end repeat
  63. end
  64.  
  65. on LocateExistingService
  66.   global gOnlinePath, gOnlineChoice
  67.   if the optionDown then
  68.     alert("You have just erased your current online choices!")
  69.     go(1, "Online.dir")
  70.     set gOnlineChoice to "none"
  71.     set gOnlinePath to "none"
  72.   else
  73.     if gOnlineChoice = "AOL" then
  74.       go("OLAOL")
  75.       exit
  76.     end if
  77.     if gOnlineChoice = "TotalAccess" then
  78.       go("OLTA")
  79.       exit
  80.     end if
  81.     if gOnlineChoice = "none" then
  82.       resetSprites()
  83.       put "Go to movie Online.dir"
  84.       go(1, "Online.dir")
  85.       exit
  86.     else
  87.       alert("I don't recognize your service provider:  It is currently set to:" & gOnlineChoice)
  88.       set gOnlineChoice to "none"
  89.       go(1, "Online.dir")
  90.     end if
  91.   end if
  92. end
  93.  
  94. on ConnectFound
  95.   global gHomeDir, gIniName, gWinVersion, gConnectFile
  96.   openXLib("DLLGlue")
  97.   set objFindFile to DLLGlue(mnew, "FindFile.DLL", "UpdateOnlinePath", "I", "SSSS")
  98.   if voidp(objFindFile) = 1 then
  99.     alert("DLLGlue failed; may not be able to find FindFile.DLL" & RETURN & "Current path is " & the pathName)
  100.   else
  101.     if gWinVersion < 3.94999999999999973 then
  102.       set gConnectFile to "connect.exe"
  103.       set targetDir to "DIALER\APP\"
  104.     else
  105.       set gConnectFile to "Netscape.exe"
  106.       set targetDir to "PROGRAM\"
  107.     end if
  108.     set found to objFindFile(mCall, gHomeDir, gIniName, targetDir, gConnectFile)
  109.     if objFindFile(mStatus) <> 0 then
  110.       alert("ConnectFound failed using objFindFile")
  111.       quit()
  112.     else
  113.       if found then
  114.         readPrefsFile()
  115.         return 1
  116.       else
  117.         return 0
  118.       end if
  119.     end if
  120.   end if
  121.   objFindFile(mdispose)
  122.   closeXLib("DLLGlue")
  123. end
  124.  
  125. on RegisterFound
  126.   global gHomeDir, gIniName, gWinVersion, gRegisterFile
  127.   openXLib("DLLGlue")
  128.   set objFindFile to DLLGlue(mnew, "FindFile.DLL", "UpdateOnlinePath", "I", "SSSS")
  129.   if voidp(objFindFile) = 1 then
  130.     alert("DLLGlue failed; may not be able to find FindFile.DLL" & RETURN & "Current path is " & the pathName)
  131.   else
  132.     if gWinVersion < 3.94999999999999973 then
  133.       set gRegisterFile to "register.exe"
  134.       set targetDir to "REGISTER\"
  135.     else
  136.       set gRegisterFile to "access.exe"
  137.       set targetDir to "ACCESS\"
  138.     end if
  139.     set found to objFindFile(mCall, gHomeDir, gIniName, targetDir, gRegisterFile)
  140.     if objFindFile(mStatus) <> 0 then
  141.       alert("RegisterFound failed using objFindFile")
  142.       quit()
  143.     else
  144.       if found then
  145.         readPrefsFile()
  146.         return 1
  147.       else
  148.         return 0
  149.       end if
  150.     end if
  151.   end if
  152.   objFindFile(mdispose)
  153.   closeXLib("DLLGlue")
  154. end
  155.  
  156. on CheckWhichPath
  157.   global gOnlinePath, gWinVersion, gConnectFile
  158.   if gOnlinePath contains "Dialer\App" then
  159.     open(gOnlinePath & "connect.exe")
  160.   else
  161.     if gOnlinePath contains "Program\" then
  162.       installMenu(cast "Menubar")
  163.     else
  164.       if ConnectFound() then
  165.         if gWinVersion < 3.94999999999999973 then
  166.           installMenu(cast "Menubar")
  167.           open(gOnlinePath & gConnectFile)
  168.         else
  169.           installMenu(cast "Menubar")
  170.         end if
  171.       else
  172.         if gWinVersion < 3.94999999999999973 then
  173.           open(gOnlinePath & "register.exe")
  174.         else
  175.           open(gOnlinePath & "access.exe")
  176.         end if
  177.       end if
  178.     end if
  179.   end if
  180. end
  181.  
  182. on FindConnect
  183.   global gOnlinePath, gROMDrive, gWinVersion, gRegisterFile, gConnectFile
  184.   if ConnectFound() then
  185.     if gWinVersion < 3.94999999999999973 then
  186.       installMenu(cast "Menubar")
  187.       open(gOnlinePath & gConnectFile)
  188.     else
  189.       installMenu(cast "Menubar")
  190.     end if
  191.   else
  192.     if RegisterFound() then
  193.       open(gOnlinePath & gRegisterFile)
  194.     else
  195.       if gWinVersion < 3.94999999999999973 then
  196.         open(gROMDrive & ":\EarthLnk\Win31\Setup.exe")
  197.       else
  198.         open(gROMDrive & ":\EarthLnk\Win95\Setup.exe")
  199.       end if
  200.     end if
  201.   end if
  202. end
  203.  
  204. on LocateTotalAccessPC
  205.   global gOnlineChoice, gOnlinePath, gHomeDir, gIniName, gWinVersion
  206.   if gWinVersion < 3.94999999999999973 then
  207.     go("WIN31MSG")
  208.   else
  209.     go("WIN95MSG")
  210.   end if
  211.   set gOnlineChoice to "TotalAccess"
  212.   writePrefsFile()
  213.   set gIniName to "hawaii.ini"
  214.   if gOnlinePath = "none" then
  215.     FindConnect()
  216.   else
  217.     CheckWhichPath()
  218.   end if
  219. end
  220.  
  221. on locateTotalAccess
  222.   global gOnlinePath, gPrefsPath, gOnlineChoice
  223.   set ffResult to FindFolder()
  224.   if ffResult <> EMPTY then
  225.     set gOnlinePath to ffResult
  226.     set gOnlineChoice to "TotalAccess"
  227.     writePrefsFile()
  228.     open(gOnlinePath)
  229.   else
  230.     set gOnlinePath to "none"
  231.     beep()
  232.     alert("Internet Dialer was not located on your hard drive!  Please install TotalAccess again! Note: Internet Dialer will not appear in the TotalAccess folder until you complete the registration process!")
  233.     writePrefsFile()
  234.   end if
  235. end
  236.  
  237. on cleanexitOnline
  238.   writePrefsFile()
  239. end
  240.  
  241. on handleServices
  242.   global gOnlinePath, gOnlineChoice, gROMDrive, gWinVersion
  243.   updateStage()
  244.   if the machineType <> 256 then
  245.     if gOnlineChoice = "TotalAccess" then
  246.       if gOnlinePath <> "none" then
  247.         put "gonlinePath=", gOnlinePath
  248.         cleanexitOnline()
  249.         go("MACMSG")
  250.         open(gOnlinePath)
  251.       else
  252.         go("MACMSG")
  253.         locateTotalAccess()
  254.       end if
  255.     else
  256.       if gOnlineChoice = "AOL" then
  257.         cleanexitOnline()
  258.         unLoadCast()
  259.         installMenu(cast "menubar")
  260.         CallAOLGoto()
  261.       end if
  262.     end if
  263.   else
  264.     if gOnlineChoice = "TotalAccess" then
  265.       saveNotebookFile()
  266.       LocateTotalAccessPC()
  267.     else
  268.       if gOnlineChoice = "AOL" then
  269.         cleanexitOnline()
  270.         unLoadCast()
  271.         set installPath to gROMDrive & ":\AOL\25instal.exe"
  272.         openXLib("DLLGlue")
  273.         set fAOLGoTo to DLLGlue(mnew, "Launch16.DLL", "AOLGoTo", "I", "WSSSSS")
  274.         if voidp(fAOLGoTo) = 1 then
  275.           alert("DLLGlue failed; may not be able to find Launch16.DLL" & RETURN & "Current path is " & the pathName)
  276.         else
  277.           put fAOLGoTo(mCall, 0, 0, 0, installPath, "iTravel", 0)
  278.         end if
  279.         fAOLGoTo(mdispose)
  280.         closeXLib("DLLGlue")
  281.       else
  282.         cleanexitOnline()
  283.       end if
  284.     end if
  285.   end if
  286. end
  287.  
  288. on readPrefsFile
  289.   global gPrefsPath, gPrefsName, gHomeDir, gWinVersion, gWelcomeState, gAudioState, gFanState, gOnlinePath, gOnlineChoice, gROMDrive
  290.   if the machineType <> 256 then
  291.     set gPrefsName to gHomeDir & "Hawaii Prefs"
  292.   else
  293.     set gPrefsName to gHomeDir & "hawaii.ini"
  294.   end if
  295.   set gReadObject to FileIO(mnew, "read", gPrefsName)
  296.   if not objectp(gReadObject) then
  297.     if the machineType = 256 then
  298.       alert("Cannot find HAWAII.INI." & RETURN & "Please run SETUP.EXE from the CD-ROM.")
  299.       quit()
  300.     else
  301.       writeDefaultPrefsfile()
  302.       exit
  303.     end if
  304.   else
  305.     set gPrefsPath to gReadObject(mReadFile)
  306.     gReadObject(mdispose)
  307.     set str to line 1 of gPrefsPath
  308.     set gHomeDir to EMPTY
  309.     repeat with C = 1 to the number of chars in str
  310.       if char C of str = "=" then
  311.         repeat with n = C + 1 to length(str)
  312.           put char n of str after gHomeDir
  313.         end repeat
  314.         exit repeat
  315.       end if
  316.     end repeat
  317.     put "Home Directory=" & gHomeDir
  318.     set str to line 2 of gPrefsPath
  319.     repeat with C = 1 to the number of chars in str
  320.       if char C of str = "=" then
  321.         set gROMDrive to char C + 1 of str
  322.         exit repeat
  323.       end if
  324.     end repeat
  325.     put "CDROM Drive=" & gROMDrive
  326.     set str to line 3 of gPrefsPath
  327.     set gOnlineChoice to EMPTY
  328.     repeat with C = 1 to length(str)
  329.       if char C of str = "=" then
  330.         repeat with n = C + 1 to length(str)
  331.           put char n of str after gOnlineChoice
  332.         end repeat
  333.         exit repeat
  334.       end if
  335.     end repeat
  336.     put "Online Choice=" & gOnlineChoice
  337.     set str to line 4 of gPrefsPath
  338.     set WinV to EMPTY
  339.     repeat with C = 1 to length(str)
  340.       if char C of str = "=" then
  341.         repeat with n = C + 1 to length(str)
  342.           put char n of str after WinV
  343.         end repeat
  344.         exit repeat
  345.       end if
  346.     end repeat
  347.     set gWinVersion to float(WinV)
  348.     put "Windows Version=" & gWinVersion
  349.     set str to line 5 of gPrefsPath
  350.     set gWelcomeState to 0
  351.     repeat with C = 1 to length(str)
  352.       if char C of str = "=" then
  353.         set gWelcomeState to integer(char C + 1 of str)
  354.         exit repeat
  355.       end if
  356.     end repeat
  357.     put "WelcomeState=" & gWelcomeState
  358.     set str to line 6 of gPrefsPath
  359.     set gAudioState to 0
  360.     repeat with C = 1 to length(str)
  361.       if char C of str = "=" then
  362.         set gAudioState to integer(char C + 1 of str)
  363.         exit repeat
  364.       end if
  365.     end repeat
  366.     put "AudioState=" & gAudioState
  367.     set str to line 7 of gPrefsPath
  368.     set gFanState to 1
  369.     repeat with C = 1 to length(str)
  370.       if char C of str = "=" then
  371.         set gFanState to integer(char C + 1 of str)
  372.         exit repeat
  373.       end if
  374.     end repeat
  375.     put "FanState=" & gFanState
  376.     set str to line 8 of gPrefsPath
  377.     set gOnlinePath to EMPTY
  378.     repeat with C = 1 to length(str)
  379.       if char C of str = "=" then
  380.         repeat with n = C + 1 to length(str)
  381.           put char n of str after gOnlinePath
  382.         end repeat
  383.         exit repeat
  384.       end if
  385.     end repeat
  386.     put "Online path=" & gOnlinePath
  387.   end if
  388. end
  389.  
  390. on ListPrefs
  391.   global gHomeDir, gWinVersion, gWelcomeState, gAudioState, gFanState, gOnlinePath, gOnlineChoice, gROMDrive, gPrefsPath
  392.   put "gPrefspath=" && gPrefsPath
  393.   put "ListPrefs dump follows:"
  394.   put "Home Directory=" & gHomeDir
  395.   put "CDROM Drive=" & gROMDrive
  396.   put "Online Choice=" & gOnlineChoice
  397.   put "Windows Version=" & gWinVersion
  398.   put "WelcomeState=" & gWelcomeState
  399.   put "AudioState=" & gAudioState
  400.   put "FanState=" & gFanState
  401.   put "Online path=" & gOnlinePath
  402. end
  403.