Scrap Mechanic

Scrap Mechanic

Not enough ratings
ScrapVM
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
506.172 KB
Apr 9, 2022 @ 1:18pm
Jun 2, 2022 @ 2:18pm
4 Change Notes ( view )

Subscribe to download
ScrapVM

Description

ScrapVM - Finally makes it possible to run any lua string as code!

  • Send dynamic payloads from client -> server and vice-versa!
  • Make a lua executor entirely from within the game!
  • Execute code that's read from JSON files!

There are so many new possibilities, please show off your mods that make use of this!



How To Use:

dofile '$CONTENT_5a081817-b141-4439-987f-a25162d125fd/Scripts/scrapvm.lua' Example = class() function Example.server_onCreate(self) if not sm.luavm then return end -- Run arbitrary lua code! local code = [[ print('Hello from ScrapVM!') ]] -- Compiles the code local hello_world = sm.luavm.loadstring(code) -- Run the code! hello_world() end




Credits:
Prime - dev support with making scrap mechanic mods!


Post any bugs / suggestions in comments below :)
If you do post a bug, please post some way to reproduce it
7 Comments
You CCh While I 0xCC  [author] Jan 29 @ 12:07pm 
Yeah, went from one hiatus to another real fast
SeveringHams Jan 20 @ 7:22pm 
this did not age well
You CCh While I 0xCC  [author] Mar 22, 2023 @ 4:20pm 
@TheFattestCat I'll address that in the next update, came back from hiatus recently so hopefully this issue will be no more soon :)
TheFattestCat Jul 3, 2022 @ 3:24pm 
Well, it's the best, I also tried https://github.com/vladimirdabic/lua-in-lua , but this lbi much faster... But I found a problem: I can't set env for this function (I don't know how). I'm triying to make scriptable computer and i need to define some functions in local env. And also good feature wiil be make interation limit (i don't know if it exists now), because of recuresion or eternal cycle....
afdelta01 Apr 22, 2022 @ 12:48pm 
Well... Can only hope I guess.
You CCh While I 0xCC  [author] Apr 22, 2022 @ 3:47am 
This doesn't escape any protections setup by the game. If someone wants to be malicious, this mod won't give them any more options than they already had, this is just a tool for running generic code.
afdelta01 Apr 21, 2022 @ 3:49pm 
This...... is potential for very bad things tho.