3 posts
Posted 15 February 2015 - 09:11 PM
Okay so i have this command
redstone.setOutput("right", true)
os.sleep(1)
redstone.setOutput("right", false)
how do i repeat this?
570 posts
Posted 15 February 2015 - 10:03 PM
Judging by the title I assume you want repeat/until to be used for this?
local myVar = false
repeat
rs.setOutput("right", true)
os.sleep(1)
rs.setOutput("right", false)
until myVar
This will repeat until you set 'myVar' to true. If you don't want it to stop you can just do this:
repeat
--# ...
until false
7083 posts
Location
Tasmania (AU)
Posted 15 February 2015 - 10:04 PM
See
this guide for more info.
Bear in mind you probably don't want to turn redstone back on within the instant you turn it off. Consider using a second sleep call.
3 posts
Posted 15 February 2015 - 10:06 PM
Okay another question how do i paste it to my computer when ever i do it just gives me
local myVar = fals
3057 posts
Location
United States of America
Posted 16 February 2015 - 05:18 PM
Pastebin is commonly used to place code on computers, another way is to find the file on your actual computer and paste the code there. It should be located in your world folder, under computers, under the folder that is the id of the computer you wish to put it on.
3 posts
Posted 16 February 2015 - 05:34 PM
also another question how do i clear monitor text i got this
redstone.setOutput("left", true)
os.sleep(1)
os.sleep(1)
redstone.setOutput("left", false)
local monitor = peripheral.wrap("top")
monitor.write("opened door")
how do i clear the text that i wrote?
3057 posts
Location
United States of America
Posted 16 February 2015 - 06:10 PM
monitor.clear()