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

[1.48] Additions to the Command Block peripheral

Started by pulse_daemon, 26 December 2012 - 04:35 PM
pulse_daemon #1
Posted 26 December 2012 - 05:35 PM
With the addition of computers being able to use command blocks, Computercraft magically more powerful(magic=dev power!). Unfortunately, the command block is not a peripheral by default. It is true that with a computer, any player can control a command block. I suggest that a password option be added to the config file. Another possibility would be to white-list certain computers. Both of my suggested solutions are vulnerable; it isn't hard to share a password and computers can get stolen. If someone has another idea, please share it. Bedrock casing will have to do for now.

My second suggestion is to make runCommand return a string correspond to the message returned by the server. Here is an example:

>cmdBlock=peripheral.wrap("front")
>cmdBlock.setCommand("give @p 1")
>result=cmdblock.runCommand()
>print(result)
Given Stone (ID 1) x 1 to Pulse Daemon
This would give new uses to the command block. Possible uses are: obtaining a list of currently logged in players, authenticating a player (say @p[r=2]), checking if a user is logged in, getting a count of users in an area (split a group into two random equal teams). I'm sure there are more applications but those are the ones that come immediately to my mind. I'm not sure how this could be implemented and how difficult it would be, but it would make a great addition to CC.

Post-scriptum: I know griefers have always been able to use CC to their advantage but the command block could be particularly destructive. The griefer can easily get any desired item, switch game modes, teleport anyone anywhere, change game rules and clear the inventory of all players.
I was suffering from a little paranoia. I just have to remember… bedrock!
lieudusty #2
Posted 26 December 2012 - 06:49 PM
Theres a peripheral for this.. Although outdated, theres a peripheral for this.
immibis #3
Posted 26 December 2012 - 08:19 PM
First suggestion: What is wrong with bedrock casing? It's completely unbreakable unless someone has creative (at which point they've already haxed your server) whereas your proposed solutions only give false security.
Second suggestion: Good idea.
pulse_daemon #4
Posted 28 December 2012 - 09:41 AM
@immibis Yeah, I'll agree with you on thay one. I was half-asleep when writing the first suggestion. I was thinking of some sort of banking system and security was all I was thinking about. Bedrock ftw!

@lieudusty I haven't yet searched for the peripheral. I do think it would be nifty if this was implemented in CC.
Xfel #5
Posted 28 December 2012 - 10:04 PM
I think command replies are currently logged back as events, aren't they?
Cloudy #6
Posted 28 December 2012 - 11:59 PM
I think command replies are currently logged back as events, aren't they?

Nope! Something I will look into though.
TheArchitect #7
Posted 01 February 2013 - 04:58 PM
I was looking for something like this. What's the peripheral for that again, lieudusty?

I came here thinking of suggesting a "command computer" instead, which would be a hybrid and act like an elaborate programmable command block (which might be only spawnable by OPs with /give, like the command block). It would allow very complex setups.