Posted 03 October 2012 - 03:38 AM
Hi,
I'm creating a new peripheral that reads an image from a URL and returns it as a list of rgb values, but I can't seem to get the peripheral method call working.
this returns "test"
public Object[] callMethod(IComputerAccess computer, int method,
Object[] arguments) throws Exception {
return new Object[] { "test" };
}
but this doesn't return an array, it only returns "4":
public Object[] callMethod(IComputerAccess computer, int method,
Object[] arguments) throws Exception {
return new Object[] { 4,3,2 };
}
Am I doing something wrong?
I also tried returning a LuaTable, but that returned 'nil' to the turtle.
I'm creating a new peripheral that reads an image from a URL and returns it as a list of rgb values, but I can't seem to get the peripheral method call working.
this returns "test"
public Object[] callMethod(IComputerAccess computer, int method,
Object[] arguments) throws Exception {
return new Object[] { "test" };
}
but this doesn't return an array, it only returns "4":
public Object[] callMethod(IComputerAccess computer, int method,
Object[] arguments) throws Exception {
return new Object[] { 4,3,2 };
}
Am I doing something wrong?
I also tried returning a LuaTable, but that returned 'nil' to the turtle.