Jump to content




Print screen


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

#1 candycool1234

  • Members
  • 91 posts

Posted 21 January 2013 - 06:20 PM

I need help how do i make a print program for a screen with a diff backround color it needs to start on startup

like this but color and on a screen

print( [[To-Do List
1.Get boxite
2.Finish strip mine
3.Get redstone]] )
barkround white

#2 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 21 January 2013 - 06:24 PM

term.setTextColour(colours.black) -- to set the colour of the text
term.setBackgroundColour(colours.white) -- to set the colour of the background
term.clear() -- to clear the screen so the screen will become whit
term.setCursorPos(1, 1) -- reset the cursor

print([[
1. Get boxite
2. Finish strip mine
3. Get redstone]])


#3 candycool1234

  • Members
  • 91 posts

Posted 21 January 2013 - 06:26 PM

That is vary help full but in the first line isnt it Colors?
and how do i get it to print on my monitor?

#4 Willibilly19

  • Members
  • 48 posts
  • LocationColorado, USA

Posted 21 January 2013 - 06:42 PM

You could just wrap the monitor and replace "term" with the variable (That's how I do it anyway)


so something like this

mon = peripheral.wrap("<side of monitor>")


mon.setTextColour(colours.black) -- to set the colour of the text
mon.setBackgroundColour(colours.white) -- to set the colour of the background
mon.clear() -- to clear the screen so the screen will become white
mon.setCursorPos(1, 1) -- reset the cursor


print([[
1. Get boxite
2. Finish strip mine
3. Get redstone]])



and the other part of your question...I assume you mean Color vs. Colour? Either way works.

#5 candycool1234

  • Members
  • 91 posts

Posted 21 January 2013 - 07:01 PM

where in the code does it say desplay on back monitor because i really do want to learn
thx if you can respond

#6 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 21 January 2013 - 07:09 PM

I'd suggest you look into the peripheral api. The first thing you do is wrap the monitor.

Monitor = peripheral.wrap("right") -- where the monitor is on the right of the computer.

Now you can use the monitor as if it was term.function. Instead of usimg term, you use monitor.

-- so like this in the above code
Monitor.setBackgroundColour(colours.white)
Monitor.setTextColour(coliurs.black)
Monitor.clear()

-- monitors only have a write function so printing is not allowed so eaxh new line you will need to reset cursor pos. Or try this

Monitor.write([[
Txt
Text
Text]])

Typed this on my phone... Was quite difficult

#7 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 21 January 2013 - 07:11 PM

View PostWillibilly19, on 21 January 2013 - 06:42 PM, said:

You could just wrap the monitor and replace "term" with the variable
Or you could do this
local mon = peripheral.wrap("left")
term.redirect(mon)
-- anything with term API or print and write will now go to the monitor

term.restore()
-- now everything is back on the computer
Using this method you can use print... :)

#8 Willibilly19

  • Members
  • 48 posts
  • LocationColorado, USA

Posted 21 January 2013 - 07:11 PM

in the wrap at the top. Where I wrote

mon = peripheral.wrap("<side of monitor>")


just replace the <side of monitor> with back. That will tell the computer the monitor is on the back.

I missed the bottom of the code, but you could just edit to write instead of print.

You can use any of these http://computercraft.../wiki/Term_(API) just replace the "term" with "mon".


There is probably a more efficient way that editing each line to "mon.write()" but that's how I know how to do it.


mon = peripheral.wrap("back")

mon.setTextColour(colours.black) -- to set the colour of the text
mon.setBackgroundColour(colours.white) -- to set the colour of the background
mon.clear() -- to clear the screen so the screen will become white

mon.setCursorPos(1, 1) -- line 1
mon.write("1. Get boxite")
mon.setCursorPos(1,2)  --line 2 (might have the 1&2 backwards:P)
mon.write("2. Finish strip mine")
mon.setCursorPos(1,3)  --line 3
mon.write("3. Get redstone")



Ninja'd with 2 great suggestions. I'd listen to them:)

#9 candycool1234

  • Members
  • 91 posts

Posted 21 January 2013 - 07:12 PM

do i need the [cocde] in [cocde]Monitor = peripheral.wrap("right")

#10 Willibilly19

  • Members
  • 48 posts
  • LocationColorado, USA

Posted 21 January 2013 - 07:15 PM

No, that was the code tag for the forum, but since he wrote it on his phone, he typo'd.

Just start at "Monitor"

Also, ignore the [/code] at the bottom

#11 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 21 January 2013 - 07:15 PM

No, sorry. That was atypo of 'code' for the code tags. And I cant edit my post on my phone... Fail.

#12 candycool1234

  • Members
  • 91 posts

Posted 21 January 2013 - 07:18 PM

Monitor = peripheral.wrap("right")so do i need to do peripheral.wrap("back") or is there shorter than peripheral because i will forget how to spell that

#13 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 21 January 2013 - 07:19 PM

View PostremiX, on 21 January 2013 - 07:15 PM, said:

No, sorry. That was atypo of 'code' for the code tags. And I cant edit my post on my phone... Fail.
Really? I can what kind of phone u got? Touchscreen? Tap on the post and it should give you edit and quote...

#14 Willibilly19

  • Members
  • 48 posts
  • LocationColorado, USA

Posted 21 January 2013 - 07:20 PM

View Postcandycool1234, on 21 January 2013 - 07:18 PM, said:

Monitor = peripheral.wrap("right")so do i need to do peripheral.wrap("back") or is there shorter than peripheral because i will forget how to spell that

Yea, do peripheral.wrap("back").

Don't think there is a way to shorten it.

#15 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 21 January 2013 - 07:24 PM

View PostWillibilly19, on 21 January 2013 - 07:20 PM, said:

Don't think there is a way to shorten it.
You are correct, there is no shorter way like there is with redstone... :/

#16 candycool1234

  • Members
  • 91 posts

Posted 21 January 2013 - 08:21 PM

2 things i tryed it it doesnt work it stays on one line and 2 its small

http://pastebin.com/Teafh1K2

#17 Willibilly19

  • Members
  • 48 posts
  • LocationColorado, USA

Posted 21 January 2013 - 08:29 PM

try this code

mon = peripheral.wrap("back")

mon.setTextColor(colors.blue)
mon.setBackgroundColor(colous.white)
mon.setTextScale(2) --can be 1-5
mon.clear()


mon.setCursorPos(5,1)
mon.write("FuzzyCorp todo list")
mon.setCursorPos(1,2)  
mon.write("1.----- 2.----- 3. -----")
mon.setCursorPos(1,3)  
mon.write("4. ----- 5. ----- 6. -----")



From there, you'd have to set your cursor position and write each line individually, but it should work.
You'll probably have to adjust the cursor positions here, I just guessed lol




EDIT* Realized I had quotes around the text scale 2, if you've copied already, get rid of those. it's fixed now though.

#18 candycool1234

  • Members
  • 91 posts

Posted 21 January 2013 - 08:43 PM

error like :4: number expected

#19 Willibilly19

  • Members
  • 48 posts
  • LocationColorado, USA

Posted 21 January 2013 - 08:47 PM

oops, add colors instead of colous...typo

#20 candycool1234

  • Members
  • 91 posts

Posted 21 January 2013 - 08:52 PM

i fixed that but line 4 text Size thing it said number expected





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users