MagmaLP

Farme-Doors mit OPD

Feb 6th, 2021 (edited)
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Datei erstellen namens v und 1.0 reinschreiben
  2. -- Rechter Output: Frame-Door nach unten
  3. -- Linker Output: Frame-Door nach oben
  4. -- OPD oben auf den PC
  5. -- Online  = inhalt 1
  6. -- Offline = inhalt 0
  7.  
  8. while true do
  9. file = fs.open("v", "r")
  10. inhalt = file.readLine()
  11. file.close()
  12.  
  13.   if inhalt == "1.0" then
  14.     if rs.getInput("top") then
  15.       for i = 1, 5, 1 do
  16.         rs.setOutput("right",true)
  17.         sleep(0.5)
  18.         rs.setOutput("right",false)
  19.         sleep(0.5)
  20.       end  
  21.       local file = fs.open("v", "w")
  22.       file.write(0)
  23.       file.close()
  24.     end
  25.   end
  26.  
  27.   if inhalt == "0.0" then
  28.     if not rs.getInput("top") then
  29.       for i = 1, 5, 1 do
  30.         rs.setOutput("left",true)
  31.         sleep(0.5)
  32.         rs.setOutput("left",false)
  33.         sleep(0.5)
  34.       end
  35.       local file = fs.open("v", "w")
  36.       file.write(1)
  37.       file.close()
  38.     end
  39.   end
  40.   sleep(0.5)
  41. end
  42.  
Advertisement
Add Comment
Please, Sign In to add comment