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

Need help

Started by Drazlak, 15 November 2014 - 05:34 AM
Drazlak #1
Posted 15 November 2014 - 06:34 AM
I don't know how to code what so ever and im trying to make a redstone activated computer to put a message on a monitor
I know how do print("Hello World") and thats it
KingofGamesYami #2
Posted 15 November 2014 - 10:36 PM
Here's some resources:
rs,getInputI
term.redirect
peripheral.wrap
redstone event
Loops, if, else, etc.

Here's some example code:


local mon = peripheral.wrap( "side" ) --#change side to where the monitor is located
term.redirect( mon ) --#redirect the terminal
print( "This should appear on the monitor" ) --#this line isn't really necessary, it's just there to help
while true do --#start infinite loop
  os.pullEvent( "redstone" ) --#wait for a change in the redstone state
  if rs.getInput( "side" ) then --#change side to where the redstone is connected
    print( "Your message" )
  end
end --#end infinite loop