[RMXP] Get Event ID from X and Y with Script Call

I'm working on a very aggravating system in XP, and I've run into a case where I know an X and a Y, and need to know the event ID on that tile. In MV, I'd use Get Location Info. But unless I've missed something, XP doesn't have an equivalent, and I'm not good enough with Ruby to spin one up.
Thanks! ☺️
It's already in Game_Map:
Code:
  #--------------------------------------------------------------------------
  # * Get Designated Position Event ID
  #     x          : x-coordinate
  #     y          : y-coordinate
  #--------------------------------------------------------------------------
  def check_event(x, y)
    for event in $game_map.events.values
      if event.x == x and event.y == y
        return event.id
      end
    end
  end

Code:
$game_map.check_event(x, y)
Oh my gosh, thank you so much! It works perfectly. 😀

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/rmxp-get-event-id-from-x-and-y-with-script-call.115239/