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

[Solved] Functions in functions reading other function's parentheses.

Started by MrFastZombie, 11 November 2014 - 10:47 PM
MrFastZombie #1
Posted 11 November 2014 - 11:47 PM
I am working on a project, and I've run into an issue with my functions. It seems that one of the functions in

p.setBundledOutput(colors.combine(p.getBundledOutput()colors.white))
reads another functions parentheses. I've tried using [] in place of the () and that doesn't seem to work at all. Any ideas?

Full code


API used (Probably not important for this)
Edited on 12 November 2014 - 12:02 AM
theoriginalbit #2
Posted 11 November 2014 - 11:52 PM
It is always a good idea to post the error that you're getting. but based on that code, I'm going to assume that you're getting an 'expected )' error.

This is because you're missing the comma in colours combine between p.getBundledOutput and colors.white
MrFastZombie #3
Posted 11 November 2014 - 11:56 PM
It is always a good idea to post the error that you're getting. but based on that code, I'm going to assume that you're getting an 'expected )' error.

This is because you're missing the comma in colours combine between p.getBundledOutput and colors.white

Yep, that seems to have got it reading correctly. Sorry about that, I am pretty new to LUA.

Now I am getting colors:30:too few arguments however.
valithor #4
Posted 11 November 2014 - 11:59 PM
It is always a good idea to post the error that you're getting. but based on that code, I'm going to assume that you're getting an 'expected )' error.

This is because you're missing the comma in colours combine between p.getBundledOutput and colors.white

Yep, that seems to have got it reading correctly. Sorry about that, I am pretty new to LUA.

Now I am getting colors:30:too few arguments however.

I am pretty sure that you need to pass a side argument to p.getBundledOutput() like this p.getBundledOutput("right")
MrFastZombie #5
Posted 12 November 2014 - 12:04 AM
It is always a good idea to post the error that you're getting. but based on that code, I'm going to assume that you're getting an 'expected )' error.

This is because you're missing the comma in colours combine between p.getBundledOutput and colors.white

Yep, that seems to have got it reading correctly. Sorry about that, I am pretty new to LUA.

Now I am getting colors:30:too few arguments however.

I am pretty sure that you need to pass a side argument to p.getBundledOutput() like this p.getBundledOutput("right")

Yes that is what I had to do. Now the project is finished. Thanks to both of you!