good thing you guys got that one about the integer bitfield states.
now learn how to use binary operators to save some more memory (maybe or not) and have more flexibility (definitely), here some more basic bitfield masking:
integer states=0xABCDEF01;//I am hexadecimal and many states at once.
integer maskl (integer l){return 0x7FFFFFFF>>

30-l);} //mask from 0 to l[0..30] (indexing starts at "0" and ends at "31"

integer maskr (integer r){return 0x80000000>>

31-r);} //mask from r[0..31] to 31 //I dont use this one. and i know that the "-" operation could be avoided by thinking more in machine code than in 4th class math.
integer marklr (integer l, integer r){return maskl(l)&maskl(r);}// mask from r[0..30] to l[0..31] (wich one is wich should not matter as long as only maskl is used in it.
integer marklr2 (integer l, integer r){return maskl(l)&maskr(r);}// mask from r[0..30] to l[0..32] //again i never needed this one.
integer masks (integer s){return maskl(s)&maskl(s);}//mask of the single bit s[0..30] //this saves one integer in every call and saves bytes if its going to be called often.
integer masks2 (integer s){return maskr(s)&maskr(s);}//mask of the single bit s[0..31] //alternative if you really need the leftmost byte like all others and not thread it as "special" as itwants to be.
if(states&maskl(5)){llOwnerSay("im in one of the first 6 states (idexing still starts at 0) "

;
if (states&maskl(3)) llOwnerSay("im in state 3 to be more exact"

;
else llOwnerSay("im in state 0,1,2,4, or 5 to be more exact"

;
}else if (states&masklr(30,31)) llOwnerSay("im in state 30 or state 31"

;
if (states^maskls(10,9))llOwnerSay("i am NOT in state 10 and not in state 9, but I am in any of the other 30 states (this also checks for the leftmost bit)"

;
And just as the "states" integer can be changed bitwise or with other math, the numbers in the procedure calls can be changed procedurally, and this is where the fun begins, especially in loops and recursive functions...
also, an ascii character can store 6 bits/states and a 16 bit character stores 15 bits/states, this may save a little memory if you want to store over 64 independent states AND already store bitfields that are over 2000 bytes long (like long tables or lists of keys) with some kind of base64 encoding, which WILL be an option when MONO increases the script size.
???Now, why could we possibly need over 64 independent states on one script???
For example, an NDS Pokemon (or anything with a battle hud) can be influenced by many different "conditions" (and by multiple combinations of them at once) that are basically "states" with special effects such as:
imprison,Torment,Confused,Substitute,Razor Wind/solar beam/skull bash/charge,Fly,Bounce,Dive,Shadow Force,Hyper Beam,Future Sight,Doom Desire,stockpile,rollout,Freeze,Paralysed,Burned,Poisoned,Attracted,Leech Seed,Curse,Flinch,Foresight,Nightmare,Mean look,Stealth Rock,Embargo,Worry Seed,Mud Sport,Gastro Acid,Water Sport,Flash Fire,Defense Curl,Focus energy,Minimize,Mist,Ingrain,Pursuit,Healing Wish,Lunar Dance,Spikes,Toxic Spikes,Baton Pass,Outrage,Badly Poisoned,Disable,taunt,Magma Storm,bind,clamp,fire spin,wrap,whirlpool,sandtomb,uproar,encore,Gravity,Sleep,bide,Mind Reader,Perish song,Wish,Counter,follow me,magic coat,helpinghand,Snatch,Grudge,Destiny Bond,Endure,Protect/detect,yawn,rest,Tailwind,Magnet Rise,Heal Block,Lucky Chant,Light Screen,Reflect,saveguard,Trick Room,weather
And many of them store a small value for a timer from 0 to 3, therefore they are more than 1 bit in size, so the "state" of a pokemon in battle actually eats 165 bit just to store what it is affected by at the moment, not counting its hitpoints, skills, IV, type, item....