TR1T0N_

Firewall

May 18th, 2014
655
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. realid = 1
  2.  
  3. function spoof(nID)
  4. local getID = os.getComputerID -- Backing up the old function
  5. os.getComputerID = function(nID) -- Overriding it
  6.     return nID or getID() -- Returning the fake id or the regular computer ID
  7. end
  8. end
  9.  
  10. function unspoof()
  11. print("end spoof")
  12.   spoof(5)
  13. end
  14. --firewall start
  15. rednet.open("top")
  16. rednet.open("back")
  17. print("1")
  18. while true do
  19. rednet.open("top")
  20. rednet.open("back")
  21. var1, var2, var3 = rednet.receive()
  22. print("id = "..tostring(var1))
  23. print("msg = "..tostring(var2))
  24. print("distance = "..tostring(var3))
  25. print("2")
  26. if var1 == 2  then
  27. rednet.close("top")
  28. rednet.open("back")
  29. print("4")
  30. spoof(var1)
  31. print("5")
  32. rednet.send(3, var2)
  33. print("6")
  34. elseif var1 == 3 then
  35. rednet.close("back")
  36. rednet.open("top")
  37. print("7")
  38. print("8")
  39. spoof(var1)
  40. print("9")
  41. rednet.send(2, var2)
  42. print("10")
  43. else
  44. rednet.send(var1, "deny")
  45. print("11")
  46. end
  47. end
Advertisement
Add Comment
Please, Sign In to add comment