Paul submitted:

Using Cmax to control light switches without adding additional latency to x10:
Lines 178 - 188. My goal was to have "stick a switches" control the lights directly, but control turning them off with CMAX, too. I did not like the latency of sending a command to CMAX, and then having it send a command to the device to turn it on. Here is the basic procedure:
Set the wireless switch to the same code as the light / device, so the switch is directly controlled for on / off / dim
Let the Ocelot see this happen, CMAX code, and start a timer to turn it off
Dim the lights as a warning with CMAX after so much time has elapsed
The switch or the timer turn it off and reset the timer.
Use a stick a switch to override auto/passive cmax functions:
Line 30 (on) and 42 (off)
A majority of my x10 functions are passive: landscape lights, premise, flood lights and auto off for inside lights. Most of the time its great, they just do their thing. However, on nights that we're having parties, I want the lights on and there are daily routines I want to buy pass. By pressing a "stick a switch" button, I set a variable, and then check it at appropriate spots. The next morning, it gets reset. (My parties only last one evening, must be getting old....)

Relative control of devices using Bobcats.
Lines 142 - 176
I have had attic fans in my older homes, always triggered by absolute temperature, 90 - 110 degrees. The summer problem with this arrangement is two fold, attic temperature has an effect on the comfort level of the house below this threshold. But if set too low, the fan runs continuously, and on the hottest days, runs forever with marginal effect on comfort. I also need the fan in the winter, as rise in attic temperatures create ice dams on snowy roofs, and humidity in the attic, which has turned into hundreds of dollars of costly repair.

My solution: The fan was in place with an X10 wall socket module, and I had the ocelot. I needed two bobcats, temp and humid. Put them in the attic center, attached to a joist. I then needed code to make it work. Rather than waiting for temperature or humidity extremes, I turn the fan on for 3 minutes, 4 fixed times during the day. I take current readings from the bobcats before I start. The fan comes on, and if the readings get better (cooler, drier) in that time, the routine extends the run time, up to 9 iterations, or a total of 35 minutes.

It also serves as a fusible link, required for attic fans; at 240 degrees it shuts the fan down because it is feeding a fire.

The routine also shares manual control of the fan with a "Stick a switch", which turns it on for 15, or 45 minutes to cool the house.

I am hoping this routine could be generalized for other purposes.