home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Diversos / clowns.swf / scripts / DefineSprite_373 / frame_1 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  1.6 KB  |  58 lines

  1. function initSession()
  2. {
  3.    session = "";
  4.    while(session.length < 20)
  5.    {
  6.       session += charTable.charAt(Math.round(Math.random() * (charTable.length - 4)));
  7.    }
  8. }
  9. function submit(pGame, pDisciple, pScore0, pScore1, pScore2)
  10. {
  11.    urlSubmit = "http://www.neodelight.com/v4/high_enter.php";
  12.    s = "g=" + pGame + "&";
  13.    s += "d=" + pDisciple + "&";
  14.    s += "s0=" + pScore0 + "&";
  15.    s += "s1=" + pScore1 + "&";
  16.    s += "s2=" + pScore2 + "&";
  17.    s += "se=" + escape(session);
  18.    s += "&c=42";
  19.    urlSubmit += "?s=" + escape(encrypt(encrypt(s,keystring),"AnotherKey4You2FindOut4815jiagIOm30JK"));
  20.    getURL(urlSubmit,"_blank");
  21. }
  22. function encrypt(pString, pKey)
  23. {
  24.    text = pString;
  25.    crypt = "";
  26.    checkSum = 0;
  27.    i = 0;
  28.    while(i < text.length)
  29.    {
  30.       char = tableIndex(text.charCodeAt(i),charTable);
  31.       shift = tableIndex(pKey.charCodeAt(i % pKey.length),charTable);
  32.       code = char + shift + checkSum;
  33.       code %= charTable.length;
  34.       crypt += charTableCrypt.charAt(code);
  35.       checkSum += code;
  36.       i++;
  37.    }
  38.    checkSum %= charTable.length;
  39.    return crypt + "" + charTableCrypt.charAt(checkSum);
  40. }
  41. function tableIndex(pCharCode, pTable)
  42. {
  43.    j = 0;
  44.    while(j < pTable.length)
  45.    {
  46.       if(pCharCode == pTable.charCodeAt(j))
  47.       {
  48.          return j;
  49.       }
  50.       j++;
  51.    }
  52. }
  53. _name = "highscores";
  54. charTable = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&=.";
  55. charTableCrypt = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&=.";
  56. keystring = "whytheheckdoyouwasteyourtimehackingthishighscorelist";
  57. initSession();
  58.