Advertisement
Guest User

przeg

a guest
Apr 27th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.22 KB | None | 0 0
  1. -- nietypowe id wieksze niz 999
  2. local is = 4
  3. -- dynamiczny plik
  4. local h = io.open("dynpage", "w")
  5. -- nadajnik
  6. local bts = 6
  7. -- program uruchamiajacy
  8. local prog = "przeg"
  9. local menu = "true"
  10. local prog2 = "przegs"
  11. -- reszta kodu
  12. local round = 1
  13. local ln = 1
  14. shell.run("clear")
  15. term.write("Szukaj:")
  16. term.setCursorPos(1, 2)
  17. term.write("--------------------------------------------------")
  18. rednet.open("top")
  19. term.setCursorPos(8, 1)
  20. local idloc = os.getComputerID()
  21. local input = read()
  22. inputS = input
  23. local input2 = "ip=".. idloc.. input
  24. rednet.send(bts, input2)
  25. term.setCursorPos(1, 3)
  26. while true do
  27.   local event, id, txt, dis = os.pullEvent()
  28.    if event == "rednet_message" then
  29.     if txt == input2 then
  30.      else
  31.       if txt:find("ip=1") then
  32.       ln = ln + 1
  33.       txt2 = txt:sub(is+1)
  34.       h.write(ln, txt2)
  35.      end
  36.     end
  37.     round = round + 1
  38.     if ln == 15 then
  39.      h.close()    
  40.      shell.run(prog2)                                
  41.      local event1, key = os.pullEvent("key")
  42.      if key == 19 then
  43.       shell.run(prog)
  44.      end
  45.     if key == 16 and menu == "true" then
  46.      shell.run("Krzak")
  47.     end
  48.     if key == 208 then
  49.       box = box + 1
  50.    end
  51.   end
  52.  end    
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement