I guess what I am looking for is what are buildings i should always use. I have lately been getting raped buy invisible guys. I have to admit I am rather new. I have gotten better but I seem to always get hurt by some random crap. I am not asking for build orders as much as what i should always be laying down to avoid getting raped.
Well if you're really concerned about getting hit by cloaked units, throw up an engineering bay and a missle turret or 2 around your base (especially at your main choke and mineral line). Or, you could save up energy on your Orbital Command for use in a clinch situation (it'd be more economical to use the energy for MULE's however). Also, Ravens are a good mobile detector that terrans can use (and also come with some neat abilities too xD )
Invisible units can really be stopped at your base two practical ways as terran IMO with third option that is more offense than defense. The first option is to keep a scanner sweep from the orbital command ready at all times and try to take the invisible units out then and there. From an offensive standpoint, that can work because you will be attacking key components of the enemy base that they can't really afford to lose. From a defensive standpoint though, this is fairly weak. The reason I dont recommend scanner sweep, especially early on, is because this takes away your early MULEs. Each mule mines about 300 minerals per life, resulting in each scanner sweep practically costing you 300 minerals. Not only are scanner sweeps expensive, they also don't always work properly since invisible units like banshees can fly out, dark templars can run away, burrowed roaches can move as well. So scanner sweep--- good for offense, questionable for defense. The second option is to use the 300 minerals from your MULE, invest an additional 25 minerals and build an engineering bay and two towers, one near the choke and one by your minerals (adding more if the need arises). This completely shuts down any sort of invisible attack that can come your way and is actually very cost effective from a defensive standpoint considering what your opponent has to pay to get these invisible units out onto the field. 1 banshee costs 150/100 plus 200/200 meaning your 325 minerals shut down a 350/300 investment. 1 DT costs 100/250 + 125/125 so those 325 minerals shut down 225/375. Plus, this prevents other modes of air harass on your mineral line from being viable. All in all, it is a good security option if you feel invisible units are coming. Your third anti-invisible unit is the raven which is more later game since it is expensive at 100/200, and requires a tech lab on a starport to build. It also isnt invisible so it can be target fired to make you vulnerable to invisible units, but its own abilities are fairly useful and it is very mobile so it can serve as your late game detector no problem. Hopefully that helps you deal with enemy invisible units
I keep some turrets and an orbital command up at all times. These units can usually be taken out with a quick scanner sweep. I often times will avoid dropping mules until I get good detection and have scouted my opponent effectively, so that way I can keep the energy lined up for detection later on in the fight.
Another option for dealing with invisible units is the Ghost's EMP. You can see the shimmer/blur of invisible units, so you place the Area-Of-Effect circle of the EMP over that area and fire. The depletion of shields makes Banshees de-cloak instantaneously. Versus Dark Templars and Observers, they actually just die if they're caught inside the EMP. Killing DT's like this will discourage a Protoss player from building any more for the rest of that match. To the OP, one of the most versatile and robust builds is the 1-1-1 opening build so long as you're on top of your scouting and quick with your add-on swapping. You can make the 1-1-1 build fairly cheese-proof by scouting around on 9/10 supply for proxies, 2-gate, 7pool, then throwing in an early engineering bay for towers and a couple of early bunkers at the choke to foritify against baneling bust. You can recover all resources from the bunkers by salvaging them later on. Eventually, you'll know which structures you don't need to build after you develop a more keen game sense.
Early game, your enemies will not have enough units for it to matter that they can run away. The key is to corner them and force them to take damage. 4 or 5 DT's can quickly take damage enough to die, so it won't matter that they can run. They will still get owned if you use the scanner sweep appropriately.
I am sorta finding what works, throw down a few different things and it makes a difference. I think one of my biggest problems is that I didn't realize how good adding orbital command was, oh boy thats made a difference. I hope to get good at the game, I'm very weak at hot keying. I need to figure out an efficient way to do all that. Hey amberlamps, you leaking? God I love the old man's shirt. I gotta buy me one!
The macro skills will come in time. I didn't have a clue what I was capable of doing with the keyboard until well into the game. It helps to read the tutorials and stuff.
Lay down some turrets and some starports i suppose, i would recommend rewatching your replays to notice your mistakes, what units they had and what you could of done. And ofcourse, get an orbital command!