Advertisement
Guest User

server

a guest
Nov 25th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.14 KB | None | 0 0
  1.  
  2. p = print
  3. w = term.write
  4. stc = term.setTextColor
  5. sbc = term.setBackgroundColor
  6. scp = term.setCursorPos
  7.  
  8. local args = {...}
  9.  
  10. rednet.open(args[2])
  11.  
  12. ip = tonumber(args[1])
  13.  
  14. function com(tab)
  15.   str = ""
  16.   for k,v in ipairs(tab) do
  17.     if str ~= "" then
  18.       str = str .. "," .. v
  19.     else
  20.       str = str .. v
  21.     end
  22.   end
  23.   return str
  24. end
  25.  
  26. --_G.com = com
  27.  
  28. function n_p(str)
  29.   rednet.send(ip,"print(\""..str.."\")")
  30.   loadstring("p(\""..str.."\")")
  31. end
  32.  
  33. function n_w(str)
  34.   rednet.send(ip,"term.write(\""..str.."\")")
  35.   loadstring("w(\""..str.."\")")
  36. end
  37.  
  38. function n_stc(col)
  39.   rednet.send(ip,"term.setTextColor("..col..")")
  40.   stc(col)
  41. end
  42.  
  43. function n_sbc(col)
  44.   rednet.send(ip,"term.setBackgroundColor("..col..")")
  45.   sbc(col)
  46. end
  47.  
  48. function n_scp(x,y)
  49.   rednet.send(ip,"term.setCursorPos("..com({x,y})..")")
  50.   scp(x,y)
  51. end
  52.  
  53. print = n_p
  54. --_G.print = n_p
  55.  
  56. term.write = n_w
  57. term.setTextColor = n_stc
  58. term.setBackgroundColor = n_sbc
  59. term.setCursorPos = n_scp
  60.  
  61. error("Success!")
  62.  
  63. --print = p
  64. --_G = p
  65.  
  66. --term.write = w
  67. --term.setTextColor = stc
  68. --term.setBackgroundColor = sbc
  69. --term.setCursorPos = scp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement