Jump to content




monitor text


  • You cannot reply to this topic
2 replies to this topic

#1 sjoerd2k

  • New Members
  • 1 posts

Posted 02 January 2014 - 02:20 PM

i want a text on a monitor but how do i do it can sombody help my?

#2 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 02 January 2014 - 04:12 PM

First, Wrap it
local mon --# Create a variable for the monitor
for _, name in ipairs( peripheral.getNames() ) do -- Loop through all peripherals attached
	if peripheral.getType( name ) == "monitor" then -- Check if the peripheral type was a monitor
		mon = peripheral.wrap( name ) -- If it was the wrap it
		break -- And break from the loop
	end
end
Now it's simple, You can do this
mon.write("Hello World!")

Note that all the 'term' functions does work for monitors, So you can do this
mon.clear()
mon.setCursorPos(1,1)
mon.setTextColor(colors.white)
mon.setBackgroundColor(colors.black)
etc..

Edited by Hellkid98, 02 January 2014 - 04:16 PM.


#3 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 02 January 2014 - 04:59 PM

You can also use term.redirect, which will allow you to then use print() and write() and textutils.tabulate(), etc.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users