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

getting a turtle to activate on redstone

Started by makeme, 30 May 2013 - 03:20 PM
makeme #1
Posted 30 May 2013 - 05:20 PM
so ive got this program automating one of my machines but i only want it to activate on redstone in how would i do this?

while true do 
turtle.attack()
sleep(0.01)
end
Bubba #2
Posted 30 May 2013 - 06:19 PM
Look on the wiki for os.pullEvent and check out the redstone event (it's located under "event types", but you should read the whole page to become more familiar os.pullEvent). See if you can figure something out. If not, come back with what you've tried and I (or someone else) can help you out some more.
popdog15 #3
Posted 30 May 2013 - 10:19 PM

local event = os.pullEvent()
if event == "redstone" and redstone.getInput(*side*, true) then
--code here
end