Main Menu

Printing onto a monitor

Started by Pechu317, Sep 09, 2020, 03:32 PM

Previous topic - Next topic

Pechu317

So i'm making a lottery, and I want a large monitor that says "You could win:" in the top left corner, and a number in the middle that can be changed easily. How would I program this?

QuickMuffin8782

Quote from: Pechu317 on Sep 09, 2020, 03:32 PMSo i'm making a lottery, and I want a large monitor that says "You could win:" in the top left corner, and a number in the middle that can be changed easily. How would I program this?
Here's some code you could use, first you would need to wrap the peripheral:
local mon = peripheral.wrap(<side>)Then you can use the monitor like you would on a program using the normal apis installed to the computer built in like:
mon.print("You could win:") -- Use any function, but starting with the variable you used to wrap the monitor to work it out on the monitor to display.After that, printing on a monitor should be easy as a snap!
"The Blue Blur" - Working on Net Star OS, a new frontier for Red Star OS 3.0
linktr.ee/quickmuffin8782

Lupus590

Quote from: QuickMuffin8782 on Sep 09, 2020, 05:23 PMmon.print("You could win:")
If I remember correctly, monitors don't have a print function as a peripheral, you would have to either write your own function for that or redirect the terminal to the monitor and use its print.

Or you could move the cursor on the monitor so that the next write looks like it printed.