This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
HPWebcamAble's profile picture

[LuaJ Question] attempt to call function

Started by HPWebcamAble, 19 February 2016 - 08:06 PM
HPWebcamAble #1
Posted 19 February 2016 - 09:06 PM
So I'm doing a thing with LuaJ.

I'm trying to get it to load a bios file, which it seems to successfully read

But when I call it (the value returned by load string)…

program.call()  //program is the value that loadstring returned
I get this:

org.luaj.vm2.LuaError: bios.lua:1: attempt to call function
WHAT?

The file I'm trying to load looks like this:

native_write(10,10,orange,white,"test")
native_write is a function that I've implemented in Java
Edited on 19 February 2016 - 08:18 PM
HPWebcamAble #2
Posted 19 February 2016 - 09:17 PM
Update:

print() and error() work as expected, seems that my custom function is causing problems.
(print outputs to the eclipse terminal)

Any ideas?
Edited on 19 February 2016 - 08:25 PM
HPWebcamAble #3
Posted 20 February 2016 - 01:58 AM
Figured it out, was totally my fault.

Solution: Use VarArgFunction