home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 July / DPPCPRO0799.ISO / Ents / Files / startUp.dxr / 00002_masterScript.ls < prev    next >
Encoding:
Text File  |  1999-04-21  |  4.4 KB  |  170 lines

  1. property myMovieName, currentMovieName, currentVideo, currentReturnMovieName, thePlatform, thePath, PD, HDPath
  2. global gSoundObj
  3.  
  4. on new me, whichPlatform, whichPD, whichPath
  5.   set thePlatform to whichPlatform
  6.   set PD to whichPD
  7.   set thePath to whichPath
  8.   set HDPath to getHDPath(me)
  9.   return me
  10. end
  11.  
  12. on getHDPath me
  13.   set the itemDelimiter to PD
  14.   set myHDPath to item 1 of getOSDirectory() & PD
  15.   set the itemDelimiter to ","
  16.   return myHDPath
  17. end
  18.  
  19. on openNetPage me, whichURL
  20.   set myBrowser to browserName()
  21.   if not browserExists(me, myBrowser) then
  22.     set myMessage to "Your default internet browser is not located in the place specified in your system directory, would you like to locate your browser?"
  23.     if userComplies(me, "Find Browser", myMessage) then
  24.       set myFileIO to new(xtra("FileIO"))
  25.       setFilterMask(myFileIO, "Executable (*.exe), *.exe")
  26.       set myBrowser to displayOpen(myFileIO)
  27.       if myBrowser <> EMPTY then
  28.         browserName(myBrowser)
  29.         browserName(#enabled, 1)
  30.         gotoNetPage(whichURL)
  31.       end if
  32.     end if
  33.   else
  34.     browserName(#enabled, 1)
  35.     gotoNetPage(whichURL)
  36.   end if
  37. end
  38.  
  39. on browserExists me, myBrowser
  40.   if thePlatform = #win then
  41.     set total to the length of myBrowser
  42.     if chars(myBrowser, total - 3, total) = ".EXE" then
  43.       return 1
  44.     end if
  45.   else
  46.     if thePlatform = #mac then
  47.       if myBrowser <> EMPTY then
  48.         return 1
  49.       end if
  50.     end if
  51.   end if
  52.   return 0
  53. end
  54.  
  55. on userComplies me, myTitle, myMessage
  56.   set myMuiObj to new(xtra("Mui"))
  57.   set alertInitList to [#buttons: #OkCancel, #title: myTitle, #message: myMessage, #icon: #caution, #movable: 1]
  58.   set buttonResult to alert(myMuiObj, alertInitList)
  59.   if buttonResult = 1 then
  60.     return 1
  61.   else
  62.     return 0
  63.   end if
  64. end
  65.  
  66. on CopyFile me, whichFile, hasVersion
  67.   if hasVersion then
  68.     set whichFile to formatFileName(me, whichFile)
  69.   end if
  70.   set myMessage to "This will copy the file" && QUOTE & whichFile & QUOTE && "to the root of your HardDrive. Click OK to continue..."
  71.   alert(string(myMessage))
  72.   register(xtra("ProgressCopy"), "yswii8fsygx2")
  73.   set myProgress to new(xtra("ProgressCopy"), 1, 0, 0)
  74.   set mySrc to thePath & "Download" & PD & whichFile
  75.   set myDest to HDPath & whichFile
  76.   if CopyFile(myProgress, mySrc, myDest, 0, 1, 1) <> 0 then
  77.     case error(myProgress) of
  78.       3:
  79.         alert(string(QUOTE & whichFile & QUOTE && "has already been copied..."))
  80.       34:
  81.         alert(string(QUOTE & whichFile & QUOTE && "will not be copied..."))
  82.       5:
  83.         alert(string(QUOTE & whichFile & QUOTE && "can't be found..."))
  84.       13, 15:
  85.         alert(string("Not enough free space to copy" && QUOTE & whichFile & QUOTE & "..."))
  86.       otherwise:
  87.         alert(string("Error copying" && QUOTE & whichFile & QUOTE & "..."))
  88.     end case
  89.   end if
  90.   set myProgress to VOID
  91. end
  92.  
  93. on formatFileName me, whichFile
  94.   if thePlatform = #mac then
  95.     set myName to chars(whichFile, 1, the length of whichFile - 4)
  96.     set myExt to chars(whichFile, the length of whichFile - 3, the length of whichFile)
  97.     return myName & "mac" & myExt
  98.   end if
  99.   return whichFile
  100. end
  101.  
  102. on autoUnloadMovie me
  103.   if not voidp(myMovieName) then
  104.     unloadMovie(myMovieName)
  105.   end if
  106.   set myMovieName to the movieName
  107. end
  108.  
  109. on autoLoad me, start, stop
  110.   cursor(4)
  111.   preloadMember(member start, stop)
  112.   cursor(-1)
  113. end
  114.  
  115. on autoPuppet me, start, stop
  116.   cursor(-1)
  117.   repeat with i = start to stop
  118.     puppetSprite(i, 1)
  119.   end repeat
  120. end
  121.  
  122. on autoNotPuppet me, start, stop
  123.   repeat with i = start to stop
  124.     puppetSprite(i, 0)
  125.   end repeat
  126. end
  127.  
  128. on playSound me, whichChannel, whichSound
  129.   puppetSound(whichChannel, 0)
  130.   puppetSound(whichChannel, member whichSound)
  131. end
  132.  
  133. on playVideo me, whichVid, whichReturn
  134.   set currentVideo to whichVid
  135.   if not voidp(whichReturn) then
  136.     set currentReturnMovieName to whichReturn
  137.   else
  138.     set currentReturnMovieName to the movieName
  139.   end if
  140.   autoGoMovie(me, "Movie5", 1, 1)
  141. end
  142.  
  143. on autoGoMovie me, whichMovie, blankMeFirst, fadeSoundOut
  144.   cursor(4)
  145.   set currentMovieName to whichMovie
  146.   if fadeSoundOut then
  147.     playSoundTrack(gSoundObj, 0, 1, 255)
  148.   end if
  149.   if (the colorDepth < 16) and blankMeFirst then
  150.     autoNotPuppet(me, 1, 48)
  151.     go("exitBlank")
  152.   else
  153.     autoNotPuppet(me, 1, 41)
  154.     go(1, whichMovie)
  155.   end if
  156. end
  157.  
  158. on autoCustomwait me, seconds
  159.   set time to seconds * 60
  160.   set timerStart to the timer
  161.   repeat while (the timer - timerStart) < time
  162.     cursor(4)
  163.   end repeat
  164.   cursor(-1)
  165. end
  166.  
  167. on getMovieName me
  168.   return currentMovieName
  169. end
  170.