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

Using computers as command blocks

Started by jacob.schooley, 12 January 2013 - 07:31 AM
jacob.schooley #1
Posted 12 January 2013 - 08:31 AM
Is there a way to make a computer perform command block functions, like saying something in the chatbox or giving a player an item, without connecting command blocks through redstone?


Thanks 😃😃😃
OmegaVest #2
Posted 12 January 2013 - 08:36 AM
Not on their own. I think they can wrap command blocks as peripherals, but I'm not sure because I don't really use them.
Aichan #3
Posted 12 January 2013 - 08:40 AM
OmegaVest is right, you need to use redstone
KaoS #4
Posted 12 January 2013 - 08:44 AM
here is an example of how to use it to teleport the nearest player to 0, 300, 0. place the command block against the back of the computer and run the code


local cmdb=peripheral.wrap("back")
cmdb.setCommand("tp @p 0 300 0")
cmdb.runCommand()
jacob.schooley #5
Posted 12 January 2013 - 09:05 AM
here is an example of how to use it to teleport the nearest player to 0, 300, 0. place the command block against the back of the computer and run the code


local cmdb=peripheral.wrap("back")
cmdb.setCommand("tp @p 0 300 0")
cmdb.runCommand()

Can you confirm that it works?
KaoS #6
Posted 12 January 2013 - 09:21 AM
yep, tested and functional
try #7
Posted 19 January 2013 - 05:34 PM
Why can't I access Command Blocks?
Is there additional configuration, plug-ins, etc, required?

I am using:
Minecraft 1.47
MCForge minecraftforge-universal-1.4.7-6.6.0.497.zip
CCcraft 1.481
…and nothing else.

I have a Command Block attached onto each of the computer's six sides.
But the computer refuses to recognize them.
———————————————————-
allsides = redstone.getSides()
for k,side in ipairs(allsides) do
touchable = peripheral.isPresent(side)
print("peripheral on ",side,"? ",touchable)
end
——————————————————–


peripheral on top? false
peripheral on bottom? false
peripheral on front? false
peripheral on back? false
peripheral on left? false
peripheral on right? false


——————————————————–
According to my system, CommandBlocks aren't seen by CCcraft.




Likewise, your code

local cmdb=peripheral.wrap("back")
cmdb.setCommand("tp @p 0 300 0")
cmdb.runCommand()

gives error
attempt to index ? (a nil value) –again it says bock is nonexistent.


Why doesn't the command-block work like a peripheral for me?

Thanks
theoriginalbit #8
Posted 19 January 2013 - 06:26 PM
in the ComputerCraft config file there is a boolean you have to set to true to use the command blocks as a peripheral…
Andale #9
Posted 23 January 2013 - 03:46 PM
I'm a little disappointed. I was looking forward to a bank of command blocks and wires.