It's awful code. Do not use global variables for almost the same purpose but with invalid logics. You th code I gave above, press F11 and see, what it's compiled too.
Even better try this code for testing:
- !?FU(OnEveryDay);
- !#VA(dummy[66]:y);
- !#VA(firstLevelMons[9]:y);
- !!VR(firstLevelMonPtr:y):S(@firstLevelMons) +1;
- !!VR(firstLevelMons):C(MON_PIKEMAN)/(MON_DWARF)/(MON_GREMLIN)/(MON_IMP)/(MON_SKELETON)/(MON_TROGLODYTE)/(MON_GOBLIN)/(MON_GNOLL)/(MON_PIXIE);
- !!VR(mon:y):Sy(firstLevelMonPtr);
- !!IF:M^%(mon)^;
You'll see something like
- !!VRy80:S66 +1;
- !!VRy81:Syy80;
- !!IF:M^%y81^;