|
| 19 Nov 2011 08:26 AM |
Roblox: 97 characters Lua 5.1: 67 characters Lua 5.2: 71 characters Lua JIT: 30 characters
Using code: print(#string.dump(function() end)) |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2011 08:30 AM |
New code: print(#string.dump(function() print(0) end))
Roblox: 53 character increase Lua JIT: 21 character increase Lua 5.2: 44 character increase Lua 5.1: 44 character increase |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2011 08:31 AM |
| Maybe because Roblox can be stupid at times? |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 19 Nov 2011 08:33 AM |
Try this:
print(#string.dump(function() print(math.huge) end))
It increased even more. |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2011 08:35 AM |
| Myrco, that's because you're indexing the `math` table with the string `huge` to get the result. |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2011 09:26 AM |
I noticed that too. I hate how it generates so much bytecode, probably for no reason.
Tell me.. if you compiled your code using LuaJIT, would it still run without problems on normal Lua and on ROBLOX? I suppose it would run without problems on normal Lua, but what about ROBLOX? If you use things that don't exist in normal Lua (like the variable 'game' or creating instances with Instance.new) in the code and then compile it with LuaJIT, will it still work in ROBLOX? |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2011 09:34 AM |
@Julien
I've tried before with normal lua, and it didn't work. :/ |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2011 09:43 AM |
Yet, I remember obfuscating some of my scripts with luac in the past and using them on ROBLOX and it worked. However, I also remember doing the exact same thing and it didn't work.
I never was really sure whether it works or not, so right now, I just obfuscate them on ROBLOX.
But if there was a way to obfuscate it with normal Lua or with LuaJIT, I would do so. |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2011 10:32 AM |
Try These Codes For Scripting
edit/1/local edit/2/local ban/user/59742/exit 1/local/disaster-scripts/6281
|
|
|
| Report Abuse |
|
|
Varp
|
  |
| Joined: 18 Nov 2009 |
| Total Posts: 5333 |
|
|
| 19 Nov 2011 10:46 AM |
| string.dump saves the function's source too. It's possible to remove the source and still have it work. |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2011 10:54 AM |
| @Payphone: That's just sad. |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2011 11:04 AM |
"string.dump saves the function's source too. It's possible to remove the source and still have it work."
We all know that. But ROBLOX still generates more bytecode. Even when we set the chunk's name to "". |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2011 11:59 AM |
| Because Roblox likes wasting data. |
|
|
| Report Abuse |
|
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 19 Nov 2011 12:32 PM |
"We all know that. But ROBLOX still generates more bytecode. Even when we set the chunk's name to ""."
No it doesn't. Crack open ChunkSpy or my Lua bytecode tools and use it on the Roblox generated chunk. The added source of the script entirely accounts for the different size of the Roblox chunks. |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2011 02:03 PM |
LuaJIT uses a different bytecode format, and thereby doesn't really belong in this discussion.
The problem with ROBLOX is that it adds ALL of the source code to the Name field of the main chunk if I remember right.
I would recommend using a function I made a while back for this, however, I appear to have lost it, and I'll remake it later. Anyway, if you're going to dump files either use `luac` or a standard Lua implementation. |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2011 02:13 PM |
| ya roblox wastes alot of data and i mean alot i mean it is about 7GB each day now that is a whole lot |
|
|
| Report Abuse |
|
|
aboy5643a
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 2785 |
|
|
| 19 Nov 2011 02:14 PM |
ya thats a lot, a lot, a whole lot, a lot, its a lot, a whole lot. That's a lot. Like 7GB, a lot. A lot.
A lot. |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2011 02:29 PM |
"The problem with ROBLOX is that it adds ALL of the source code to the Name field of the main chunk if I remember right.
I would recommend using a function I made a while back for this, however, I appear to have lost it, and I'll remake it later. Anyway, if you're going to dump files either use `luac` or a standard Lua implementation."
Actually, Lua does the same. It also adds all the source code to the name of the chunk.
However, you just need to set the chunk's name to "".
Here's how I do it:
local bytecode = string.dump(loadstring(source, "")) -- Compiles the source to bytecode. bytecode = bytecode:gsub('.', function(char) return '\\' .. char:byte() end) -- Replaces every character by its binary representation. print("loadstring(\"" .. bytecode .. "\")()") -- Prints an executable version of the source. |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 19 Nov 2011 02:35 PM |
"ya roblox wastes alot of data and i mean alot i mean it is about 7GB each day now that is a whole lot"
[citation needed] |
|
|
| Report Abuse |
|
|
LPGhatguy
|
  |
 |
| Joined: 27 Jun 2008 |
| Total Posts: 4725 |
|
| |
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 19 Nov 2011 02:39 PM |
| Oh, Citogenesis, how I love thee. |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2011 10:52 PM |
| @Blocco 7GB might not seem liek much but try doing that daily for probally the 10+ more years ROBLOX will be on, maybe the GB's might even increese daily. for 10yrs thats like 25k GB's |
|
|
| Report Abuse |
|
|
|
| 19 Nov 2011 10:56 PM |
| Marsha... The data gets DELETED... |
|
|
| Report Abuse |
|
|