home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / misc / chemistr / acidsand.sit / Acid1 / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1992-08-17  |  8.0 KB  |  26 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>70</cardCount>
  7.     <cardID>3774</cardID>
  8.     <listID>4997</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>on idle
  17. global MOUSE_TRACKER, IDLE_TIMER, MAX_IDLE_TIME, DIVIDING_LINE
  18.  
  19. get the mouseloc
  20. if the optionkey is down then
  21. visual effect dissolve to black
  22. visual effect dissolve
  23. go to card "main menu"
  24. exit to hypercard
  25. end if
  26. if MOUSE_TRACKER = the mouseloc then
  27. get the seconds
  28. subtract IDLE_TIMER from it
  29. if it > MAX_IDLE_TIME then
  30. promptoid "Please move the mouse"
  31. put the ticks into START_TIME
  32. repeat while the ticks - START_TIME < 300
  33. if the mouseloc <> MOUSE_TRACKER then
  34. put the seconds into IDLE_TIMER
  35. put the mouseloc into MOUSE_TRACKER
  36. close window "promptoid"
  37. exit idle
  38. end if
  39. end repeat
  40. close window "promptoid"
  41. put the seconds into IDLE_TIMER
  42. put the mouseloc into MOUSE_TRACKER
  43. visual effect dissolve to black
  44. visual effect dissolve
  45. go to card "main menu"
  46. exit to hypercard
  47. end if
  48. else
  49. put the seconds into IDLE_TIMER
  50. put the mouseloc into MOUSE_TRACKER
  51. end if
  52.  
  53. end idle
  54.  
  55. on ClickWait
  56. global MAX_IDLE_TIME
  57.  
  58. put empty into TOTAL_WAIT_TIME
  59. put MAX_IDLE_TIME * 60 into MAX_WAIT_TIME
  60. put the mouseloc into MOUSE_TRACKER
  61.  
  62. repeat while the mouseclick is true
  63. -- Clean out leftover mouseclicks
  64. end repeat
  65.  
  66. set cursor to "face 1"
  67. put 1 into CURRENT_FACE
  68. repeat
  69. if the optionkey is "down" then
  70. visual effect dissolve to black
  71. visual effect dissolve
  72. go to card "main menu"
  73. exit to hypercard
  74. else
  75. if the mouseclick then exit repeat
  76. end if
  77. if inkey() is " " then exit repeat
  78. put the random of 20 into WAIT_TEMP
  79. add 50 to WAIT_TEMP
  80. wait WAIT_TEMP
  81. add WAIT_TEMP to TOTAL_WAIT_TIME
  82. if TOTAL_WAIT_TIME > MAX_WAIT_TIME then
  83. if the mouseloc = MOUSE_TRACKER then
  84. promptoid "Please move the mouse"
  85. put the ticks into START_TIME
  86. put FALSE into FALSE_ALARM
  87. repeat while the ticks - START_TIME < 300
  88. if the mouseloc <> MOUSE_TRACKER then
  89. put TRUE into FALSE_ALARM
  90. exit repeat
  91. end if
  92. end repeat
  93. close window "promptoid"
  94. if FALSE_ALARM then
  95. put the mouseloc into MOUSE_TRACKER
  96. put 0 into TOTAL_WAIT_TIME
  97. else
  98. visual effect dissolve to black
  99. visual effect dissolve
  100. go to card "main menu"
  101. exit to hypercard
  102. end if
  103. else
  104. put the mouseloc into MOUSE_TRACKER
  105. put 0 into TOTAL_WAIT_TIME
  106. end if
  107. end if
  108. if CURRENT_FACE is 1 then
  109. put the random of 20 into CURRENT_FACE
  110. put "face " & CURRENT_FACE into NEW_FACE
  111. set cursor to NEW_FACE
  112. else if CURRENT_FACE is 2 then
  113. set cursor to "face 1"
  114. put 1 into CURRENT_FACE
  115. else
  116. put the random of 20 into CURRENT_FACE
  117. if CURRENT_FACE is 2 then put 1 into CURRENT_FACE
  118. put "face " & CURRENT_FACE into NEW_FACE
  119. set cursor to NEW_FACE
  120. end if
  121. end repeat
  122. set cursor to none
  123.  
  124. end ClickWait
  125.  
  126. on openstack
  127. global USERLEVEL_SAVE
  128. global WAIT_INTERVAL
  129. global MYVOLUME
  130. global VOLUME_SAVE
  131. global EFFECT_SPEED
  132. global SPEED
  133. global LOG_FLAG
  134. global MAX_IDLE_TIME
  135. global IDLE_TIMER
  136. global MOUSE_TRACKER
  137. global DIVIDING_LINE
  138.  
  139. hide menubar
  140. hide titlebar
  141. put the screenrect into SCREEN_BORDER
  142. put the rect of card window into CARD_BORDER
  143. put item 3 of SCREEN_BORDER - item 1 of SCREEN_BORDER into SCREEN_WIDTH
  144. put item 4 of SCREEN_BORDER - item 2 of SCREEN_BORDER into SCREEN_HEIGHT
  145. put item 3 of CARD_BORDER - item 1 of CARD_BORDER into CARD_WIDTH
  146. put item 4 of CARD_BORDER - item 2 of CARD_BORDER into CARD_HEIGHT
  147. put (SCREEN_WIDTH - CARD_WIDTH) / 2 into item 1 of TOP_LEFT
  148. put (SCREEN_HEIGHT - CARD_HEIGHT) / 2 into item 2 of TOP_LEFT
  149. set the loc of card window to TOP_LEFT
  150. set the cantmodify of this stack to true
  151. set the cantpeek of this stack to true
  152. set the blindtyping to false
  153. put the userlevel into USERLEVEL_SAVE
  154. put 60 into WAIT_INTERVAL
  155. set the userlevel to 2
  156. put volume(4) into VOLUME_SAVE
  157. put 4 into MYVOLUME
  158. send updatevolume to card button "slider 1" of card "controls"
  159. put EMPTY into LOG_FLAG
  160. put 120 into MAX_IDLE_TIME
  161. put 0 into IDLE_TIMER
  162. put the mouseloc into MOUSE_TRACKER
  163. get the rect of the card window
  164. put ( item 3 of it - item 1 of it ) / 2 into DIVIDING_LINE
  165.  
  166. end openstack
  167.  
  168. on closestack
  169. global USERLEVEL_SAVE
  170. global VOLUME_SAVE
  171.  
  172. set the userlevel to USERLEVEL_SAVE
  173. put volume(VOLUME_SAVE) into TEMP
  174.  
  175. end closestack
  176.  
  177. on suspendstack
  178. global USERLEVEL_SAVE
  179. global VOLUME_SAVE
  180.  
  181. put the userlevel into TEMP
  182. set the userlevel to USERLEVEL_SAVE
  183. put TEMP into USERLEVEL_SAVE
  184. put volume(VOLUME_SAVE) into VOLUME_SAVE
  185.  
  186. end suspendstack
  187.  
  188. on resumestack
  189. global USERLEVEL_SAVE
  190. global VOLUME_SAVE
  191.  
  192. put the userlevel into TEMP
  193. set the userlevel to USERLEVEL_SAVE
  194. put TEMP into USERLEVEL_SAVE
  195. put volume(VOLUME_SAVE) into VOLUME_SAVE
  196.  
  197. end resumestack
  198.  
  199. on work
  200. set the userlevel to 5
  201. set the cantmodify of this stack to false
  202. set the cantpeek of this stack to false
  203. end work
  204.  
  205. on use
  206. set the cantmodify of this stack to true
  207. set the cantpeek of this stack to true
  208. end use
  209.  
  210. on record_answer MODULE, QUESTION, RIGHTWRONG
  211. end record_answer
  212.  
  213. function significantto WORK,PLACES
  214.  
  215. repeat while first char of WORK is "0"
  216. delete first char of WORK
  217. if WORK is EMPTY then
  218. return FALSE
  219. exit significantto
  220. end if
  221. end repeat
  222.  
  223. put offset( ".", WORK ) into DECIMAL
  224.  
  225. if DECIMAL > 1 then
  226. if length( WORK ) = PLACES + 1 then
  227. return TRUE
  228. else
  229. return FALSE
  230. end if
  231. else
  232. repeat while char DECIMAL+1 of work is "0"
  233. add 1 to DECIMAL
  234. end repeat
  235. if (length( WORK ) - DECIMAL) = PLACES then
  236. return TRUE
  237. else
  238. return FALSE
  239. end if
  240. end if
  241.  
  242. end significantto
  243.  
  244. function numberVerify container
  245. put the charToNum of "0" into base
  246. put the charToNum of "." into aperiod
  247. put the charToNum of " " into ablank
  248. put the charToNum of "-" into aminus
  249. put 0 into isanumber
  250. put false into seenAPeriod
  251. put false into numberStarted
  252. put false into numberFinished
  253. put false into seenASign
  254. repeat with i = 1 to the number of characters in line 1 of container
  255. put (the charToNum of char i of container) into test
  256. if test is aperiod then
  257. if numberFinished or seenAperiod then
  258. put i into isanumber
  259. exit repeat
  260. else
  261. put true into seenAPeriod
  262. put true into numberStarted
  263. end if
  264. else if test is aminus then
  265. if numberStarted or seenASign then
  266. put i into isanumber
  267. exit repeat
  268. else
  269. put true into seenASign
  270. put true into numberStarted
  271. end if
  272. else if test is ablank and numberStarted and not numberFinished then
  273. put true into numberFinished
  274. else if test is not ablank then
  275. if numberFinished then
  276. put i into isanumber
  277. exit repeat
  278. else if ((test-base) < 0) or ((test-base) > 9) then
  279. put i into isanumber
  280. exit repeat
  281. else
  282. put true into numberStarted
  283. end if
  284. end if
  285. end repeat
  286. return isanumber
  287. end numberVerify
  288.  
  289. on login
  290.  
  291. open file "Hyperchem Records"
  292. read from file "Hyperchem Records" for 16384
  293. repeat until it is EMPTY
  294. put it into PAST_ENTRIES
  295. read from file "Hyperchem Records" for 16384
  296. end repeat
  297. put EMPTY into USERNAME
  298. if USERNAME is empty then
  299. ask "Please type your name or ID number:"
  300. repeat while it is empty
  301. ask "Please type your name or ID number:"
  302. end repeat
  303. put it into USERNAME
  304. end if
  305. put USERNAME & "," & the short name of this stack & "," &┬¼
  306. the time & "," & the date & RETURN into THIS_ENTRY
  307. write THIS_ENTRY to file "Hyperchem Records"
  308. close file "Hyperchem Records"
  309.  
  310. end login
  311.  
  312.  
  313. on dowrong
  314. push card
  315. visual effect checkerboard
  316. go to card "wrong"
  317.  
  318. flash 3
  319. lock screen
  320. show cd fld luck
  321. unlock screen with wipe right
  322. wait 40
  323. pop card
  324. end dowrong
  325.  
  326. on doright
  327. push card
  328. visual effect checkerboard
  329. go to card "CORRECT"
  330. flash 3
  331. show cd fld good
  332. wait 40
  333. pop card
  334. end doright
  335. </script>
  336.     <background id="2233" file="background_2233.xml" name="" />
  337.     <background id="2663" file="background_2663.xml" name="" />
  338.     <background id="3886" file="background_3886.xml" name="" />
  339.     <background id="9469" file="background_9469.xml" name="work" />
  340.     <background id="9733" file="background_9733.xml" name="" />
  341.     <background id="11025" file="background_11025.xml" name="" />
  342.     <background id="12517" file="background_12517.xml" name="" />
  343.     <background id="13249" file="background_13249.xml" name="" />
  344.     <background id="13907" file="background_13907.xml" name="" />
  345.     <background id="15346" fi