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.
This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Problem writing to an advanced monitor
Started by TehNoiseBomb, 22 September 2015 - 12:11 AMPosted 22 September 2015 - 02: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.
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.
Posted 22 September 2015 - 07: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.
I ask because the easiest way for me to help cannot support monitors.
Edited on 22 September 2015 - 05:53 PM
Posted 22 September 2015 - 08: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.
Posted 22 September 2015 - 08:10 PM
-removed by user :D/>
Edited on 22 September 2015 - 07:47 PM
Posted 22 September 2015 - 08:12 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.
Quick look through the forums I can confirm this bug (previously unknown to me) exists.
Posted 22 September 2015 - 08:19 PM
That is incorrect. 'if active' is valid and is the same as 'if active == true'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>
Edited on 22 September 2015 - 06:21 PM
Posted 22 September 2015 - 08:23 PM
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"Posted 22 September 2015 - 08:32 PM
To clarify a bit on my previous post…
You could also do this…
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…
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 on 22 September 2015 - 06:34 PM
Posted 22 September 2015 - 09:46 PM
Dog and TYKUHN2.
okay. i stand corrected :D/> thanks for that :)/>
okay. i stand corrected :D/> thanks for that :)/>
Posted 22 September 2015 - 10: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.
Also I probably did that a lot on programs I have yet to scrap.