Advertisement
maxsar

proxy for watch

Dec 24th, 2020
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. portIn = 420
  2. portOut = 666
  3.  
  4.  
  5. --netOut.transmit(portOut, portOut,textutils.serialize(v2))
  6. netIn = peripheral.wrap("right")
  7. netOut = peripheral.wrap("left")
  8.  
  9. print("Wszystko ok! \nport:" ..tostring(portIn))
  10. netIn.open(portIn)
  11.  
  12.  
  13.  
  14. send = ""
  15. while true do
  16. event, side, port1, port2, msg = os.pullEvent( "modem_message" )
  17. i = 0
  18. licz = 0
  19. for i1, v1 in pairs(msg) do
  20. if v1.name == "minecraft:air" then
  21. send = send .."|" .."0" .."," ..v1.x .."," ..v1.y .."," ..v1.z
  22. elseif v1.name == "minecraft:water" then
  23. send = send .."|" .."2" .."," ..v1.x .."," ..v1.y .."," ..v1.z
  24. else
  25. send = send .."|" .."1" .."," ..v1.x .."," ..v1.y .."," ..v1.z
  26. end
  27.  
  28.  
  29.  
  30.  
  31.  
  32. if string.len(send) >= 8000 then
  33. print(send .."\n")
  34. netOut.transmit(portOut, portOut,send)
  35. send = ""
  36. end
  37.  
  38. end
  39. sleep(3)
  40. end
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement