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

dragonlord's Goodies

Started by dragonlord, 01 November 2012 - 06:54 PM
dragonlord #1
Posted 01 November 2012 - 07:54 PM
Hi Everyone!

I've just started playing with ComputerCraft a few days ago, and it's awesome!

I've created this thread to share some of the stuff I've been working on, and I hope some of you may find these simple scripts useful.

All of my scripts need to be modified (abit) to suit your environment and setup. There's nothing much I can do about it, but it may be better for some of you than writing your own from scratch. :P/>/>

I use the Apache License for practically all my works (because it's one of the most liberal licenses). You are free to modify and distribute these under the terms stated by the license, which includes giving credit to where it's due. :P/>/>


Door Control

You have RedPower 2. You have frames. And you're sick and tired of the traditional door. But you don't want to write your own code for making a frame-based door.

Here's a simple script for controlling frames. This allows you to control two different doors, and is meant to work with a 2-block frame door with this kind of setup:



The current script allows you to control 2 doors independently, and can be run in your shell for testing.

Door Control is available here: http://pastebin.com/ZfxS6ECL


Pump Control

Let's say you have a secure area, and you ask for authentication. If they don't provide the correct credentials, you want them to die by drowning (or lava, if you like).

Well, here's a nice script for you to control 2 RedPower pumps: one for pumping liquid to a room, and another one for draining.

The script is currently tweaked to fill and drain water from a 3x3x3 room. It gets filled in less than 30 secs, and drained in about 45 secs. It takes longer to drain due to how Minecraft treats source blocks.

Pump Control is available here: http://pastebin.com/ZfxS6ECL


Airlock

You have an underwater base. You have RedPower 2. And you want to explore the depths of the ocean. But you want a cool way to enter and exit your base.

Why not make an airlock?



This whole setup uses Door Control and Pump Control, plus 2 additional scripts.

This monstrosity has 2 parts: a client and a server.

The client acts as a terminal to send open/close commands to the server. The server then validates the state of the airlock. If it's ok, it then uses the Door Control and Pump Control scripts to perform the requested action.

The client: http://pastebin.com/fuqjnmAw

The server: http://pastebin.com/04xBmtcD
gknova61 #2
Posted 07 November 2012 - 11:05 AM
Nice, you should make a video showcasing all of this!
FortuneSyn #3
Posted 08 November 2012 - 02:44 PM
Cool stuff, I'm quite curious to see how the Airlock works :P/>/>
nicolasx #4
Posted 09 November 2012 - 06:08 PM
Really cool ideas here. Have been looking for a frame door program for some time.