Jump to content




Problem writing to an advanced monitor

lua help peripheral

9 replies to this topic

#1 TehNoiseBomb

  • Members
  • 9 posts

Posted 22 September 2015 - 01:11 AM

Hello all,

I am having problems writing output to an advanced monitor. I am attempting to track my reactor from Big Reactors and output some data to a monitor. I know that scripts already exist for this however, being an actual programmer and modder, I want to write my own for future expansion. I have a few lines commented out for testing. My code is here. Any help would be greatly appreciated.

#2 TYKUHN2

  • Members
  • 210 posts
  • LocationSomewhere in this dimension... I think.

Posted 22 September 2015 - 06:52 PM

Are there any errors being printed to the terminal or is it just not printing?

I ask because the easiest way for me to help cannot support monitors.

Edited by TYKUHN2, 22 September 2015 - 06:53 PM.


#3 Lignum

  • Members
  • 558 posts

Posted 22 September 2015 - 07:03 PM

There's a bug in CC 1.74 that causes text to be invisible on monitors. Try setting the text scale to something other than your current one and then setting it back to your desired scale.

#4 Dustmuz

  • Members
  • 174 posts
  • LocationDenmark

Posted 22 September 2015 - 07:10 PM

-removed by user :D

Edited by Dustmuz, 22 September 2015 - 08:47 PM.


#5 TYKUHN2

  • Members
  • 210 posts
  • LocationSomewhere in this dimension... I think.

Posted 22 September 2015 - 07:12 PM

View PostLignum, on 22 September 2015 - 07:03 PM, said:

There's a bug in CC 1.74 that causes text to be invisible on monitors. Try setting the text scale to something other than your current one and then setting it back to your desired scale.

Quick look through the forums I can confirm this bug (previously unknown to me) exists.

#6 Dog

  • Members
  • 1,177 posts
  • LocationEarth orbit

Posted 22 September 2015 - 07:19 PM

View PostDustmuz, on 22 September 2015 - 07:10 PM, said:

Line 18 - if active then - this will needs a second parameter..
this should be..

if active == true then


besides that one, i cant see any errors in it :)
<snip>
That is incorrect. 'if active' is valid and is the same as 'if active == true'

Edited by Dog, 22 September 2015 - 07:21 PM.


#7 TYKUHN2

  • Members
  • 210 posts
  • LocationSomewhere in this dimension... I think.

Posted 22 September 2015 - 07:23 PM

View PostDustmuz, on 22 September 2015 - 07:10 PM, said:

Line 18 - if active then - this will needs a second parameter..
this should be..

if active == true then


besides that one, i cant see any errors in it :)

and as lignum says.. theres that bug.. i personally rarely encounter it, and if i do, i just restart the computer (the CC computer that is) that fixes it for me

Expanding on Dog's the statement if check if
expression
is true. == just says "If it is equal to then true"

#8 Dog

  • Members
  • 1,177 posts
  • LocationEarth orbit

Posted 22 September 2015 - 07:32 PM

To clarify a bit on my previous post...
if active
is the same as
if active == true
Either is valid in Lua. There is no bug on line 18.

You could also do this...
if not active
which is the same as
if active == false or active == nil

In your case, I believe Lignum has nailed the answer - this appears to be the product of a known issue in CC1.74 - changing the text scale and changing it back *should* resolve the issue for you. Just do something like this before setting your cursor position and writing...
mon.setTextScale(2)
mon.setTextScale(1)

Edited by Dog, 22 September 2015 - 07:34 PM.


#9 Dustmuz

  • Members
  • 174 posts
  • LocationDenmark

Posted 22 September 2015 - 08:46 PM

Dog and TYKUHN2.

okay. i stand corrected :D thanks for that :)

#10 TYKUHN2

  • Members
  • 210 posts
  • LocationSomewhere in this dimension... I think.

Posted 22 September 2015 - 09:49 PM

Don't worry Dustmuz, may not be your Ask a Pro topic but you learned today! Better codes for now on!

Also I probably did that a lot on programs I have yet to scrap.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users