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

Paintutils On A Monitor

Started by jamd315, 09 October 2013 - 02:32 PM
jamd315 #1
Posted 09 October 2013 - 04:32 PM
I would like to be able to use the paintutils API on an advanced monitor adjacent to my computer. I have no idea how. I tried something like
monitor.paintutils.drawLine(x, y, x, y, color)
and

local function line = paintutils.drawLine(x, y, x, y, color) end
monitor.line()
I don't want to use a separate program

shell.run("monitor", "right", "program")
any ideas?
Engineer #2
Posted 09 October 2013 - 05:23 PM
You should redirect to your monitor using:

term.redirect( monObject )
-- Regular paintutil calls get onto the monitor
term.restore()

Here is an awesome tutorial about redirecting, written by LBPHacker
jamd315 #3
Posted 10 October 2013 - 06:14 AM
You should redirect to your monitor using:

term.redirect( monObject )
-- Regular paintutil calls get onto the monitor
term.restore()

Here is an awesome tutorial about redirecting, written by LBPHacker
Thanks,just what I needed! Great job following the Ask A Pro Renewal Project
Phoenix323 #4
Posted 19 April 2015 - 09:25 AM
i don't really understand what your saying
Creator #5
Posted 19 April 2015 - 10:31 AM
well, it works like this:

term is an output object. You can redirect the flow of the output to a monitor by doing this:


m = peripheral.wrap(sideofmon)
term.redirect(m)

Now everything that is to be printed on the term, will be printed on the monitor.

Just try it out ;)/>
Dragon53535 #6
Posted 19 April 2015 - 06:34 PM
You should redirect to your monitor using:

term.redirect( monObject )
-- Regular paintutil calls get onto the monitor
term.restore()

term.restore was removed at CC 1.6. Now term.redirect returns a value of where it just redirected FROM so you need to grab that, and then redirect back to it when you're done.


local oldTerm = term.redirect(monitor)
--#Do stuff with monitor
term.redirect(oldTerm)