EconomicSerg

The ENTIRE Lua.org/demo WEBSTITE!!!! (Note: This is just the demo web. NOT the actual site)

Nov 4th, 2020
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.53 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3.     <title>Lua: Demo</title>
  4.     <base href="https://www.lua.org/">
  5.     <link rel="stylesheet" type="text/css" href="lua.css">
  6.     <meta http-equiv="content-type" content="text/html; charset=utf-8">
  7.     <style type="text/css">
  8.     textarea {
  9.         font-family: monoscape ;
  10.     }
  11.    
  12.     input {
  13.         margin-right: 1em ;
  14.     }
  15.     </style>
  16. </head>
  17. <body data-new-gr-c-s-check-loaded="14.982.0">
  18.     <h1>
  19.         <a href="home.html">
  20.             <img src="images/logo.gif" alt="Lua">
  21.         </a>
  22.         "
  23.         Demo
  24.         "
  25.         </h1>
  26.         <p>
  27.         "
  28.         Try Lua before
  29.         "
  30.  
  31.         <a href="download.html>downloading</a>
  32.         " it.
  33.         Enter your Lua program
  34.         or choose one of the demo programs below.
  35.  
  36.         "
  37.         </p>
  38.         <div class="menubar">
  39.             <a href="cgi-bin/demo?hello">hello</a>
  40.             "
  41.             .
  42.             "
  43.             <a href="cgi-bin/demo?bisect">bisect</a>
  44.             "
  45.             .
  46.             "
  47.             <a href="cgi-bin/demo?sieve">sieve</a
  48.             "
  49.             .
  50.             "
  51.             <a href="cgi-bin/demo?account">account</a>
  52.         </div>
  53.         <p>
  54.         </p>
  55.         <form action="cgi-bin/demo" method="POST">
  56.             <textarea rows="16" cols="80" name="input" maxlength="2000">
  57.             "function getdata()
  58.     levels = {}
  59.     djinn = {0, 0, 0, 0}
  60.     events = 0
  61.     stats = {}
  62.     items = {}
  63.     coins = 0
  64.  
  65.     eventflags = {0x941, 0x951, 0x8B3, 0x8D1, 0x81E, 0x868}
  66.     for j=0,5 do
  67.         index = eventflags[j+1]
  68.         bytepos = bit.rshift(index, 3)
  69.         bitpos = bit.band(index, 7)
  70.         flag = bit.band(bit.rshift(memory.readbyte(0x02000040 + bytepos), bitpos), 1)
  71.         events = bit.bor(events, bit.lshift(flag, j))
  72.     end
  73.     coins = memory.readdword(0x02000250)
  74.  
  75.     for i=0,3 do
  76.         base = 0x02000500 + 0x14C*i
  77.         table.insert(levels, memory.readbyte(base + 0xF))
  78.         for j=0,3 do
  79.             djinn[j+1] = bit.bor(djinn[j+1], memory.readdword(base + 0xF8 + 4*j))
  80.         end
  81.         hp = memory.readword(base + 0x10)
  82.         pp = memory.readword(base + 0x12)
  83.         atk = memory.readword(base + 0x18)
  84.         def = memory.readword(base + 0x1A)
  85.         agi = memory.readword(base + 0x1C)
  86.         lck = memory.readbyte(base + 0x1E)
  87.         table.insert(stats, {hp, pp, atk, def, agi, lck})
  88.        
  89.         pcitems = {}
  90.         for j=0,14 do
  91.             table.insert(pcitems, memory.readword(base + 0xd8 + 2*j))
  92.         end
  93.         table.insert(items, pcitems)
  94.     end
  95.  
  96.     return levels, djinn, events, stats, items, coins
  97. end
  98.  
  99.  
  100. function bitarray()
  101.     function write(self, value, size, pos)
  102.         pos = pos or #self.bits+1
  103.         size = size or 1
  104.         for i=1,size do
  105.             self.bits[pos + i-1] = bit.band(bit.rshift(value, size-i), 1)
  106.         end
  107.     end
  108.     function sub(self, min, max)
  109.         if max == nil then return self.bits[min] or 0 end
  110.         value = 0
  111.         for i=0,max-min do
  112.             value = 2*value + (self.bits[min+i] or 0)
  113.         end
  114.         return value
  115.     end
  116.     return {bits={}, write=write, sub=sub}
  117. end
  118.  
  119.  
  120. function getpassword(passwordtier, levels, djinn, events, stats, items, coins)
  121.     passwordtier = passwordtier:lower()
  122.     bits = bitarray()
  123.  
  124.     tmparray = bitarray()
  125.     for i=4,1,-1 do tmparray:w"
  126.     </textarea>
  127.     <p>
  128.         <input type="submit" value="run">
  129.         <input type="button" value="clear" onClick="this.form.elements['input'].value=''">
  130.         <input type="reset" value="restore">
  131.         <input type="button" value="restart" onClick="window.location.href='/demo.html'">
  132.         </p>
  133.         </form>
  134.         <h2>
  135.             ::before
  136.             "Output"
  137.         </h2>
  138.         <textarea rows="8" cols="80">input:69: function arguments expected near <eof>
  139.         </textarea>
Add Comment
Please, Sign In to add comment