Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local f=fs.open("/C/system/RAM/user","r")
- user=f.readLine()
- f.close()
- local f=fs.open("/LANconfig","r")
- server=f.readLine()
- f.close()
- idPC = os.getComputerID()
- local modem = peripheral.wrap('top')
- function odeslat()
- modem.transmit(tonumber(adresat),1,soubor)
- print("odeslan nazev")
- modem.transmit(tonumber(adresat),2,obsah)
- print("odeslan obsah")
- modem.transmit(tonumber(adresat),3,idPC)
- print("odeslano ID")
- modem.transmit(tonumber(adresat),4,user)
- print("odeslan uzivatel")
- end
- function cist()
- local data = fs.open(soubor, "r")
- obsah = data.readAll()
- data.close()
- odeslat()
- end
- function start()
- term.clear()
- term.setCursorPos(1,1)
- write "soubor: "
- soubor = read()
- write "adresat [ID]: "
- adresat = read()
- if adresat == nil then
- print("musi byt cislo")
- sleep(1)
- start()
- end
- if fs.exists(soubor) then
- cist()
- elseif fs.exists(soubor..".lua") then
- soubor = soubor..".lua"
- print ("soubor zmenen na: "..soubor)
- cist()
- else
- write("Error")
- sleep(1)
- start()
- end
- end
- start ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement