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

Monitor won't print text above line h-7

Started by YoShIWoZ, 23 August 2015 - 02:26 PM
YoShIWoZ #1
Posted 23 August 2015 - 04:26 PM
Hey yall CC people out there, it's been quite a while since i last played with CC. So decided to boot it up on my private server running a private modpack
Which includes the newest version of CC
So i loaded my old homemade OS. Had to change a few lines of code:
function drawDesktop()
  mon.setBackgroundColor(backgroundC)
  mon.clear()
  background = paintutils.loadImage("/disk/background")  
--  term.redirect(mon)
--  paintutils.drawImage(background,-4,1)
--  term.restore()
  menuBar()
end
As you can see i had to comment out term redirect, since this apparently doens't work anymore.
Now my problem is, when i try write text to the monitor with and above monitor h-7 it simply doesn't print the text. Which seems a bit weird, because it's not even in the buttom of the block that has the monitor in it. But it's the middle of the block. So any of the text i have in my OS does not show up if it's written above line h-7 (7 lines above bottom).
I tested this out by doing a blank file with just

  mon = peripheral..wrap("top")
  mon.setTextColor(32768)
  mon.setBackgroundColor(1)
  mon.setCursorPos(1,h-1)
  mon.write(">Programs")
  mon.setCursorPos(1,h-2)
  mon.write("		 ")
  mon.setCursorPos(1,h-3)
  mon.write("		 ")
  mon.setCursorPos(1,h-4)
  mon.write("		 ")
  mon.setCursorPos(1,h-5)
  mon.write("		 ")
  mon.setCursorPos(1,h-6)		
  mon.write("Restart  ")
  mon.setCursorPos(1,h-7)
  mon.write("Shutdown ")
It writes everything up to shutdown, i even tried adding h-8 h-9 etc. same problem.

Edit: Also tried setting the curser from top, same problem:
  mon.setCursorPos(1,13)
This works fine
but
  mon.setCursorPos(1,12)
This doesn't work.
Edited on 23 August 2015 - 02:51 PM
HPWebcamAble #2
Posted 23 August 2015 - 06:23 PM
There's a bug in CC 1.74 with monitors; Sometimes, they won't display text.

A temporary work-around is changing the text scale to a different value, then back to what you want it to be.


As you can see i had to comment out term redirect, since this apparently doens't work anymore.

It should work… Was it giving you an error?
YoShIWoZ #3
Posted 23 August 2015 - 09:21 PM
There's a bug in CC 1.74 with monitors; Sometimes, they won't display text.

A temporary work-around is changing the text scale to a different value, then back to what you want it to be.


As you can see i had to comment out term redirect, since this apparently doens't work anymore.

It should work… Was it giving you an error?
I downgraded to 1.73. Thanks for the tip, that fixed it! :)/>

The problem with term redirect code part is that
term.restore()
Doesn't seem to exist anymore since it just calls out a nill
Dragon53535 #4
Posted 23 August 2015 - 09:37 PM
–snip–
The problem with term redirect code part is that
term.restore()
Doesn't seem to exist anymore since it just calls out a nill
Term.redirect now returns the old term, so if you were to redirect to a monitor you would do this:

local curr = term.redirect(mon)
--#Back to the computer!
term.redirect(curr)
YoShIWoZ #5
Posted 23 August 2015 - 09:51 PM
–snip–
The problem with term redirect code part is that
term.restore()
Doesn't seem to exist anymore since it just calls out a nill
Term.redirect now returns the old term, so if you were to redirect to a monitor you would do this:

local curr = term.redirect(mon)
--#Back to the computer!
term.redirect(curr)
Thanks, that kind of works. :P/>
But now everytime i write something to the terminal (which i use for debugging, like i make it write on terminal where i click with the mouse on teh touch screen. It writes that info on the monitor instead. :P/>
Edit: Which actually makes sense since it's not returned to terminal, but it's returned to monitor. :P/>
Edit Edit: I just read on the wiki that they replaced the restore with
term.redirect(term.native()) =)
Edited on 23 August 2015 - 07:53 PM
Bomb Bloke #6
Posted 24 August 2015 - 03:07 AM
Edit Edit: I just read on the wiki that they replaced the restore with
term.redirect(term.native()) =)

The structure Dragon suggested is better - term.native() may not be the terminal that was in use before your script started.
Lyqyd #7
Posted 24 August 2015 - 06:56 AM
I've removed that line from the wiki, as that's really not very good advice.