Jump to content




Computer screen on monitor (HELP!)

lua help

5 replies to this topic

#1 oscar124

  • Members
  • 11 posts
  • Locationomg, im in sweden!!!!!!!

Posted 17 November 2014 - 05:48 PM

How do i show everything on the computer screen on a monitor while i use it? :mellow: :mellow:

I have been looking everywhere for an answer yet still not found one. :o

Please help, :(

// Oscar124

#2 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 17 November 2014 - 06:14 PM

There is not default way to do this. As far as I know, nobody has made an api that does this on CC 1.6 yet. Other than that, just make a function that writes to the monitor and the terminal at the same time, and use that in your program.

#3 oscar124

  • Members
  • 11 posts
  • Locationomg, im in sweden!!!!!!!

Posted 17 November 2014 - 06:16 PM

View PostKingofGamesYami, on 17 November 2014 - 06:14 PM, said:

There is not default way to do this. As far as I know, nobody has made an api that does this on CC 1.6 yet. Other than that, just make a function that writes to the monitor and the terminal at the same time, and use that in your program.

Hmm...

#4 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 17 November 2014 - 06:18 PM

function writeBoth( text )
  mon.write( text )
  term.write( text )
end

function setBothCursor( x, y )
  term.setCursorPos( x, y )
  mon.setCursorPos( x, y )
end
--#etc.


#5 oscar124

  • Members
  • 11 posts
  • Locationomg, im in sweden!!!!!!!

Posted 17 November 2014 - 07:43 PM

Yeah..i know..

#6 Dog

  • Members
  • 1,177 posts
  • LocationEarth orbit

Posted 17 November 2014 - 08:08 PM

I have a feeling you're already aware of this, but ... fwiw, if you're only dealing with text, I'd combine both functions into a single function like this...
local function drawBoth(x, y, text)
  term.setCursorPos(x, y)
  term.write(text)
  mon.setCursorPos(x, y)
  mon.write(text)
end

drawBoth(2, 2, "Test")

I realize it's not exactly what you're looking for, but it would allow you code everything once per text/line and display it on both screens. This is definitely less efficient than KingofGamesYami's implementation if you're writing a line of text in multiple colors; but if you're only using a single color, this would reduce your code a bit more than KingofGamesYami's suggestion.

Edited by Dog, 17 November 2014 - 08:13 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users