Advertisement
Guest User

tracker

a guest
Aug 17th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.23 KB | None | 0 0
  1. --local terminal = window.new(1,1,term.getSize())
  2.  
  3. local current = term.current()
  4. local terminal = {}
  5.  
  6. local bg=colors.black
  7.  
  8. local fg=colors.white
  9.  
  10. local oSB=terminal.setBackgroundColor
  11. local oST=terminal.setTextColor
  12. terminal.setBackgroundColor = function(color)
  13. --  if term.isColor(color) then
  14.     bg=color
  15. --  end
  16.   return oSB(color)
  17. end
  18. terminal.getBackgroundColor = function()
  19.   return bg
  20. end
  21. terminal.setTextColor = function(color)
  22. --  if term.isColor(color) then
  23.     fg=color
  24. --  end
  25.   return oST(color)
  26. end
  27. terminal.getTextColor = function()
  28.   return fg
  29. end
  30.  
  31. terminal.setBackgroundColour = function(c)
  32.   bg = c
  33.   return oSB(c)
  34. end
  35. terminal.getBackgroundColour = function(c)
  36.   return bg
  37. end
  38.  
  39. terminal.setTextColour = function(c)
  40.   fg = c
  41.   return oST(c)
  42. end
  43. terminal.getTextColour = function(c)
  44.   return fg
  45. end
  46.  
  47. --terminal.setTextColour = terminal.setTextColor
  48. --terminal.getTextColour = terminal.getTextColor
  49. --terminal.setBackgroundColour = terminal.setBackgroundColor
  50. --terminal.getBackgroundColour = terminal.getBackgroundColor
  51.  
  52. setmetatable(terminal,{__index=function(t,k) return current[k] end})
  53.  
  54. term.redirect(terminal)
  55. print(term.setTextColor)
  56. print(term.setTextColour)
  57. os.pullEvent()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement