Advertisement
Guest User

server

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