Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Aether

Simple Redstone Control Example

Recommended Posts

local component = require("component")
local upright = component.proxy("ced03056-f8ea-432b-94c0-a89b9d1b3336")--Change the addresses to match with your Redstone I/O's
local upleft = component.proxy("182fc96d-d245-4bed-a69c-71469b286418")--
local downright = component.proxy("3d65cc84-e08d-4d32-9c65-b9c9aba60a18")
local downleft = component.proxy("fc7ebe48-702b-4e1e-9911-5c09c602588c")
local downright2= component.proxy("1a760530-540e-438a-8cc5-803c75a5767e")
local downleft2= component.proxy("9de1f13e-4347-408a-bb0a-46f7b2241a15")


function close()
	downleft.setOutput(1,15)
	downleft.setOutput(3,15)
	downright.setOutput(1,15)
	downright.setOutput(3,15)
	os.sleep(2)
	upleft.setOutput(5,15)
	upright.setOutput(4,15)
end

function open()
	upleft.setOutput(5,0)
	upright.setOutput(4,0)
	os.sleep(2)
	downleft.setOutput(3,0)
	downleft.setOutput(1,0)
	downright.setOutput(3,0)
	downright.setOutput(1,0)
	os.sleep(2)
	downleft2.setOutput(4,15)
	downright2.setOutput(5,15)
	downleft2.setOutput(4,0)
	downright2.setOutput(5,0)
end

Let me know what do you think about it

I just started learning lua like four days ago when I discovered this mod. I know a bit of C and C++. I've been able to do amazing this and I just fall in love with this mod.  

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.