dan200.computercraft.api.lua.ILuaContext Java Examples
The following examples show how to use
dan200.computercraft.api.lua.ILuaContext.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LuaObjectWrapper.java From OpenPeripheral with MIT License | 6 votes |
@Override public Object[] callMethod(final ILuaContext context, final int index, final Object[] arguments) throws LuaException, InterruptedException { final IMethodExecutor method = methods.getMethod(index); Preconditions.checkNotNull(method, "Invalid method index: %d", index); if (method.isAsynchronous()) return call(index, method, context, arguments); else { Object[] result = SynchronousExecutor.executeInMainThread(context, new SynchronousExecutor.Task() { @Override public Object[] execute() throws LuaException, InterruptedException { return call(index, method, context, arguments); } }); return result; } }
Example #2
Source File: SynchronousExecutor.java From OpenPeripheral with MIT License | 5 votes |
public static Object[] executeInMainThread(ILuaContext context, Task task) throws LuaException, InterruptedException { final Responder responder = new Responder(context, task); long taskId = context.issueMainThreadTask(responder); responder.waitForEvent(taskId); // This code was executed in main thread, so there are no special exceptions we need to pass final Throwable error = responder.error; if (error != null) { if (error instanceof LuaException) throw (LuaException)error; else throw new LuaException(AdapterLogicException.getMessageForThrowable(error)); } return responder.result; }
Example #3
Source File: ComputerCraftEnv.java From OpenPeripheral with MIT License | 5 votes |
public IMethodCall addPeripheralArgs(IMethodCall call, IComputerAccess access, ILuaContext context) { final CCArchitectureAccess wrapper = new CCArchitectureAccess(access, converter); return addCommonArgs(call, context) .setEnv(Constants.ARG_ARCHITECTURE, wrapper) .setEnv(Constants.ARG_ACCESS, wrapper) .setEnv(Constants.ARG_COMPUTER, access); }
Example #4
Source File: ModuleComputerCraft.java From OpenPeripheral with MIT License | 5 votes |
public static void init() { final MethodSelector peripheralSelector = new MethodSelector(Constants.ARCH_COMPUTER_CRAFT) .allowReturnSignal() .addDefaultEnv() .addProvidedEnv(Constants.ARG_ACCESS, IArchitectureAccess.class) .addProvidedEnv(Constants.ARG_COMPUTER, IComputerAccess.class) .addProvidedEnv(Constants.ARG_CONTEXT, ILuaContext.class); PERIPHERAL_METHODS_FACTORY = new ComposedMethodsFactory<IndexedMethodMap>(AdapterRegistry.PERIPHERAL_ADAPTERS, peripheralSelector) { @Override protected IndexedMethodMap wrapMethods(Class<?> targetCls, Map<String, IMethodExecutor> methods) { return new IndexedMethodMap(methods); } }; // can't push events, so not allowing return signals final MethodSelector objectSelector = new MethodSelector(Constants.ARCH_COMPUTER_CRAFT) .addDefaultEnv() .addProvidedEnv(Constants.ARG_CONTEXT, ILuaContext.class); OBJECT_METHODS_FACTORY = new ComposedMethodsFactory<IndexedMethodMap>(AdapterRegistry.OBJECT_ADAPTERS, objectSelector) { @Override protected IndexedMethodMap wrapMethods(Class<?> targetCls, Map<String, IMethodExecutor> methods) { return new IndexedMethodMap(methods); } }; CommandDump.addArchSerializer("ComputerCraft", "peripheral", DocBuilder.TILE_ENTITY_DECORATOR, PERIPHERAL_METHODS_FACTORY); CommandDump.addArchSerializer("ComputerCraft", "object", DocBuilder.SCRIPT_OBJECT_DECORATOR, OBJECT_METHODS_FACTORY); final IConverter converter = new TypeConversionRegistryCC(); // CC converter is default one (legacy behaviour) TypeConvertersProvider.INSTANCE.registerConverter(Constants.ARCH_COMPUTER_CRAFT, converter); TypeClassifier.INSTANCE.registerType(ILuaObject.class, SingleArgType.OBJECT); ENV = new ComputerCraftEnv(converter); }
Example #5
Source File: TileEntityDroneInterface.java From PneumaticCraft with GNU General Public License v3.0 | 5 votes |
@Override @Optional.Method(modid = ModIds.COMPUTERCRAFT) public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) throws LuaException{ try { return luaMethods.get(method).call(arguments); } catch(Exception e) { throw new LuaException(e.getMessage()); } }
Example #6
Source File: TileEntityBase.java From PneumaticCraft with GNU General Public License v3.0 | 5 votes |
@Override @Optional.Method(modid = ModIds.COMPUTERCRAFT) public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) throws LuaException, InterruptedException{ try { return luaMethods.get(method).call(arguments); } catch(Exception e) { throw new LuaException(e.getMessage()); } }
Example #7
Source File: TileEntityTurbineComputerPort.java From BigReactors with MIT License | 5 votes |
@Override @Optional.Method(modid = "ComputerCraft") public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) { try { return callMethod(method, arguments); } catch(Exception e) { BRLog.info("Exception encountered when invoking computercraft method: %s", e.getMessage()); e.printStackTrace(); } return null; }
Example #8
Source File: TileEntityReactorComputerPort.java From BigReactors with MIT License | 5 votes |
@Override @Optional.Method(modid = "ComputerCraft") public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) throws LuaException { try { return callMethod(method, arguments); } catch(Exception e) { // Rethrow errors as LuaExceptions for CC throw new LuaException(e.getMessage()); } }
Example #9
Source File: WrappedPeripheral.java From OpenPeripheral-Addons with MIT License | 4 votes |
@Override public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) throws LuaException, InterruptedException { return (peripheral != null)? peripheral.callMethod(computer, context, method, arguments) : null; }
Example #10
Source File: SynchronousExecutor.java From OpenPeripheral with MIT License | 4 votes |
public Responder(ILuaContext context, Task task) { this.context = context; this.task = task; }
Example #11
Source File: SafePeripheralFactory.java From OpenPeripheral with MIT License | 4 votes |
@Override public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) { return ArrayUtils.toArray("This peripheral is broken. You can show your log in #OpenMods"); }
Example #12
Source File: AdapterPeripheral.java From OpenPeripheral with MIT License | 4 votes |
private IMethodCall prepareCall(IMethodExecutor executor, IComputerAccess computer, ILuaContext context) { final IMethodCall call = executor.startCall(target); return ModuleComputerCraft.ENV.addPeripheralArgs(call, computer, context); }
Example #13
Source File: AdapterPeripheral.java From OpenPeripheral with MIT License | 4 votes |
@Override public Object[] callMethod(final IComputerAccess computer, final ILuaContext context, final int index, final Object[] arguments) throws LuaException, InterruptedException { // this should throw if peripheral isn't attached computer.getAttachmentName(); final IMethodExecutor method = methods.getMethod(index); Preconditions.checkNotNull(method, "Invalid method index: %d", index); final IMethodCall preparedCall = prepareCall(method, computer, context); final Optional<String> returnSignal = method.getReturnSignal(); if (returnSignal.isPresent()) { final int callbackId = SignallingGlobals.instance.nextCallbackId(); final String returnSignalId = returnSignal.get(); if (method.isAsynchronous()) { SignallingGlobals.instance.scheduleTask(new Runnable() { @Override public void run() { computer.queueEvent(returnSignalId, executeToSignal(callbackId, index, preparedCall, arguments)); } }); } else { context.issueMainThreadTask(new ILuaTask() { @Override public Object[] execute() { computer.queueEvent(returnSignalId, executeToSignal(callbackId, index, preparedCall, arguments)); // this will be used as 'task_complete' result, so we will ignore it return NULL; } }); } return new Object[] { callbackId }; } else { if (method.isAsynchronous()) return executeCall(preparedCall, index, arguments); else { Object[] results = SynchronousExecutor.executeInMainThread(context, new SynchronousExecutor.Task() { @Override public Object[] execute() throws LuaException, InterruptedException { return executeCall(preparedCall, index, arguments); } }); return results; } } }
Example #14
Source File: ComputerCraftEnv.java From OpenPeripheral with MIT License | 4 votes |
private IMethodCall addCommonArgs(IMethodCall call, ILuaContext context) { return call .setEnv(Constants.ARG_CONVERTER, converter) .setEnv(Constants.ARG_CONTEXT, context); }
Example #15
Source File: ComputerCraftEnv.java From OpenPeripheral with MIT License | 4 votes |
public IMethodCall addObjectArgs(IMethodCall call, ILuaContext context) { return addCommonArgs(call, context) .setEnv(Constants.ARG_ARCHITECTURE, new CCArchitecture(converter)); }
Example #16
Source File: PeripheralMotor.java From Framez with GNU General Public License v3.0 | 4 votes |
@Override public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) throws LuaException, InterruptedException { if (method == 0) { if (arguments.length == 0) throw new LuaException("At least 1 argument is required (face)"); return new Object[] { te.setFace(toFD(arguments[0])) }; } else if (method == 1) { return new Object[] { te.getFace().ordinal() }; } else if (method == 2) { if (!(te.getMovement() instanceof MovementSlide)) throw new LuaException("This is not a slider motor!"); if (arguments.length == 0) throw new LuaException("At least 1 argument is required (direction)"); ((IMovementSlide) te.getMovement()).setDirection(toFD(arguments[0])); return new Object[] {}; } else if (method == 3) { if (!(te.getMovement() instanceof MovementSlide)) throw new LuaException("This is not a slider motor!"); return new Object[] { ((IMovementSlide) te.getMovement()).getDirection().ordinal() }; } else if (method == 4) { throw new LuaException("Not implemented yet, sorry D:"); // if (arguments.length < 2) // throw new LuaException("At least 2 arguments are required (face, direction)"); // // ForgeDirection face = toFD(arguments[0]); // ForgeDirection direction = toFD(arguments[1]); // // if (face == null || direction == null) // throw new LuaException("Invalid directions!"); // if (face == direction || face == direction.getOpposite()) // throw new LuaException("Motors cannot push or pull blocks!"); // // te.setFace(face, true); // te.setDirection(direction, true); // // return new Object[] { true }; } else if (method == 5) { return new Object[] { te.move() }; } return null; }
Example #17
Source File: ITurtleAccess.java From BigReactors with MIT License | 2 votes |
/** * Adds a custom command to the turtles command queue. Unlike peripheral methods, these custom commands will be executed * on the main thread, so are guaranteed to be able to access Minecraft objects safely, and will be queued up * with the turtles standard movement and tool commands. An issued command will return an unique integer, which will * be supplied as a parameter to a "turtle_response" event issued to the turtle after the command has completed. Look at the * lua source code for "rom/apis/turtle" for how to build a lua wrapper around this functionality. * @param command an object which will execute the custom command when its point in the queue is reached * @return the objects the command returned when executed. you should probably return these to the player * unchanged if called from a peripheral method. * @see ITurtleCommand */ public Object[] executeCommand( ILuaContext context, ITurtleCommand command ) throws LuaException, InterruptedException;
Example #18
Source File: ITurtleAccess.java From OpenPeripheral with MIT License | 2 votes |
/** * Adds a custom command to the turtles command queue. Unlike peripheral methods, these custom commands will be executed * on the main thread, so are guaranteed to be able to access Minecraft objects safely, and will be queued up * with the turtles standard movement and tool commands. An issued command will return an unique integer, which will * be supplied as a parameter to a "turtle_response" event issued to the turtle after the command has completed. Look at the * lua source code for "rom/apis/turtle" for how to build a lua wrapper around this functionality. * @param command an object which will execute the custom command when its point in the queue is reached * @return the objects the command returned when executed. you should probably return these to the player * unchanged if called from a peripheral method. * @see ITurtleCommand */ public Object[] executeCommand( ILuaContext context, ITurtleCommand command ) throws LuaException, InterruptedException;
Example #19
Source File: IPeripheral.java From OpenPeripheral with MIT License | 2 votes |
/** * This is called when a lua program on an attached computercraft calls peripheral.call() with * one of the methods exposed by getMethodNames().<br> * <br> * Be aware that this will be called from the ComputerCraft Lua thread, and must be thread-safe * when interacting with minecraft objects. * @param computer The interface to the computercraft that is making the call. Remember that multiple * computers can be attached to a peripheral at once. * @param context The context of the currently running lua thread. This can be used to wait for events * or otherwise yield. * @param method An integer identifying which of the methods from getMethodNames() the computercraft * wishes to call. The integer indicates the index into the getMethodNames() table * that corresponds to the string passed into peripheral.call() * @param arguments An array of objects, representing the arguments passed into peripheral.call().<br> * Lua values of type "string" will be represented by Object type String.<br> * Lua values of type "number" will be represented by Object type Double.<br> * Lua values of type "boolean" will be represented by Object type Boolean.<br> * Lua values of any other type will be represented by a null object.<br> * This array will be empty if no arguments are passed. * @return An array of objects, representing values you wish to return to the lua program.<br> * Integers, Doubles, Floats, Strings, Booleans and null be converted to their corresponding lua type.<br> * All other types will be converted to nil.<br> * You may return null to indicate no values should be returned. * @throws Exception If you throw any exception from this function, a lua error will be raised with the * same message as your exception. Use this to throw appropriate errors if the wrong * arguments are supplied to your method. * @see #getMethodNames */ public Object[] callMethod( IComputerAccess computer, ILuaContext context, int method, Object[] arguments ) throws LuaException, InterruptedException;
Example #20
Source File: IPeripheral.java From BigReactors with MIT License | 2 votes |
/** * This is called when a lua program on an attached computercraft calls peripheral.call() with * one of the methods exposed by getMethodNames().<br> * <br> * Be aware that this will be called from the ComputerCraft Lua thread, and must be thread-safe * when interacting with minecraft objects. * @param computer The interface to the computercraft that is making the call. Remember that multiple * computers can be attached to a peripheral at once. * @param context The context of the currently running lua thread. This can be used to wait for events * or otherwise yield. * @param method An integer identifying which of the methods from getMethodNames() the computercraft * wishes to call. The integer indicates the index into the getMethodNames() table * that corresponds to the string passed into peripheral.call() * @param arguments An array of objects, representing the arguments passed into peripheral.call().<br> * Lua values of type "string" will be represented by Object type String.<br> * Lua values of type "number" will be represented by Object type Double.<br> * Lua values of type "boolean" will be represented by Object type Boolean.<br> * Lua values of any other type will be represented by a null object.<br> * This array will be empty if no arguments are passed. * @return An array of objects, representing values you wish to return to the lua program.<br> * Integers, Doubles, Floats, Strings, Booleans and null be converted to their corresponding lua type.<br> * All other types will be converted to nil.<br> * You may return null to indicate no values should be returned. * @throws Exception If you throw any exception from this function, a lua error will be raised with the * same message as your exception. Use this to throw appropriate errors if the wrong * arguments are supplied to your method. * @see #getMethodNames */ public Object[] callMethod( IComputerAccess computer, ILuaContext context, int method, Object[] arguments ) throws LuaException, InterruptedException;
Example #21
Source File: ITurtleAccess.java From OpenPeripheral-Integration with MIT License | 2 votes |
/** * Adds a custom command to the turtles command queue. Unlike peripheral methods, these custom commands will be executed * on the main thread, so are guaranteed to be able to access Minecraft objects safely, and will be queued up * with the turtles standard movement and tool commands. An issued command will return an unique integer, which will * be supplied as a parameter to a "turtle_response" event issued to the turtle after the command has completed. Look at the * lua source code for "rom/apis/turtle" for how to build a lua wrapper around this functionality. * @param command an object which will execute the custom command when its point in the queue is reached * @return the objects the command returned when executed. you should probably return these to the player * unchanged if called from a peripheral method. * @see ITurtleCommand */ public Object[] executeCommand( ILuaContext context, ITurtleCommand command ) throws LuaException, InterruptedException;
Example #22
Source File: IPeripheral.java From OpenPeripheral-Addons with MIT License | 2 votes |
/** * This is called when a lua program on an attached computercraft calls peripheral.call() with * one of the methods exposed by getMethodNames().<br> * <br> * Be aware that this will be called from the ComputerCraft Lua thread, and must be thread-safe * when interacting with minecraft objects. * @param computer The interface to the computercraft that is making the call. Remember that multiple * computers can be attached to a peripheral at once. * @param context The context of the currently running lua thread. This can be used to wait for events * or otherwise yield. * @param method An integer identifying which of the methods from getMethodNames() the computercraft * wishes to call. The integer indicates the index into the getMethodNames() table * that corresponds to the string passed into peripheral.call() * @param arguments An array of objects, representing the arguments passed into peripheral.call().<br> * Lua values of type "string" will be represented by Object type String.<br> * Lua values of type "number" will be represented by Object type Double.<br> * Lua values of type "boolean" will be represented by Object type Boolean.<br> * Lua values of any other type will be represented by a null object.<br> * This array will be empty if no arguments are passed. * @return An array of objects, representing values you wish to return to the lua program.<br> * Integers, Doubles, Floats, Strings, Booleans and null be converted to their corresponding lua type.<br> * All other types will be converted to nil.<br> * You may return null to indicate no values should be returned. * @throws Exception If you throw any exception from this function, a lua error will be raised with the * same message as your exception. Use this to throw appropriate errors if the wrong * arguments are supplied to your method. * @see #getMethodNames */ public Object[] callMethod( IComputerAccess computer, ILuaContext context, int method, Object[] arguments ) throws LuaException, InterruptedException;
Example #23
Source File: ITurtleAccess.java From OpenPeripheral-Addons with MIT License | 2 votes |
/** * Adds a custom command to the turtles command queue. Unlike peripheral methods, these custom commands will be executed * on the main thread, so are guaranteed to be able to access Minecraft objects safely, and will be queued up * with the turtles standard movement and tool commands. An issued command will return an unique integer, which will * be supplied as a parameter to a "turtle_response" event issued to the turtle after the command has completed. Look at the * lua source code for "rom/apis/turtle" for how to build a lua wrapper around this functionality. * @param command an object which will execute the custom command when its point in the queue is reached * @return the objects the command returned when executed. you should probably return these to the player * unchanged if called from a peripheral method. * @see ITurtleCommand */ public Object[] executeCommand( ILuaContext context, ITurtleCommand command ) throws LuaException, InterruptedException;
Example #24
Source File: IPeripheral.java From PneumaticCraft with GNU General Public License v3.0 | 2 votes |
/** * This is called when a lua program on an attached computercraft calls peripheral.call() with * one of the methods exposed by getMethodNames().<br> * <br> * Be aware that this will be called from the ComputerCraft Lua thread, and must be thread-safe * when interacting with minecraft objects. * @param computer The interface to the computercraft that is making the call. Remember that multiple * computers can be attached to a peripheral at once. * @param context The context of the currently running lua thread. This can be used to wait for events * or otherwise yield. * @param method An integer identifying which of the methods from getMethodNames() the computercraft * wishes to call. The integer indicates the index into the getMethodNames() table * that corresponds to the string passed into peripheral.call() * @param arguments An array of objects, representing the arguments passed into peripheral.call().<br> * Lua values of type "string" will be represented by Object type String.<br> * Lua values of type "number" will be represented by Object type Double.<br> * Lua values of type "boolean" will be represented by Object type Boolean.<br> * Lua values of any other type will be represented by a null object.<br> * This array will be empty if no arguments are passed. * @return An array of objects, representing values you wish to return to the lua program.<br> * Integers, Doubles, Floats, Strings, Booleans and null be converted to their corresponding lua type.<br> * All other types will be converted to nil.<br> * You may return null to indicate no values should be returned. * @throws Exception If you throw any exception from this function, a lua error will be raised with the * same message as your exception. Use this to throw appropriate errors if the wrong * arguments are supplied to your method. * @see #getMethodNames */ public Object[] callMethod( IComputerAccess computer, ILuaContext context, int method, Object[] arguments ) throws LuaException, InterruptedException;
Example #25
Source File: ITurtleAccess.java From PneumaticCraft with GNU General Public License v3.0 | 2 votes |
/** * Adds a custom command to the turtles command queue. Unlike peripheral methods, these custom commands will be executed * on the main thread, so are guaranteed to be able to access Minecraft objects safely, and will be queued up * with the turtles standard movement and tool commands. An issued command will return an unique integer, which will * be supplied as a parameter to a "turtle_response" event issued to the turtle after the command has completed. Look at the * lua source code for "rom/apis/turtle" for how to build a lua wrapper around this functionality. * @param command an object which will execute the custom command when its point in the queue is reached * @return the objects the command returned when executed. you should probably return these to the player * unchanged if called from a peripheral method. * @see ITurtleCommand */ public Object[] executeCommand( ILuaContext context, ITurtleCommand command ) throws LuaException, InterruptedException;
Example #26
Source File: IPeripheral.java From Framez with GNU General Public License v3.0 | 2 votes |
/** * This is called when a lua program on an attached computercraft calls peripheral.call() with * one of the methods exposed by getMethodNames().<br> * <br> * Be aware that this will be called from the ComputerCraft Lua thread, and must be thread-safe * when interacting with minecraft objects. * @param computer The interface to the computercraft that is making the call. Remember that multiple * computers can be attached to a peripheral at once. * @param context The context of the currently running lua thread. This can be used to wait for events * or otherwise yield. * @param method An integer identifying which of the methods from getMethodNames() the computercraft * wishes to call. The integer indicates the index into the getMethodNames() table * that corresponds to the string passed into peripheral.call() * @param arguments An array of objects, representing the arguments passed into peripheral.call().<br> * Lua values of type "string" will be represented by Object type String.<br> * Lua values of type "number" will be represented by Object type Double.<br> * Lua values of type "boolean" will be represented by Object type Boolean.<br> * Lua values of any other type will be represented by a null object.<br> * This array will be empty if no arguments are passed. * @return An array of objects, representing values you wish to return to the lua program.<br> * Integers, Doubles, Floats, Strings, Booleans and null be converted to their corresponding lua type.<br> * All other types will be converted to nil.<br> * You may return null to indicate no values should be returned. * @throws Exception If you throw any exception from this function, a lua error will be raised with the * same message as your exception. Use this to throw appropriate errors if the wrong * arguments are supplied to your method. * @see #getMethodNames */ public Object[] callMethod( IComputerAccess computer, ILuaContext context, int method, Object[] arguments ) throws LuaException, InterruptedException;
Example #27
Source File: ITurtleAccess.java From Framez with GNU General Public License v3.0 | 2 votes |
/** * Adds a custom command to the turtles command queue. Unlike peripheral methods, these custom commands will be executed * on the main thread, so are guaranteed to be able to access Minecraft objects safely, and will be queued up * with the turtles standard movement and tool commands. An issued command will return an unique integer, which will * be supplied as a parameter to a "turtle_response" event issued to the turtle after the command has completed. Look at the * lua source code for "rom/apis/turtle" for how to build a lua wrapper around this functionality. * @param command an object which will execute the custom command when its point in the queue is reached * @return the objects the command returned when executed. you should probably return these to the player * unchanged if called from a peripheral method. * @see ITurtleCommand */ public Object[] executeCommand( ILuaContext context, ITurtleCommand command ) throws LuaException, InterruptedException;
Example #28
Source File: IPeripheral.java From OpenPeripheral-Integration with MIT License | 2 votes |
/** * This is called when a lua program on an attached computercraft calls peripheral.call() with * one of the methods exposed by getMethodNames().<br> * <br> * Be aware that this will be called from the ComputerCraft Lua thread, and must be thread-safe * when interacting with minecraft objects. * @param computer The interface to the computercraft that is making the call. Remember that multiple * computers can be attached to a peripheral at once. * @param context The context of the currently running lua thread. This can be used to wait for events * or otherwise yield. * @param method An integer identifying which of the methods from getMethodNames() the computercraft * wishes to call. The integer indicates the index into the getMethodNames() table * that corresponds to the string passed into peripheral.call() * @param arguments An array of objects, representing the arguments passed into peripheral.call().<br> * Lua values of type "string" will be represented by Object type String.<br> * Lua values of type "number" will be represented by Object type Double.<br> * Lua values of type "boolean" will be represented by Object type Boolean.<br> * Lua values of any other type will be represented by a null object.<br> * This array will be empty if no arguments are passed. * @return An array of objects, representing values you wish to return to the lua program.<br> * Integers, Doubles, Floats, Strings, Booleans and null be converted to their corresponding lua type.<br> * All other types will be converted to nil.<br> * You may return null to indicate no values should be returned. * @throws Exception If you throw any exception from this function, a lua error will be raised with the * same message as your exception. Use this to throw appropriate errors if the wrong * arguments are supplied to your method. * @see #getMethodNames */ public Object[] callMethod( IComputerAccess computer, ILuaContext context, int method, Object[] arguments ) throws LuaException, InterruptedException;