Comparing coordinates for an event

I had searched around the forums but couldn't find an answer directly for MV.

I have a barrel that I want to push against some rocks and then detonate. 

I have all that setup, I am just trying to figure out how I can check to see if the barrel, which is an event, is in a certain spot on the map. 

So basically in the barrel's event page it would be 

If barrel coordinates are equal to destination coordinates, fire this event.

I just can't figure out how to set the destination coordinates for the event to check against.

I was trying to do the script call $game_map.events but I keep getting $game_map is not defined 
that is because that script call is from Ace/Ruby and not from MV/javascript.


But why are you using a script call when you want to do everything with events anyway? just use control variables to load the coordinates into variables and compare the values with conditional branches.
I found it. Thanks for your help!

Original thread: https://forums.rpgmakerweb.com/threads/comparing-coordinates-for-an-event.48695/