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

Print To Server Console

Started by Choonster, 30 September 2014 - 11:38 AM
Choonster #1
Posted 30 September 2014 - 01:38 PM
Is there any way to print some text to the server console from a computer?

I wanted to write a program that periodically printed the number of Octuple Compressed Cobblestone in my AE system (I know how to get this number) to the server console (the server is constantly running on my computer, the client usually isn't); but I haven't found any way to do this.

I'm using ComputerCraft 1.63 with OpenPeripherals (Core and Addons) if it matters.
Anavrins #2
Posted 30 September 2014 - 03:53 PM
It's impossible to print to the console for obvious reasons.
A workaround for this could be to use the http api and POST the values to some sort of php script that show the values when accessed with a browser.

Edit: I totally forgot about command blocks for some reasons…
Edited on 30 September 2014 - 02:16 PM
Inumel #3
Posted 30 September 2014 - 04:07 PM
You can do this if you use the command block API, but it has to be enabled in the CC config, and command blocks must be enabled on the server

Info on the api is here http://computercraft.info/wiki/Command_Block_(API)

using the /say command should do what you want it to
Choonster #4
Posted 01 October 2014 - 01:27 AM
Thanks, I'll look into the Command Block API.
Choonster #5
Posted 01 October 2014 - 06:43 AM
I'm actually going to attempt to create my own peripheral that can send chat messages just for the sake of doing something new and interesting.

If that doesn't work out, I'll probably fall back on Command Blocks.
theoriginalbit #6
Posted 01 October 2014 - 08:34 AM
I'm actually going to attempt to create my own peripheral that can send chat messages just for the sake of doing something new and interesting.
not really something new, MiscPeripherals, Computronics, and MoarPeripherals all have Chat Box peripherals which do exactly that.
Choonster #7
Posted 01 October 2014 - 09:20 AM
not really something new, MiscPeripherals, Computronics, and MoarPeripherals all have Chat Box peripherals which do exactly that.

I meant new to me rather than a completely new concept (I'm sure people have wanted to send chat messages from computers before). I've never worked with CC's API before.
Edited on 01 October 2014 - 07:24 AM