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

How to check if the computer in CC is advanced

Started by Mackan90096, 06 May 2013 - 03:11 AM
Mackan90096 #1
Posted 06 May 2013 - 05:11 AM
This is my first tutorial.

Code:
Spoiler

if term.isColor() then
-- Do stuff here
elseif not term.isColor() then
-- Do stuff here
end

Explanation:


if term.isColor() then
-- Do stuff here
term.isColor() detects if the computer supports color, which only the advanced one(s) do.


elseif not term.isColor() then
-- Do stuff here

The computer is normal.

Hope I helped, leave feedback below.

//Mackan90096
theoriginalbit #2
Posted 06 May 2013 - 05:19 AM
Nice and simple tutorial.

Notes:
Spoilerthe elseif is not required, just use else

if term.isColor() then
  -- # if its advanced
else
  -- # if its normal
end

I would also suggest pointing out about supporting for old (preCC1.4) computers like so

if not term.isColor then
  -- # its a pre1.4, no colours can be changed
elseif term.isColor() then
  -- # its an advanced computer, can be changed to any colour
else
  -- # its a normal computer, colours can be changed between black and white
end

Also it might be worth pointing out that there is
term.isColour()
for those of us who don't use American English.
Mackan90096 #3
Posted 06 May 2013 - 05:20 AM
Nice and simple tutorial.

Notes:
Spoilerthe elseif is not required, just use else

if term.isColor() then
  -- # if its advanced
else
  -- # if its normal
end

I would also suggest pointing out about supporting for old (preCC1.4) computers like so

if not term.isColor then
  -- # its a pre1.4, no colours can be changed
elseif term.isColor() then
  -- # its an advanced computer, can be changed to any colour
else
  -- # its a normal computer, colours can be changed between black and white
end

Also it might be worth pointing out that there is
term.isColour()
for those of us who don't use American English.

Thanks.. Will think of this next time i write a tutorial.. If I ever will..
theoriginalbit #4
Posted 06 May 2013 - 05:21 AM
Thanks.. Will think of this next time i write a tutorial.. If I ever will..
There is always edit ;)/>
Mackan90096 #5
Posted 06 May 2013 - 05:24 AM
Thanks.. Will think of this next time i write a tutorial.. If I ever will..
There is always edit ;)/>

True :)/>