Created
December 30, 2013 19:42
-
-
Save sisomm/8187010 to your computer and use it in GitHub Desktop.
Send text from computercraft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filehandle=fs.open("commands.txt","w") or error("Cannot open file ", 2) | |
while true do | |
os.sleep(0.1) | |
h = redstone.getAnalogInput("front") | |
if h>0 then | |
filehandle.writeLine("Down"); | |
else | |
filehandle.writeLine("Up"); | |
end | |
filehandle.flush(); | |
end | |
-- can never close the file, but hate to leave it like this... | |
filehandle.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment