home *** CD-ROM | disk | FTP | other *** search
/ The World's Top 500 Windows Games / Top500WindowsGames.iso / jlmwin1 / jlmwin1.sxt < prev    next >
Text File  |  1996-04-10  |  6KB  |  249 lines

  1. // This is the script file for JLM Windows Games
  2.  
  3. start:
  4.     execute "\jlmwin1\runanim.exe"
  5.     set condition 60
  6.     loadsound=FALSE
  7.     
  8.  
  9.     
  10. ////////////////////////////
  11. // install icons
  12. ////////////////////////////
  13.  
  14. install_icons:
  15.     $target = "jlmwin1"
  16.     $title = "JLM Software"
  17.     $progtitle = "JLM Windows Games"
  18.     $destdir = $cd,"\\jlmwin1"
  19.     program manager "[CreateGroup(",$title,")]"
  20.     program manager "[ShowGroup(1)]"
  21.         program manager "[AddItem(",$destdir,"\\",$target,".exe,",$progtitle,",",$destdir,"\\",$target,".exe,0)]"
  22.  
  23. ////////////////////////////
  24. // Drive  selection screen
  25. ////////////////////////////
  26.  
  27. get_drives:
  28.     $cd1=getedit "editcd"
  29.     $hd1=getedit "edithd"
  30.     good=FALSE
  31.     if strlen $hd1==1 
  32.         if strlen $cd1==1
  33.             good=TRUE
  34.     if good==TRUE
  35.         $cd=$cd1,":"
  36.         $hd=$hd1,":"
  37.         set condition 50
  38.         // load sounds
  39.         load $cd,"\\jlmwin1\\cheer.wav" sound cheer
  40.         load $cd,"\\jlmwin1\\sonar1.wav" sound snore
  41.         load $cd,"\\jlmwin1\\dyna10.wav" sound press
  42.         load $cd,"\\jlmwin1\\gmk.wav" sound final
  43.         loadsound=TRUE
  44.         play sound cheer
  45.         display screen "first"
  46.     else
  47.         display screen "baddrives"
  48.  
  49. get_hdrive:
  50.     $hd1=getedit "edithd"
  51.     good=FALSE
  52.     if strlen $hd1==1 
  53.         good=TRUE
  54.     if good==TRUE
  55.         $hd=$hd1,":"
  56.         display screen "Title"
  57.     else
  58.         display screen "badhdrives"
  59.  
  60. ////////////////////////////
  61. // Category selection functions
  62. ////////////////////////////
  63.  
  64. cat_sel :
  65.     // numcats is number of categories
  66.  
  67.     // load in cats from a file
  68.     catlist = new byte[15][50]
  69.     load $cd,"\\jlmwin1\\jlmcats.inf" byte cats
  70.     
  71.     // break cats into an array of strings
  72.     n=0
  73.     test = TRUE
  74.     ind=0
  75.     while test
  76.         ind=parse cats[ind] to $wordread
  77.         $catlist[n] = $wordread
  78.         if ind==ERROR then test=FALSE
  79.         n=n+1
  80.     numcats = n
  81.     
  82.     //display element "catlistbox"
  83.     
  84.     //add each item to the list
  85.     for n=0 to numcats-1
  86.            index = listbox "catlistbox" add $catlist[n]
  87.     // set catchoice to first position
  88.     $catchoice=$catlist[0]
  89.     
  90. browse_games: a,b,pos
  91.     newcat=TRUE
  92.     $catchoice=$catlist[pos]
  93.     remove all
  94.     display screen "browser"    
  95.  
  96. ////////////////////////////
  97. // Game selection functions
  98. ////////////////////////////
  99.  
  100. game_sel :
  101.     
  102.     if newcat==TRUE
  103.         $blurbb=" "
  104.         pos=0
  105.         // load in games from a file
  106.         gamelist = new byte[1000][35]
  107.         
  108.         // use string manipulation to load game title list
  109.         $filename=$cd,"\\jlmwin1\\",$catchoice strcnt 4,".inf"
  110.         load  $filename byte games
  111.         
  112.         // break games into an array of strings
  113.         n=0
  114.         test = TRUE
  115.         ind=0
  116.         while test
  117.             ind=parse games[ind] to $wordread
  118.             $gamelist[n]=$wordread
  119.             if ind==ERROR then test=FALSE
  120.             n=n+1
  121.         numgames = (n-1)/4            
  122.         //add each title to the game list
  123.         n=0
  124.         while n < (numgames*4-1)
  125.                index = listbox "gamelist" add $gamelist[n]
  126.                n=n+4
  127.         newcat=FALSE
  128.     //set catchoice to first position
  129.     $gamechoice=$gamelist[pos]
  130.     $gamedir=$cd,"\\wingame1\\",$catchoice strcnt 4,"\\",$gamelist[1]
  131.             
  132. detect_gsel : dummy,stng,pos
  133.     blurba=new byte[1000]
  134.     $gamechoice=$gamelist[pos*4]
  135.  
  136.     testbrac= strstr $gamelist[pos*4+2];"("
  137.     if testbrac>ERROR
  138.         undisplay element "runbutton"
  139.     else
  140.         display element "runbutton"
  141.     
  142.     // maybe put in updating pictures based on current Category
  143.     $scrshot=$cd,"\\jlmwin1\\",$catchoice strcnt 4,".bmp"
  144.     load $scrshot bitmap scrbmp 
  145.     display bitmap scrbmp at 385,45
  146.  
  147.     // put short description in box
  148.     
  149.     if file_exist $cd,"\\wingame1\\",$catchoice strcnt 4,"\\",$gamelist[pos*4+1],"\\file_id.diz"
  150.         load $cd,"\\wingame1\\",$catchoice strcnt 4,"\\",$gamelist[pos*4+1],"\\file_id.diz" byte blurba
  151.         editbox "blurb" = $blurba
  152.     else
  153.         editbox "blurb" = "No short program description. Try clicking on the View More Information button."    
  154.  
  155.     // put title in title box
  156.     textbox "titletext" = $gamelist[pos*4]
  157.  
  158.     // make variable for game directory
  159.     $gamedir=$cd,"\\wingame1\\",$catchoice strcnt 4,"\\",$gamelist[pos*4+1]
  160.     
  161.  
  162. view_info:
  163.     $readme=$gamedir,"\\",$gamelist[pos*4+3]
  164.     testnone = strstr $readme;"none"
  165.     testwri = strstr $readme;".wri"
  166.     none=FALSE
  167.     wri=FALSE
  168.     if testnone>ERROR then none=TRUE
  169.     if testwri>ERROR then wri=TRUE
  170.     if none==TRUE
  171.         play sound press
  172.         dialog "Ah, well" ok "Sorry, there is no more information to view. There may be online instructions."
  173.     else
  174.         // check filesize
  175.         sizefile=file_length $readme
  176.         if wri==TRUE
  177.             execute  "write ",$readme
  178.         else
  179.             if sizefile<60000
  180.                 execute "notepad ",$readme        
  181.             else
  182.                 execute "write ",$readme
  183.     
  184. print_info:    
  185.     dialog "Please Note" ok "Use the print facility in Notepad or Write (Wordpad) to print out the documentation."
  186.     
  187. back_main:
  188.     undisplay all
  189.     display screen "Title"
  190.  
  191. ///////////////////
  192. // Running game buttons
  193. ///////////////////
  194.     
  195. run_game:
  196.     $runcom=$gamedir,"\\",$gamelist[pos*4+2]
  197.     testbrac= strstr $runcom;"("
  198.     message testbrac
  199.     if testbrac==ERROR
  200.         execute $runcom
  201.     else
  202.         play sound press
  203.         dialog "Whoops!" ok "This game needs to be installed to your hard drive."
  204.  
  205. run_game_hd:
  206.     testbrac=strstr $gamelist[pos*4+2];"("
  207.     if testbrac==0
  208.         // remove ( symbol from string
  209.         $gamename=$gamelist[pos*4+2] stroff 1
  210.     else
  211.         $gamename=$gamelist[pos*4+2]
  212.     $runcom=$hd,"\\jlmcd\\",$gamelist[pos*4+1],"\\",$gamename
  213.     execute $runcom    
  214.  
  215. install_game:
  216.     testbrac=strstr $gamelist[pos*4+2];"("
  217.     if testbrac==0
  218.         // remove ( symbol from string
  219.         $gamename=$gamelist[pos*4+2] stroff 1
  220.     else
  221.         $gamename=$gamelist[pos*4+2]
  222.     $gamedirname=$gamelist[pos*4+1]
  223.     // make directory
  224.     new directory $hd,"\\jlmcd"
  225.     play sound snore
  226.     $exname=$cd,"\\jlmwin1\\file.exe c ",$gamedir," ",$hd,"\\jlmcd\\",$gamedirname," ",$cd1
  227.     execute $exname
  228.     dialog "To Run Game With File Manager or Explorer" ok "Browse to the ","\\jlmcd\\",$gamedirname," and double click on ",$gamename," to run."
  229.     // ask for icons
  230.     insticon=dialog "Install Icons" yesno "Do you want to install an icon for this game in the JLM Software Group?"
  231.     if insticon==TRUE
  232.         $target = $gamelist[pos*4+2]
  233.         $title = "JLM Software"
  234.         $destdir = $hd,"\\jlmcd\\",$gamelist[pos*4+1]
  235.         program manager "[CreateGroup(",$title,")]"
  236.         program manager "[ShowGroup(1)]"
  237.         program manager "[AddItem(",$destdir,"\\",$target,",",$gamelist[pos*4],",",$destdir,"\\",$target,",0)]"
  238.         
  239.         
  240. deinstall_game:
  241.     $gamedirname=$gamelist[pos*4+1]
  242.     execute $cd,"\\jlmwin1\\file.exe d ",$hd,"\\jlmcd\\",$gamedirname," ",$cd1
  243.     
  244. finalsound:
  245.     if loadsound==TRUE
  246.         play sound final
  247.  
  248. //////////////////////////////
  249.