Take time in between dungeons before revisiting. Here is the minimum set amount of time before one can revisit a dungeon to not violate the farming rule:
Level Dependent Outline for Visits (real life time) Character levels 1 through 5 - 1 visit per day Character levels 6 through 40 - 1 visit every 7 days. We refer to this as The Seven Day Rule.
The only recognized exemptions to this rule include:
- Revisiting an area while playing an alternate character.
- Scouting the area for a party that intends to enter the area immediately. For example, checking the cave entrance to make sure the party wont be ambushed.
- The attempted rescue of a slain character/party with the express purpose of retrieving the fallen and bringing them to safety. When revisiting an area for a rescue one should only fight monsters in the path of reaching the characters in need of rescue and no loot containers should be accessed.
- Travel through an outdoor area with the purpose of getting to the next transition point to continue on a journey to a further destination. For example, taking the most direct route through an area from transition A to transition B. This means not hitting all the spawns in the area beyond the most direct route.
- The previous visit was during a DM run event which brought the character(s) to the area.
As seen here, your example B is very similar (but not identical) to a specific exemption. "The previous visit was during a DM event which brought the character(s) to the area." So if you were in the dungeon before in the seven days, and lead there as part of a DM event, that visit does not count. This is different from you already being in the dungeon and encountering a DM while there. That does count as the weekly visit, unless the DM specifically says it doesn't. (The distinction being whether the DM lead you to the dungeon.)
As for having already been there within the seven days and a DM event takes you back, your example A, that can vary, and your best bet is to ask the DM running the event. If the location is specific to the DM's plot, the DM will probably hand-wave the visit, and it's treated exactly like example B, but in the other order. However, if the DM(s) was/were just leading you there because it was nearby or they thought they'd just add a little spice to the dungeon, they may decide not to lead you there after all and instead direct you somewhere less redundant.
I prowl the forum late at night in search of blood!