Help with autorun / switch activation

OK -

I want this event to check if two different switches are on, and if so, to activate a third switch.

I want this event to run each time the player enters the map to check if the two precursor switches are on.

I have it set to autorun, but it gets stuck in an infinite loop. What is the best way to do this?

Capture7.PNG
Do not use the Exit event processing, since it only does is take the game interpreter of the page to the last line.

Use the "Erase event", so every time you enter the map, this event will play once and be erased.
When you return to this map, the event will be there again.
You've got 2 switch conditions in the event's page. Put both switches in there, the switch activation in the event's page (automatic), and a page 2 with the only condition being that third swich being on.
Thanks guys -

Both responses work and make sense.
instead of if swithc x is ON and if switch Y is one, make 1 condition:

if: script: $gameSwitches.value(x) && $gameSwitches.value(y)
do this
end

this checks if both switchs are ON, there is also a plugin to make it shorter
found here. work with variables, switches, items, armor etc if you need it alot.
than that plugin makes things easier.
You can use the 2 built in switch checks to the left, put the required switches there and when the conditions are met the event will autorun, just make a "self switch A: On" at the end and second blank page which requires said self switch to end it, no need to manually check everytime.
You can use the 2 built in switch checks to the left, put the required switches there and when the conditions are met the event will autorun, just make a "self switch A: On" at the end and second blank page which requires said self switch to end it, no need to manually check everytime.
Why involve a self-switch, when the page 2 condition can be the regular switch that's turned on by page 1?

Original thread: https://forums.rpgmakerweb.com/threads/help-with-autorun-switch-activation.121647/