7 posts
Posted 28 October 2012 - 04:45 PM
Command Block Peripheral 0.0.3
This add-on will allow vanilla command blocks to interact with ComputerCraft computers.
The command block will work the same as any other peripheral.
Methods:cmd.setCommand(String newcmd)
(sets the command on the command block)cmd.runCommand()
(runs the command that is in the command block)cmd.runCommand(String cmd)
(runs the given command)cmd.getPlayers(String
targetselectors)
(returns a string that contains username(s))How target selectors work:
https://gist.github.com/3736487examples:
cmd = peripheral.wrap("left")
mon = peripheral.wrap("right")
mon.clear()
mon.write("Hello, "..cmd.getPlayers("@p").."!")
cmd = peripheral.wrap("left")
cmd.setCommand("Time set day")
cmd.runCommand()
cmd = peripheral.wrap("left")
cmd.runCommand("give @r 137")
Download:commandblockperipheral_0.0.3 (universal)
Requirements:- ComputerCraft 1.46- Minecraft Forge (compiled with Forge 6.0.1.341)Installation:Download the zip file, put it in your mods folder.
Extra information:- This mod can be used as a serverside mod and doesn't require you to have the client installed.
- This mod doesn't edit baseclasses nor does it use a block ID.
389 posts
Location
Norway
Posted 28 October 2012 - 05:19 PM
Nice work :)/>/> I really need to try this when i got time :D/>/>
992 posts
Posted 28 October 2012 - 05:39 PM
That is one hell of a first post. Downloading …
2447 posts
Posted 28 October 2012 - 07:43 PM
How did you manage this? I'm guessing reflection to add the peripheral?
7 posts
Posted 30 October 2012 - 07:54 PM
How did you manage this? I'm guessing reflection to add the peripheral?
I used reflection to manipulate the blocklist.First, the vanilla cmdblock is removed from the list, after that I add a new cmdblock with the same id which extends the vanilla cmdblock. That block has a different tileentity that again extends the vanilla cmdblock tileenty. Just implement peripheral and done…
I'm currently looking for a way to add the peripheral without manipulating the blocklist
2447 posts
Posted 30 October 2012 - 08:04 PM
That's quite a hack, but neat.
I plan on work on letting you add a peripheral to any arbitrary tile entity, and then using that system to add native CC command block support (already planned if you look in suggestions forum, so not stealing your idea :P/>/>).
7 posts
Posted 30 October 2012 - 08:43 PM
That's quite a hack, but neat.
I plan on work on letting you add a peripheral to any arbitrary tile entity, and then using that system to add native CC command block support (already planned if you look in suggestions forum, so not stealing your idea :P/>/>).
Nice, looking forward to it :D/>/> And I had no idea it was already suggested, I thought I was original :P/>/>
389 posts
Location
Norway
Posted 30 October 2012 - 10:18 PM
That's quite a hack, but neat.
I plan on work on letting you add a peripheral to any arbitrary tile entity, and then using that system to add native CC command block support (already planned if you look in suggestions forum, so not stealing your idea :P/>/>).
Nice, looking forward to it :D/>/> And I had no idea it was already suggested, I thought I was original :P/>/>
Cloudy said he was going to do it, but it didn't happend, even after i slapped him 9001 times :/
Been playing with it now though :D/>/> nice work :)/>/>
76 posts
Location
Death City
Posted 31 October 2012 - 02:03 PM
Wow, this seems incredible. I had no idea computers had the power to hook up with cmd blocks even with a peripheral. Amazing.
76 posts
Location
Death City
Posted 31 October 2012 - 02:27 PM
I just tried it out and every thing I try(I tested your examples also) just returns:
(name):(line): attempt to index ? (a nil value)
This is the program:
cmd = peripheral.wrap("right")
cmd.setCommand("time set night")
cmd.runCommand()
7 posts
Posted 31 October 2012 - 06:52 PM
I just tried it out and every thing I try(I tested your examples also) just returns:
(name):(line): attempt to index ? (a nil value)
This is the program:
cmd = peripheral.wrap("right")
cmd.setCommand("time set night")
cmd.runCommand()
hmm, I can only think of two things: you installed it wrong or there is no command block on the right
76 posts
Location
Death City
Posted 31 October 2012 - 07:55 PM
I just tried it out and every thing I try(I tested your examples also) just returns:
(name):(line): attempt to index ? (a nil value)
This is the program:
cmd = peripheral.wrap("right")
cmd.setCommand("time set night")
cmd.runCommand()
hmm, I can only think of two things: you installed it wrong or there is no command block on the right
All you need to do is put the .zip in your mods folder it would be hard to install it wrong.
7 posts
Posted 31 October 2012 - 08:35 PM
I just tried it out and every thing I try(I tested your examples also) just returns:
(name):(line): attempt to index ? (a nil value)
This is the program:
cmd = peripheral.wrap("right")
cmd.setCommand("time set night")
cmd.runCommand()
hmm, I can only think of two things: you installed it wrong or there is no command block on the right
All you need to do is put the .zip in your mods folder it would be hard to install it wrong.
I know but it wouldn't surprise me if someone failed to install it. The world is filled with stupid people :P/>/>
edit: I will check if there is something wrong on my end
7 posts
Posted 31 October 2012 - 11:40 PM
Updated it to 0.0.2
Instead of hacking into the blockslist I now hack into the TileEntityList. :P/>/>
Also allot of code clean up
11 posts
Posted 03 November 2012 - 01:05 PM
I have a security concern with this. Is anything stopping someone without mod status from placing a computer on a command block placed by an admin and using that to execute admin commands such as give?
2447 posts
Posted 03 November 2012 - 03:46 PM
I have a security concern with this. Is anything stopping someone without mod status from placing a computer on a command block placed by an admin and using that to execute admin commands such as give?
Nope - but there is also nothing stopping a non op player from accessing a placed command block themselves.
389 posts
Location
Norway
Posted 04 November 2012 - 12:40 AM
I thought you needed to be in creative mode to edit a cmd block? unless i missread the wiki :D/>/>
2447 posts
Posted 04 November 2012 - 11:38 PM
I just re-read and this does indeed appear to be the case. A solution though: keep the command block and associated computer buried under bedrock.
1 posts
Posted 08 November 2012 - 06:18 PM
Or just password protect the computer, and only ops know the password.
49 posts
Posted 13 November 2012 - 12:15 PM
Or just password protect the computer, and only ops know the password.
That's what you do. Pass-Protect the computer (either using Immibis' peripherals, or using a program that uses Floppy's.)
Will get this and try it out.
48 posts
Location
San Jose, CA
Posted 04 December 2012 - 09:16 PM
If you are able to get this to cc 1.47 and forge 6.4 for MC 1.4.5, i can guarantee you quite a few downloads ;)/> I'd need it asap though.
179 posts
Posted 13 December 2012 - 12:08 AM
I've been debating whether to update this on MiscPeripherals, but thinking about the security risks…
i want Sound Mod Enabler for 1.4.5
1243 posts
Location
Indiana, United States
Posted 13 December 2012 - 01:55 AM
I've been debating whether to update this on MiscPeripherals, but thinking about the security risks…
i want Sound Mod Enabler for 1.4.5
You keep trying to snap up old peripherals. :/
179 posts
Posted 13 December 2012 - 02:15 AM
MiscPeripherals Branded Hostile Takeovers is how I roll!
Jokes aside, I have a really nice idea for an adventuremap peripheral which shall rule them all. Only issue right now is it depends on an internal part of CC, which I'm hoping Dan will allow Cloudy to migrate to the API.
7 posts
Posted 13 December 2012 - 08:14 AM
Everyone is free to update this or add it to whatever you want :P/>
I created this for fun and because I needed it for a pvp arena project. Now that I don't need it anymore I'll probably don't bother updating it.
179 posts
Posted 13 December 2012 - 10:15 AM
Now to convince Dan to expose ILuaObject to the API.
1243 posts
Location
Indiana, United States
Posted 13 December 2012 - 01:37 PM
Now to convince Dan to expose ILuaObject to the API.
Ahem… Reflection much? :D/>
997 posts
Location
Wellington, New Zealand
Posted 13 December 2012 - 05:10 PM
Now to convince Dan to expose ILuaObject to the API.
Ahem… Reflection much? :D/>
You don't need reflection to access non-API classes, but dan doesn't like people doing it. (In Immibis's Peripherals is code for smartcards, which are mini-computers in card form, but they're disabled for that reason)
179 posts
Posted 14 December 2012 - 02:25 AM
I already mess with internals to get the modem item and render offset.
2447 posts
Posted 14 December 2012 - 09:03 AM
Wouldn't bother taking this. Already in my code - and a new developer facing API to allow you to do things like this without hacks.
And it's a matter of respect. Sure you can use stuff like that without permission, but try doing that to other mod authors and see how they feel.
Internal API's are also subject to change. I have no qualms with changing internal API's regardless of how many third party add-ons are using them.
392 posts
Location
Christchurch, New Zealand
Posted 24 January 2013 - 03:55 PM
Cloudy! There is poop below you!
Look out! halLamBeems.. what kind of Autogenerated name is that
11 posts
Posted 25 January 2013 - 04:13 PM
This won't work with CC 1.481 will it?
997 posts
Location
Wellington, New Zealand
Posted 25 January 2013 - 08:50 PM
This won't work with CC 1.481 will it?
It will if you have CC 1.481 for Minecraft 1.4.2. (which doesn't exist, by the way)
6 posts
Posted 19 November 2013 - 06:35 PM
thanks! will really help with… basically every project I have panned.
5 posts
Posted 19 January 2014 - 12:41 AM
Your download isn't working
i hope you get this up soon.
good luck.
8543 posts
Posted 19 January 2014 - 01:32 AM
ComputerCraft has a built-in peripheral interface for use with Command Blocks. Enable it in the config. I'm going to lock this topic.