As an example, here is a simple application which is triggered by a push switch connected to a Netiom which initially turns on a light, in this case a DMX connected one using the xAP DMX512 interface but it could be C-BUS, X10, Dynalite, etc., and with each subsequent press increases the level. After 10 seconds of no activity then another press will turn off the light. It shows a number of the basic functions in use:
LogDebug - for status logging/debugging
Global Variables - used to maintain the state of the light
Get BSC State - to check the Netiom input
Send BSC - to send the on/off and level to the DMX controller/light
Script 1 - Kitchen1toggle
Script 2 - Kitchen1toggleoff
You could extend these to go down after reaching a maximum.