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

Detecting if current computer is advanced

Started by Sir_Mr_Bman, 05 April 2014 - 03:42 PM
Sir_Mr_Bman #1
Posted 05 April 2014 - 05:42 PM
SOLVED!


Alright

So I have several programs that I want to compile into 1 installer.

Some of them require advanced computers, some do not.

I already have the installer (along with automatic github updating) all set up. What I want to do now is be able to tell if the computer that the program is running on is advanced or normal. If it's a normal computer, it will only allow normal options, and it will use arrow key input, but if it's an advanced computer it will allow both and use MOUSE input…


So, how do I detect what type of computer the program is running on? Could somebody give a little bit of a sample code, like


local tof = <code to detect advanced computer>
if tof == <value> then
	 -- Run code for advanced
else
	 -- Run normal code.
end
or something like that
Edited on 05 April 2014 - 04:00 PM
CometWolf #2
Posted 05 April 2014 - 05:44 PM
check if the computer supports colors. If it does, it's advanced.

if term.isColor() then
Sir_Mr_Bman #3
Posted 05 April 2014 - 05:59 PM
Thanks, Comet wolf!

– Solved –