Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sisomm
Created December 30, 2013 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sisomm/8187010 to your computer and use it in GitHub Desktop.
Save sisomm/8187010 to your computer and use it in GitHub Desktop.
Send text from computercraft
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