yea, to use your own vars you specify them on the parameters section on the class in the AI it looks like this
Code:
parameter_define_begin
int myvar 0
parameter_define_end
the format is
VarType VarName DefaultValue
and with that i will "try" to do your if statements in AI
See my next post for proper code
remember this is just an example to show how to set a variable and then check it with an IF