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

Command Computers Teleport/tp command

Started by valithor, 22 February 2015 - 07:07 AM
valithor #1
Posted 22 February 2015 - 08:07 AM
Seeing as I just updated the lualand server to CC 1.7 I wanted to try out Command Computers, but I have run into a problem. When trying to use the /tp command in command computers (this command works in command blocks) the command is failing. From what I can tell it is only accepting the first argument that I pass to the command and ignoring the other ones.

Example of what I am doing
commands.exec("tp valithor2 5 5 5")

As far as I understand this should work, but I might be missing something.

I also found something that I found interesting when playing around with tell raw. Hopefully someone can explain what is going on.

commands.exec("tellraw valithor2 hi") -- this works
commands.exec("tellraw valithor2 hi hi") -- this does not work
commands.exec("tellraw valithor2 'hi hi'") -- but this works

Unfortunately doing this with the tp command does not work.
MKlegoman357 #2
Posted 22 February 2015 - 08:37 AM
The 'tp' example works for me. And about 'tellraw', looks like it cannot handle more than two arguments.

Pro-tip: if there is a command that fails in Command Computer try to run it in chat, most likely you've got the arguments wrong and running it in chat will give you the error message.

You can also use commands.<command> for short:


commands.tp("MKlegoman357", 5, 5, 5)

commands.tellraw("valithor2", { text = "Formatting message!", bold = true, underlined = true})
valithor #3
Posted 22 February 2015 - 08:47 AM
The 'tp' example works for me. And about 'tellraw', looks like it cannot handle more than two arguments.

Pro-tip: if there is a command that fails in Command Computer try to run it in chat, most likely you've got the arguments wrong and running it in chat will give you the error message.

You can also use commands.<command> for short:


commands.tp("MKlegoman357", 5, 5, 5)

commands.tellraw("valithor2", { text = "Formatting message!", bold = true, underlined = true})

it appears it is because I am running it on a server, that has a plugin that overrides the default /tp command. Runnign that exact command does not work unfortunately.

Btw you can only use commands.<command> for certain commands it does not work for tp.

Edit:

To see the commands that work with commands.<command> type "commands" when you first start a computer and it will give you a list. Otherwise you could do commands.list()
Edited on 22 February 2015 - 07:56 AM
MKlegoman357 #4
Posted 22 February 2015 - 08:55 AM
Btw you can only use commands.<command> for certain commands it does not work for tp.

Well, it worked for me. You can do commands.<command> with every command found in commands.list. It may have been because of your overridden tp command.
valithor #5
Posted 22 February 2015 - 08:58 AM
Btw you can only use commands.<command> for certain commands it does not work for tp.

Well, it worked for me. You can do commands.<command> with every command found in commands.list. It may have been because of your overridden tp command.

Interesting I must have missed it or something, but yea it says attempt to call nil when I try to use it. Guess command computers are not completely compatiable with cauldron.

Thanks anyway.
Edited on 22 February 2015 - 07:58 AM
Bomb Bloke #6
Posted 22 February 2015 - 09:10 AM
The idea is that one function should be generated for each command ComputerCraft can detect. Odds are you're not seeing commands.tp() specifically because of that plugin you mentioned - CC knows its blocked and so doesn't offer it.

Though oddly enough, commands.list() does mention a "help" command, but there's no commands.help() function. It'll also be interesting when CC becomes available for MC 1.8, which offers a "list" command!
rik_mclightning1 #7
Posted 31 March 2015 - 07:48 AM
The idea is that one function should be generated for each command ComputerCraft can detect. Odds are you're not seeing commands.tp() specifically because of that plugin you mentioned - CC knows its blocked and so doesn't offer it.

Though oddly enough, commands.list() does mention a "help" command, but there's no commands.help() function. It'll also be interesting when CC becomes available for MC 1.8, which offers a "list" command!

Why is everyone so interested in /list? /execute, clone, fill, @e selectors and other things are much more useful in my opinion. I'm going to work on some cool projects when those come out :)/>
ItsRodrick #8
Posted 31 March 2015 - 04:33 PM
I haven't tested, but does command.exec("minecraft:tp player x y z") work? It should call the Minecraft tp, and not the essencials one (or the plugin who's overwriting /tp)
Edited on 31 March 2015 - 02:34 PM