Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Je06

PSE - Protected Script Environment

Recommended Posts

The PSE will run any code you give it and will run it in it's own sandbox environment. What this means is that code will run with absolutely no functions or variables except for what you give it.

This means, unless you say so, the PSE will run code without any of the lua standard functions. However, any code the PSE runs cannot affect anything other than the functions and variables you give it.

 

I named my function by putting an underscore in between words, however, I also provided functions named in camel case that do the same thing. For example: new_sandbox() and newSandbox() do the same thing.

 

Functions

new_sandbox()

    Returns a sandbox that is ready to run your code in

debug_sandbox(sandbox)

    Will print some debug data to the screen

add_code(sandbox, name, code)

    Will add code the the sandbox using name as the index

add_argument(sandbox, argument)

    Adds the argument to the sandbox as a command line argument

add_file(sandbox, name, path)

    Will add whatever the file at path returns when it runs to the sandbox using name as the index

add_global(sandbox, name)

    Adds any global functions or variables with the index of name to the sandbox using name as the index

run_string(sandbox, name, data)

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.