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

Redstone Input

Started by kevin687, 22 January 2013 - 03:17 AM
kevin687 #1
Posted 22 January 2013 - 04:17 AM
I want to make a game.
when someone pull a lever the signal wil go to the computer and the screen will say capture point
and when its not pulled it will say nothing
but how???
DrLancer #2
Posted 22 January 2013 - 05:05 AM
I want to make a game.
when someone pull a lever the signal wil go to the computer and the screen will say capture point
and when its not pulled it will say nothing
but how???

This should be moved to the Ask a Pro section.
– But read up on the wiki about redstone.getInput() and os.pullEvent()
Lyqyd #3
Posted 22 January 2013 - 07:03 AM
Moved to Ask a Pro.
ChunLing #4
Posted 22 January 2013 - 08:41 AM
while true do
  os.pullEvent("redstone")
  term.clear()
  if rs.getInput("right") then
    print("Capture Point!")
  end
end
Super basic, if a redstone change happens, clear the screen and check for redstone input on the right side of the computer. If so, print("Capture Point!").
kevin687 #5
Posted 26 January 2013 - 11:42 PM
Thanks
kevin687 #6
Posted 26 January 2013 - 11:49 PM
It work thanks :D/>