779 posts
Location
Kerbin
Posted 27 May 2014 - 01:28 PM
Hi!
I created a program, that changes the commandBlock's command.
I enabled CommandBlock in config file, and this is the code:
comm = peripheral.wrap("right")
comm.setCommand("/give Konlab 1 64")
the error is: test:2:attempt to call index
7508 posts
Location
Australia
Posted 27 May 2014 - 03:37 PM
that seems to me like there isn't a command block on the right of the computer when you're looking at the front of the computer… open up the Lua prompt and tell us what this code outputs?
peripheral.getType("right")
779 posts
Location
Kerbin
Posted 27 May 2014 - 03:45 PM
The error is in the 2. Line
8543 posts
Posted 27 May 2014 - 05:30 PM
Did you try what he said? He's right about what the problem looks like, so it would be helpful for you to follow the advice given and report back with the results. You asked for help, help is being given. Don't dismiss it because you think he's wrong; if you knew what the problem was, you wouldn't need help.
1023 posts
Posted 27 May 2014 - 05:42 PM
It gives the same error if command blocks are not enabled in the computercraft.config to be used as a peripheral in a server, which is where i expect he is attempting to do this.
10 posts
Location
Earth
Posted 27 May 2014 - 06:01 PM
Just do what he said…
It should work, make sure you got the sides right.
779 posts
Location
Kerbin
Posted 28 May 2014 - 11:28 AM
that seems to me like there isn't a command block on the right of the computer when you're looking at the front of the computer… open up the Lua prompt and tell us what this code outputs?
peripheral.getType("right")
Its 'command'