695 posts
Location
In my basement.
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
7508 posts
Location
Australia
Posted 06 May 2013 - 05:19 AM
Nice and simple tutorial.
Notes:Spoiler
the 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 isterm.isColour()
for those of us who don't use American English.
695 posts
Location
In my basement.
Posted 06 May 2013 - 05:20 AM
Nice and simple tutorial.
Notes:Spoiler
the 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 isterm.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..
7508 posts
Location
Australia
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 ;)/>
695 posts
Location
In my basement.
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 :)/>