This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Clean0nion's profile picture

[Question] How can I make text show on a computer screen and a monitor screen simultaneously?

Started by Clean0nion, 08 March 2013 - 12:46 AM
Clean0nion #1
Posted 08 March 2013 - 01:46 AM
I was playing Worm on a computer, and other people on the server wanted to watch me play for whatever reason. Instead of having everyone gather round the computer, I connected it to a monitor and ran 'monitor right worm'.

Worm shows up on the monitor with no problem, but to interact with it, you need to access the computer. Worm doesn't show up on the computer, because it's on the monitor.

So how can I make text show on a computer screen and a monitor screen simultaneously?
Lyqyd #2
Posted 08 March 2013 - 08:43 AM
Split into new topic.

There are a few APIs on the forum that will do this for you. If you want to do it yourself, it's a simple matter of creating a redirect table that interacts with the screen as normal, but also sends all of the drawing calls to the monitor.
remiX #3
Posted 08 March 2013 - 08:47 AM
How would that be solved if possible?


function set(ind)
  if type(term[ind]) ~= "function" then return end

  term[ind] = setmetatable({term = term[ind], monitor = m[ind]}, {
		__call = function(self, ...)
		  self.term(...)
		  self.monitor(...)
		end
  })
end
This additional line will detect if term[ind] is a function. If it is already modified it is a table and will not be set twice

Try that.

Source: http://www.computercraft.info/forums2/index.php?/topic/10772-displaying-user-input-on-a-monitor/page__st__40

Look at the code there and how to use it. I think that's what you're looking for.
Lyqyd #4
Posted 08 March 2013 - 08:52 AM
Nope, that's a bad plan. No returns on the getters.
JokerRH #5
Posted 09 March 2013 - 10:32 AM
Nope, that's a bad plan. No returns on the getters.

What do you mean with no returns?
Azhf #6
Posted 09 March 2013 - 10:37 AM
There is a program on here somewhere I saw last night but I can't remember what it is called. Sorry XP
GravityScore #7
Posted 09 March 2013 - 01:52 PM
There's a program called splitter on the forums by BigSHinyToys which does what you're looking for.
SuicidalSTDz #8
Posted 09 March 2013 - 03:19 PM
This question was already answered here. Please search anything before posting.