void main()
{
    int nExhausted = GetLocalInt(GetModule(), "nBeetleEncountersExhausted");
    SetLocalInt(GetModule(), "nBeetleEncountersExhausted", nExhausted + 1);
    //SendMessageToPC(GetFirstPC(), "Beetle Encounters exhausted: " + IntToString(nExhausted + 1));
    if (nExhausted + 1 == 5)
    {
        object oPC = GetFirstPC();
        while (GetIsObjectValid(oPC) == TRUE)
        {
            if (GetLocalInt(GetModule(), "nTookBeetleQuest") == 1)
            {
                AddJournalQuestEntry("je_beetleproblem", 20, oPC);
            }
            oPC = GetNextPC();
        }
    }
}
