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

Need help with my program

Question

I am trying to make a program that will output a redstone signal to a light grey cable (from project red) so i can get enhanced portals 3 to activate a portal, but i can't get the redstone to work and i prefer using the computer. (uploading screenshots wouldn't work)

 

error:

 

/home/initialization:4: attempt to index field 'redstone' (a nil value):

stack traceback:

            /home/initialization:4: in main chunk

            [C]: in function 'xpcall'

            machine:751: in function 'xpcall'

             /lib/process.lua:78: in function </lib/process.lua:71>

stack traceback:

             [C]: in function 'error'

             /lib/process.lua:92: in function </libprocess.lua:71>

 

 

 

the code:

 

local component = require ("component")

local component = require ("sides")

 

component.redstone.setOutput(sides.back, colors.lightGrey, 16)

print("Event Initialized")

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

well you assigned the component to the correct thing to start then you reassigned it to the sides api.  

 

Try this instead, also put the code into the code quotes. there is a button  for  it that looks like this <> it makes code stand out like code.


local component = require "component"
local sides = require "sides"
local color = require "color"

--for fun lets use a variable for the Redstone card too

local redstone = component.redstone

--oh and you need to use setBundledOutput from the tier 2 card

redstone.setBundledOutput(sides.back, color.lightGrey, 16)

print("Event Initialized")

Bear in mind, I didn't test any of this so it might not work, but it addresses the obvious issues.  Best of luck doing the thing

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
Answer this question...

×   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.