home *** CD-ROM | disk | FTP | other *** search
/ Sverigejakten / sverigejakten.iso / SUCCESS.DIR / 00039_Script_f_highscore < prev    next >
Text File  |  2003-08-12  |  2KB  |  55 lines

  1. on exitFrame
  2.   set exit=0
  3.   set temp_mousedown=the mousedown
  4.   repeat while rollover (22)=1
  5.     set the forecolor of member "done"=255
  6.     if temp_mousedown < the mousedown then set temp_mousedown=1
  7.     if temp_mousedown > the mousedown then
  8.       global movie_time
  9.       global crimeno
  10.       global level
  11.       set crimes=crimeno
  12.       
  13.       set temp_time=(movie_time)
  14.       
  15.       set hours = (temp_time/60)
  16.       set minutes=abs(temp_time-(hours*60))
  17.       
  18.       set temp_value=(crimes*2)+hours+(6*(3-level))
  19.       set points=((10-crimes)*350) + (4000-movie_time) + (600*level)
  20.       set title=9
  21.       if temp_value<45 then set title=9
  22.       if temp_value<40 then set title=8
  23.       if temp_value<35 then set title=7
  24.       if temp_value<30 then set title=6
  25.       if temp_value<25 then set title=5
  26.       if temp_value<20 then set title=4
  27.       if temp_value<16 then set title=3
  28.       if temp_value<11 then set title=2
  29.       if temp_value<7 then set title=1
  30.       set temp_text=the text of member "highscore" of castlib "savegame"
  31.       
  32.       set temp_counter=12
  33.       repeat while temp_counter>0
  34.         put line temp_counter of temp_text into line (temp_counter+1) of temp_text
  35.         if points < value (item 3 of line (temp_counter-1) of temp_text) or temp_counter=1 then
  36.           
  37.           set temp_text2=line 1 of the text of member "name"
  38.           put item 1 of temp_text2 into item 1 of line temp_counter of temp_text
  39.           put line title of the text of member "titles" into item 2 of line temp_counter of temp_text
  40.           put points into item 3 of line temp_counter of temp_text
  41.           set temp_counter=-1
  42.         end if
  43.         set temp_counter=temp_counter-1
  44.       end repeat
  45.       set the text of member "highscore" of castlib "savegame" = temp_text
  46.       save castlib "savegame"
  47.       set exit=1
  48.       exit repeat
  49.     end if
  50.   end repeat
  51.   set the forecolor of member "done"=130
  52.   
  53.   if exit=0 then go to the frame
  54.   else go to "list"
  55. end