Advertisement
Birog

PIN PW

Apr 1st, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.61 KB | None | 0 0
  1. function clear()
  2.         term.clear()
  3.         term.setCursorPos(1,1)
  4. end
  5. print( "Copyright by Birog" )
  6. write( "Es wird nach Updates gesucht... " )
  7. local response = http.get("http://pastebin.com/raw.php?i=UjZKc57G")    
  8. if response then
  9.    print("Update-suche erfolgreich!")
  10.    local sSource = response.readAll()
  11.    response.close()
  12.    local file = fs.open( "startup", "r" )
  13.    local sTarget = ""    
  14.    if file then
  15.           sTarget = file.readAll()
  16.           file.close()
  17.    end  
  18.    if sSource ~= sTarget then
  19.           term.write("Updates gefunden!")
  20.           file = fs.open( "startup", "w" )
  21.           file.write( sSource )
  22.           file.close()
  23.           print( "Wurde herruntergeladen als - startup - -Datei")
  24.           print("Programm wird Neugestartet!")
  25.           shell.run("startup")
  26.           return  
  27.    else
  28.           print("Es sind keine Updates vorhanden!")
  29.           print("Programm wird gestartet!")
  30.           sleep(3)
  31.           clear()
  32.    end
  33. else
  34.    clear()
  35.    print("ERROR! Informiere bitte Birog!!")
  36.    clear()
  37. end
  38. ---------------------------------------------------------------------------------------------------------------------
  39. rednet.open("left")
  40. sleep(1)
  41. pw=261076
  42. while true do
  43.  y,x,z = rednet.receive()
  44.  if y == 28 or 34 then
  45.   zugang=(pw-x)
  46.   if zugang == 0 then
  47.    redstone.setOutput("top",true)
  48.    rs.setOutput("right",true)
  49.    sleep(10)
  50.    rs.setOutput("top",false)
  51.    rs.setOutput("right",false)
  52.    rednet.send(y,"OK")
  53.    print("ok")
  54.   else
  55.    rednet.send(y,"FALSCH")
  56.    print("fail")
  57.   end
  58.  else
  59.    rednet.send(y,"FALSCH")
  60.    print("fail")
  61.  end
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement