>elseif (rt1A == 99 and rt1B == 3 or 4) then
This is the same as writing
elseif (
(
(t1A == 99 ) and ( rt1B == 3 )
)
or
4
)
The value 4 is the same as true, and anything or true is true, so this
isn't what you want. You aren't testing for rt1B == 4 at all. If you
want to compare with either of two values, write
elseif ( t1A == 99 and ( rt1B == 3 or rt1B == 4 ) )
Aandi Inston