whats the difference and how can I use it to make my code more effective at what I want the computer to do?
redstone.getInput vs os.pullEvent()
Started by LostContact, Jul 09 2013 08:40 PM
3 replies to this topic
#1
Posted 09 July 2013 - 08:40 PM
#2
Posted 09 July 2013 - 10:27 PM
Split into new topic.
One checks the current state of a redstone input, the other waits for an event to occur.
One checks the current state of a redstone input, the other waits for an event to occur.
#3
Posted 09 July 2013 - 11:02 PM
while true do
os.pullEvent("redstone")
if rs.getInput("side")==true then
-- do stuff
else
-- do stuff
end
end
do something like that
#4
Posted 10 July 2013 - 12:37 AM
PixelToast, on 09 July 2013 - 11:02 PM, said:
while true do
os.pullEvent("redstone")
if rs.getInput("side")==true then
-- do stuff
else
-- do stuff
end
end
do something like that
Quick pet peeve, doing
if x == true then
is pointless. If the value already is true, why resolve it to true? The only thing this accomplishes is making sure x is a boolean and it's equal to true.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











