home *** CD-ROM | disk | FTP | other *** search
/ 321 GAMES / 321GAMES.iso / logic / runes / runes.exe / runes.DXR / 00193.ls < prev    next >
Encoding:
Text File  |  1996-07-01  |  2.3 KB  |  87 lines

  1. on GETUSERNAME
  2.   global NMLETTERS, NLET, USERNAME
  3.   dontPassEvent()
  4.   set NMLETTERS to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz. "
  5.   set NLET to EMPTY
  6.   set NLET to the key
  7.   if (the key = RETURN) and (length(USERNAME) < 6) then
  8.     set USERNAME to EMPTY
  9.     set the text of cast "CODENAME" to USERNAME
  10.     updateStage()
  11.     beep()
  12.     exit
  13.   end if
  14.   if charToNum(the key) = 8 then
  15.     set USERNAME to EMPTY
  16.     set the text of cast "CODENAME" to USERNAME
  17.     updateStage()
  18.     exit
  19.   end if
  20.   if length(USERNAME) > 30 then
  21.     beep()
  22.     exit
  23.   end if
  24.   if NMLETTERS contains NLET then
  25.     set USERNAME to USERNAME & NLET
  26.     set the text of cast "CODENAME" to USERNAME
  27.   end if
  28.   if (the key = RETURN) and (length(USERNAME) > 5) then
  29.     if char 1 of USERNAME = " " then
  30.       set USERNAME to EMPTY
  31.       set the text of cast "CODENAME" to USERNAME
  32.       updateStage()
  33.       beep()
  34.       exit
  35.     end if
  36.     dontPassEvent()
  37.     set the keyDownScript to "GETCODENAME1"
  38.     go("GETCODE")
  39.   end if
  40. end
  41.  
  42. on GETCODENAME1
  43.   global NMLETTERS, NLET, startMovie, SCRAMBLENAME, USERNAME, CODEUSERNAME, CODENUMBER, UPG, ZW, ZWW
  44.   set SCRAMBLENAME to EMPTY
  45.   set CODEUSERNAME to EMPTY
  46.   set UPG to 0
  47.   dontPassEvent()
  48.   set NMLETTERS to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890$"
  49.   set NLET to EMPTY
  50.   set NLET to the key
  51.   if (charToNum(the key) = 8) or (length(CODENUMBER) > 18) then
  52.     set CODENUMBER to EMPTY
  53.     set the text of cast "CODENAME" to CODENUMBER
  54.     updateStage()
  55.     exit
  56.   end if
  57.   if NMLETTERS contains NLET then
  58.     set CODENUMBER to CODENUMBER & NLET
  59.     set the text of cast "CODENAME" to CODENUMBER
  60.   end if
  61.   if the key = RETURN then
  62.     dontPassEvent()
  63.     set the keyDownScript to "EEMPTY"
  64.     set the mouseDownScript to EMPTY
  65.     repeat with n = 1 to length(CODENUMBER)
  66.       set ZW to char n of CODENUMBER
  67.       set ZWW to charToNum(ZW) + 57 + n
  68.       set CODEUSERNAME to CODEUSERNAME & numToChar(ZWW)
  69.     end repeat
  70.     set CODENUMBER to CODEUSERNAME
  71.     put CODENUMBER
  72.     repeat with n = 1 to length(USERNAME)
  73.       set ZW to char n of USERNAME
  74.       set ZWW to charToNum(ZW) + 57 + n
  75.       set SCRAMBLENAME to SCRAMBLENAME & numToChar(ZWW)
  76.     end repeat
  77.     WRITEUPG()
  78.     CHECKUPG()
  79.     if UPG = 0 then
  80.       go("NOUPG")
  81.     end if
  82.     if UPG = 1 then
  83.       go("YESUPG")
  84.     end if
  85.   end if
  86. end
  87.