a short example from my code :
to define a variable :
define variable <chair_move>
type numeric
value <6>
onchange do <take_rope> ' it's a call to a procedure
end define
to check and change it :
command <push #@object1#> {
'the test :
if ( #object1# = table ) then {
if ( %table_move% > 0 ) and ( %table_move% < 11 ) then {
msg <You push the table.>
' it's for decreasing the variable as you can guess...
dec <table_move>
}
else msg <There is a wall preventing you to move anymore.>
}
all this is well explained in the Quest Manual