Advertisement
Guest User

Untitled

a guest
Apr 12th, 2021
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.80 KB | None | 0 0
  1. local unicode = require("unicode")
  2. local component = require("component")
  3. local computer = require("computer")
  4.  
  5. local libcomputer = {
  6.     address = computer.address,
  7.     tmpAddress = computer.tmpAddress,
  8.     shutdown = function() coroutine.yield("COMPUTER_SHUTDOWN") end,
  9.     pushSignal = computer.pushSignal,
  10.     pullSignal = computer.pullSignal,
  11.     getDeviceInfo = computer.getDeviceInfo,
  12.     freeMemory = computer.freeMemory,
  13.     totalMemory = computer.totalMemory,
  14.     uptime = computer.uptime,
  15.     energy = computer.energy,
  16.     maxEnergy = computer.maxEnergy,
  17.     users = computer.users,
  18.     addUser = function() end,
  19.     removeUser = function() end,
  20.     beep = computer.beep,
  21.     getProgramLocations = computer.getProgramLocations,
  22.     getArchitecture = computer.getArchitecture,
  23.     getArchitectures = computer.getArchitectures,
  24.     setArchitecture = function() end
  25. }
  26.  
  27. local sandbox = {
  28.     assert = assert,
  29.     error = error, -- todo
  30.     _G = nil,
  31.     getmetatable = getmetatable,
  32.     next = next,
  33.     pairs = pairs,
  34.     pcall = pcall,
  35.     rawequal = rawequal,
  36.     rawget = rawget,
  37.     rawlen = rawlen,
  38.     rawset = rawset,
  39.     select = select,
  40.     setmetatable = setmetatable,
  41.     tonumber = tonumber,
  42.     tostring = tostring,
  43.     type = type,
  44.     _VERSION = _VERSION,
  45.     xpcall = xpcall,
  46.     coroutine = coroutine,
  47.     string = string,
  48.     table = table,
  49.     math = math,
  50.     bit32 = bit32,
  51.     os = {
  52.         clock = os.clock,
  53.         date = os.date,
  54.         difftime = os.difftime,
  55.         execute = nil,
  56.         exit = nil,
  57.         remove = nil,
  58.         rename = nil,
  59.         time = os.time,
  60.         tmpname = nil
  61.     },
  62.     debug = debug,
  63.     utf8 = utf8,
  64.     checkArg = checkArg,
  65.     component = libcomponent,
  66.     computer = libcomputer,
  67.     unicode = unicode
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement