This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
I cant use Peripheral.wrap. ...
Started by kruschen, 07 July 2016 - 02:40 PMPosted 07 July 2016 - 05:12 PM
Moved to Ask a Pro.
There isn't a print method on a monitor peripheral.
There isn't a print method on a monitor peripheral.
Posted 07 July 2016 - 08:00 PM
need to define it and then do <def>.write(text)
<def> is the definition you gave it
would suggest looking at this http://computercraft.info/wiki/Monitor
<def> is the definition you gave it
would suggest looking at this http://computercraft.info/wiki/Monitor
Posted 08 July 2016 - 12:40 AM
When you "connected" the monitor by right-clicking the wired modem, you were given a "network name" (likely "monitor_0" or somesuch). That is the name you should be using when wrapping; in this case, "back" ends up wrapping the wired modem connected to the back of the computer.
Though as Lyqyd points out, either way you won't get a "print" function. Refer to the link ReBraLaCC gave you, the term API, and perhaps term.redirect() in particular.
Though as Lyqyd points out, either way you won't get a "print" function. Refer to the link ReBraLaCC gave you, the term API, and perhaps term.redirect() in particular.
Posted 08 July 2016 - 09:31 AM
If you're going to use term.redirect, I suggest you store a copy of term.current before hand and then redirect to that copy once your program is finished.
Posted 08 July 2016 - 02:34 PM
The usual idiom for redirecting a terminal is as follows:
local _oldTerm = term.redirect(mon)
--# redirected drawing code
if _oldTerm then
term.redirect(_oldTerm)
else
term.restore()
end
Posted 09 July 2016 - 10:26 AM
Thanks for all the awnsers i try it monday :)/>
Posted 09 July 2016 - 09:58 PM
kraftwerk.getActive is a function, call it using () at the end of it.
if kraftwerk.getActive() then…
Edit: Same thing for monitor.clear, should be monitor.clear()
if kraftwerk.getActive() then…
Edit: Same thing for monitor.clear, should be monitor.clear()
Edited on 09 July 2016 - 07:59 PM
Posted 09 July 2016 - 10:41 PM
Thanks that helps a lot :)/>