home *** CD-ROM | disk | FTP | other *** search
/ MGA Millennium Bulk / BLK_5_FEB_96.iso / mga-demo / mgademo.mst < prev    next >
Text File  |  1995-06-22  |  12KB  |  401 lines

  1. '  **** MGA-DEMO Millennium demo MS-Test script - Kim Pallister ****  '
  2.  
  3. ' ***      The following conditions are assumed:
  4. ' ***          Software:    1.02.22 MGA drivers running on 2mb Millenium
  5. ' ***          Driver setup:640x480x16 3D, DCI enabled
  6. ' ***                       Modeswitch, Follow display : Off
  7. ' ***                       Panlock, Maxview, CenterWin, CenterPopup : Off
  8.  
  9. '$include 'fasttest.inc'   ' *** include fasttest commands
  10. '$include 'mstest.inc'     ' *** include mstest commands
  11.  
  12. xlogon                     ' *** turn logging on ***
  13. xminwindow                 '*** to minimize MSTEST and place focus on Prog.mgr
  14. ' now ready to begin
  15.  
  16. ' declare global vars
  17. GLOBAL success AS INTEGER       'used as error flag
  18. GLOBAL abortcode AS INTEGER     'used to identify error
  19. GLOBAL abortstring AS STRING    'used to identify error
  20. GLOBAL VIDDIR AS STRING         'stores directory containing video files
  21. GLOBAL AVIFILE AS STRING        'stores name of AVI file used
  22. GLOBAL THREEDDIR AS STRING      'stores directory containing 3D viewer
  23. GLOBAL WINTACHDIR AS STRING     'stores directory containing Wintach
  24. GLOBAL PPTDIR AS STRING         'stores directory containing PowerPoint Viewer
  25. GLOBAL MGADIR AS STRING         'stores directory containing MGA drivers
  26. GLOBAL WINDIR AS STRING         'stores directory containing Windows
  27. GLOBAL tempfilestr AS STRING    'temp var file dir and file names
  28. GLOBAL inifilenum AS INTEGER    'stores fiel number
  29.  
  30. GLOBAL msgstr AS INTEGER ' just for testing
  31. GLOBAL loopcount AS INTEGER ' just for testing
  32.  
  33. ' *** begin ***
  34. main:
  35.  
  36.     gosub checkinifile      'check if ini file present, if not abort
  37.     if (success=1) then
  38.         abortcode=1
  39.         goto abortroutine
  40.     end if
  41.  
  42.     gosub readinifile       'read ini file, if any error, abort
  43.     if (success=1) then
  44.         abortcode=2
  45.         goto abortroutine
  46.     end if
  47.  
  48.     gosub checkifmodevalid  'check if in valid mode, if not abort
  49.     if (success=1) then
  50.         abortcode=3
  51.         goto abortroutine
  52.     else   'remove later
  53.         pause "current mode is valid, press ok to continue"
  54.     end if
  55.  
  56.     gosub openapps          'open apps, if not successful, abort
  57.     if (success=1) then
  58.         abortcode=4
  59.         goto abortroutine
  60.     end if
  61.  
  62.     pause "Setup successful, Press Enter or Click OK to start demo."
  63.  
  64.     ' Prime the Loop  by putting up first slide
  65.     hwnd = WFndWndC("Microsoft PowerPoint Viewer", NULL, FW_DEFAULT)
  66.     WSetActWnd hwnd
  67.     wreswnd hwnd
  68.     WButtonClick "Show"   'show slide
  69.     sleep 3               'wait
  70.     xkey "escape"         'back out
  71.  
  72.  
  73.     ' the following is the body of the looped demo
  74.     while ((success=0) AND (loopcount < 5)) 'remove latter part later
  75.  
  76.         loopcount = loopcount +1 ' temporary
  77.  
  78.         gosub videortn  'play AVI file
  79.         'sleep 1         'pause 1 second, try romving later
  80.  
  81.         hwnd = WFndWndC("Microsoft PowerPoint Viewer", NULL, FW_DEFAULT)
  82.         WSetActWnd hwnd
  83.         xalt "n"              'switch to name box
  84.         xtext "mgademo2.ppt"  'switch to next slide
  85.         WButtonClick "Show"   'show slide
  86.         sleep 3               'wait
  87.         xkey "escape"         'back out
  88.  
  89.         gosub threedrtn  'play 3D segment
  90.  
  91.         hwnd = WFndWndC("Microsoft PowerPoint Viewer", NULL, FW_DEFAULT)
  92.         WSetActWnd hwnd
  93.         xalt "n"              'switch to name box
  94.         xtext "mgademo3.ppt"  'switch to next slide
  95.         WButtonClick "Show"   'show slide
  96.         sleep 3               'wait
  97.         xkey "escape"         'back out
  98.  
  99.         gosub wintachrtn  'do Wintach segment
  100.  
  101.         hwnd = WFndWndC("Microsoft PowerPoint Viewer", NULL, FW_DEFAULT)
  102.         WSetActWnd hwnd
  103.         xalt "n"              'switch to name box
  104.         xtext "mgademo1.ppt"  'switch to next slide
  105.         WButtonClick "Show"   'show slide
  106.         sleep 3               'wait
  107.         xkey "escape"         'back out
  108.  
  109.         gosub checkexitkey 'check if exit keystroke pressed
  110.  
  111.         ' display status box  (temporary)
  112.         message$ = "Loopcount ="
  113.         message$ = message$ + str$(loopcount)
  114.         font$ = "MS sans serif"
  115.         STATUSBOX message$, 0, 0, 0, 0, 1, 1, font$, 24, 500
  116.         sleep 1
  117.         STATUSBOX CLOSE
  118.         'pause "press enter"
  119.     wend 'of while loop
  120. end ' of script
  121.  
  122. ' the following is a subroutine to check if INI file exists
  123. checkinifile:
  124. 'check for ini file here
  125. success=0
  126. return
  127.  
  128. ' the following reads the directory names into their vars
  129. readinifile:
  130.     success=1
  131.     if exists("mgademo.ini") then
  132.         'pause "INI file found "
  133.         inifilenum = freefile
  134.         open "mgademo.ini" for input as inifilenum
  135.         'pause "ini file opened"
  136.         while (not (eof(inifilenum)))
  137.            line input #inifilenum, tempfilestr
  138.            'pause tempfilestr
  139.            gosub comparestrings
  140.         wend
  141.         close #inifilenum 'clos ini file
  142.     else
  143.         success=1 'file not found
  144.     endif
  145.     success = 0
  146. return
  147.  
  148. comparestrings:
  149.     'pause ("*"+ (left$(tempfilestr,6)) + "*")
  150.     if (left$(tempfilestr,6) = "WINDIR") then
  151.         WINDIR=right$(tempfilestr,( len(tempfilestr)-(6+1) ))
  152.         'pause ("WINDIR = "+WINDIR)
  153.     'end if
  154.     elseif (left$(tempfilestr,6) = "MGADIR") then
  155.         MGADIR=right$(tempfilestr,( len(tempfilestr)-(6+1) ))
  156.         'pause ("MGADIR = " + MGADIR)
  157.     'end if
  158.     elseif (left$(tempfilestr,6) = "VIDDIR") then
  159.         VIDDIR=right$(tempfilestr,( len(tempfilestr)-(6+1) ))
  160.         'pause ("VIDDIR = "+VIDDIR)
  161.     'end if
  162.     elseif (left$(tempfilestr,9) = "THREEDDIR") then
  163.         THREEDDIR=right$(tempfilestr,( len(tempfilestr)-(9+1) ))
  164.         'pause ("THREEDDIR = "+THREEDDIR)
  165.     'end if
  166.     elseif (left$(tempfilestr,10) = "WINTACHDIR") then
  167.         WINTACHDIR=right$(tempfilestr,( len(tempfilestr)-(10+1) ))
  168.         'pause ("WINTACHDIR = "+WINTACHDIR)
  169.     'end if
  170.     elseif (left$(tempfilestr,6) = "PPTDIR") then
  171.         PPTDIR=right$(tempfilestr,( len(tempfilestr)-(6+1) ))
  172.         'pause ("PPTDIR = "+PPTDIR)
  173.     'end if
  174.     elseif (left$(tempfilestr,7) = "AVIFILE") then
  175.         AVIFILE=right$(tempfilestr,( len(tempfilestr)-(7+1) ))
  176.         'pause ("AVIFILE = "+AVIFILE)
  177.     else
  178.         success=1
  179.         'unknown line
  180.     end if
  181. 'WINDIR="C:\windows\"
  182. 'MGADIR="\mga\cpanel\" ' temporary
  183. 'VIDDIR="\mga-demo\video\"
  184. ''THREEDDIR="\mga-demo\3ddemo\"
  185. 'THREEDDIR="\mga-demo\3d-demo\"
  186. 'WINTACHDIR="\mga-demo\wintach\"
  187. 'PPTDIR="\mga-demo\pptview\"
  188. 'AVIFILE="MGA-15.AVI"
  189. success=0
  190. return
  191.  
  192. ' the following is a subroutine to check if the mode used is 640x480x16bit
  193. checkifmodevalid:
  194.     success=1 'start by setting flag to error
  195.  
  196.     'check if control center running
  197.     hwnd = WFndWndC("MGACTRL.EXE", NULL, FW_PART)
  198.     If WIsMinimized (hwnd) Then 'only continue if found
  199.         'Pause "MGA ctrl found, minimized"
  200.         sleep 1
  201.         filestr$ = MGADIR + "MGAPANEL.EXE"
  202.         'pause filestr$
  203.         xstartapp filestr$,""
  204.         sleep 1
  205.         hwnd = WFndWndC("MGA MILLENIUM CONTROL PANEL", NULL, FW_PART)
  206.         WSetActWnd hwnd
  207.         wreswnd hwnd ' bring up ctrl panel
  208.         sleep 1
  209.         'pause "everything ok so far"
  210.  
  211.         if WOptionExists ("mode 1:") then
  212.             WOptionClick ("mode 1:")
  213.             xkey "tab"
  214.             xkey "enter"
  215.             WOptionClick ("640x480")
  216.             WOptionClick ("16-bit 65K colors")
  217.             WOptionClick ("3D Acceleration")
  218.             WButtonClick ("OK")  ' confirm setup
  219.             WButtonClick ("OK")  ' confirm to exit control panel
  220.             sleep 1
  221.             if WButtonExists ("Restart Windows", 1) then
  222.                 abortcode=2
  223.                 goto abortroutine
  224.             else
  225.                 'pause "Mode seems OK" 'ctrl panel didnt ask to restart
  226.                 success=0 'set flag to ok
  227.             end if
  228.         else
  229.             'pause "couldn't find mode 1" 'ctrl panel didnt run
  230.         end if
  231.     else
  232.         'pause "mga panel not run"
  233.     end if
  234. return  ' end of check-current-mode subroutine
  235.  
  236. ' the following opens and minimizes the apps
  237. openapps:
  238.     'pause "entering openapps"
  239.     success=1
  240.  
  241.     'open Powerpoint viewer
  242.     filestr$=PPTDIR + "pptview.exe"
  243.     xstartapp filestr$, ""
  244.     textstr$=PPTDIR + "MGADEMO1.PPT"
  245.     xtext textstr$
  246.     xminwindow
  247.     sleep 1
  248.  
  249.     'open MediaPlayer with AVI
  250.     filestr$ = windir + "mplayer.exe" + " " + VIDDIR + AVIFILE
  251.     xstartapp filestr$, ""
  252.     sleep 2
  253.     xctrl "w" ' combine windows
  254.     xminwindow
  255.     sleep 1
  256.  
  257.     'open 3D demo
  258.     filestr$ = threeddir + "dyna3dw.exe" + " " + threeddir + "matrox.bin"
  259.     xstartapp filestr$, ""
  260.     sleep 1
  261.     xminwindow
  262.  
  263.     'open Wintach
  264.     filestr$=WINTACHDIR + "wintach.exe"
  265.     xstartapp filestr$, ""
  266.     xminwindow
  267.     sleep 1
  268.  
  269.     success=0
  270. return
  271.  
  272. ' video segment of loop
  273. videortn:
  274.     success = 1
  275.     hwnd = WFndWndC(AVIFILE, NULL, FW_PART)
  276.     WSetActWnd hwnd
  277.     wreswnd hwnd
  278.     'sleep 1
  279.     xctrl "2"                     ' zoom by two
  280.     xctrl "F5"                    ' send MCI command string
  281.     xtext "set time format frames"
  282.     xkey "enter"
  283.     'WButtonClick "send"
  284.     if (AVIFILE = "MGA-30.AVI") then
  285.         xtext "play from 0 to 1800"    ' string
  286.     else
  287.         xtext "play from 0 to 899"
  288.     endif
  289.     'WbuttonClick "send"
  290.     xkey "enter"                  ' execute
  291.     'xkey "enter"                  ' execute
  292.     WButtonClick "Close"          ' close dialogue box
  293.     sleep 60
  294.     xctrl "F5"                    ' send MCI command string
  295.     xtext "stop"                  ' stop
  296.     xkey "enter"                  ' execute
  297.     WButtonClick "Close"          ' close dialogue box
  298.     xminwindow
  299.     'sleep 1
  300.     success = 0
  301. return
  302. 'end video segment
  303.  
  304. threedrtn:
  305.     success=1
  306.     hwnd = WFndWndC("3D Window", NULL, FW_PART)
  307.     WMaxWnd hwnd
  308.     sleep 1
  309.  
  310.     WOptionClick "Zoom/Twist"
  311.     QueMouseClick VK_LBUTTON, 321, 414    ' click to enable rotation
  312.     QueFlush FALSE
  313.     for x=1 to 15                         ' and zoom up
  314.        xkey "up"
  315.     next x
  316.     for x=1 to 90                         ' twist
  317.        xkey "left"
  318.     next x
  319.     for x=1 to 5                         ' zoom up
  320.        xkey "up"
  321.     next x
  322.     QueMouseClick VK_LBUTTON, 321, 414
  323.     QueFlush FALSE
  324.  
  325.     WOptionClick "Rotation"
  326.     QueMouseClick VK_LBUTTON, 321, 414
  327.     QueFlush FALSE
  328.     for x=1 to 200
  329.        xkey "left"
  330.     next x
  331.     QueMouseClick VK_LBUTTON, 321, 414
  332.     QueFlush FALSE
  333.     wbuttonclick "cancel"
  334.     xminwindow
  335.  
  336.     success=0
  337. return
  338.  
  339. wintachrtn:
  340.     success = 1
  341.     hwnd = WFndWndC("WinTach", NULL, FW_PART)
  342.     WSetActWnd hwnd
  343.     wreswnd hwnd
  344.     sleep 1
  345.     xalt "s"    'bring up START BENCHMARK menu
  346.     xkey "w"    ' do word proc. segment
  347.     if (wbuttonexists ("ok")) then
  348.         wbuttonclick "ok"
  349.         xalt"s"
  350.         xkey"w"
  351.     end if
  352.     'sleep 1
  353.     xkey "enter"
  354.     xalt "s"    'bring up START BENCHMARK menu
  355.     xkey "c"    ' do CAD segment
  356.     'sleep 1
  357.     xkey "enter"
  358.     xalt "s"    'bring up START BENCHMARK menu
  359.     xkey "s"    ' do spreadsheet segment
  360.     'sleep 1
  361.     xkey "enter"
  362.     xalt "s"    'bring up START BENCHMARK menu
  363.     xkey "p"    ' do paint segment
  364.     'sleep 1
  365.     xkey "enter"
  366.     xminwindow
  367.     success = 0
  368. return
  369.  
  370. checkexitkey:
  371. return
  372.  
  373. abortroutine:
  374.     if (abortcode=1) then
  375.         abortstring="INI file not found, demo will exit."
  376.     elseif (abortcode=2) then
  377.         abortstring="A problem occurred reading INI file, demo will exit."
  378.     elseif (abortcode=3) then
  379.         abortstring="You must restart windows, and re-start the demo."
  380.     elseif (abortcode=4) then
  381.         abortstring="An error occured trying to open the applications."
  382.     elseif (abortcode=5) then
  383.         abortstring=" "
  384.     else
  385.         abortstring="an unknown error occured"
  386.     end if
  387.  
  388.  
  389. ' put up appropriate abort message
  390. pause abortstring
  391. STOP
  392.  
  393.  
  394. ' *** display status box ***
  395. 'message$ = "Initializing Windows World 95 Presentation Script"
  396. 'font$ = "MS sans serif"
  397. 'STATUSBOX message$, 0, 0, 0, 0, 1, 1, font$, 24, 500
  398. 'sleep 1
  399.  
  400.  
  401.