Jump to content




CommandBlock API don't working?


  • You cannot reply to this topic
6 replies to this topic

#1 Konlab

  • Members
  • 595 posts
  • LocationKerbin

Posted 27 May 2014 - 12: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

#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 27 May 2014 - 02: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")


#3 Konlab

  • Members
  • 595 posts
  • LocationKerbin

Posted 27 May 2014 - 02:45 PM

The error is in the 2. Line

#4 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 27 May 2014 - 04: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.

#5 valithor

  • Members
  • 1,053 posts

Posted 27 May 2014 - 04: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.

#6 vifino

  • Members
  • 7 posts
  • LocationEarth

Posted 27 May 2014 - 05:01 PM

Just do what he said...
It should work, make sure you got the sides right.

#7 Konlab

  • Members
  • 595 posts
  • LocationKerbin

Posted 28 May 2014 - 10:28 AM

View Posttheoriginalbit, on 27 May 2014 - 02:37 PM, said:

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'





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users