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

Redstone Input?

Started by Bennievv, 26 February 2012 - 01:56 PM
Bennievv #1
Posted 26 February 2012 - 02:56 PM
Hi!

I wanted my computer tells my when the redstone is turned on, or not. So I typed this code:

if redstone.input("front") == true then
print("Yeah!")
elseif redstone.input("front") == false then
print("No...")
end
And when I run it I get the error:

file:1: attempt to call nil
This means that "redstone.input()" don't exist… What is the correct function?

;)/>/>
Bennievv
Casper7526 #2
Posted 26 February 2012 - 03:05 PM
redstone.getInput
Bennievv #3
Posted 26 February 2012 - 03:18 PM
Oh, thanks!
Espen #4
Posted 26 February 2012 - 03:41 PM
Also if you want to learn what other api functions there are then use the 'help' command.
'help redstone' for all the redstone functions.
'help apis' to see what other APIs there are.
Bennievv #5
Posted 26 February 2012 - 03:43 PM
Okay!
I gonna use it. Thanks all!