# For players who are prone to leave portals without picking up the
# loot, here is a way to avoid that: put the following snippet in your
# options file (init.txt or .crawlrc) and then macro the '<' key to
#  ===safe_upstairs (do it in-game by pressing '~' or Ctrl-D).

{
function safe_upstairs()
  if you.branch() == "Gauntlet" then
     crawl.formatted_mpr("Really leave this portal?", "prompt")
     local res = crawl.getch()
     if string.lower(string.char(res)) == "y" then
       crawl.sendkeys("<")
     end
  else
     crawl.sendkeys("<")
  end
end
}

######################################################################
# To automatically open the skill menu when starting a new game, add
# the following to your options file.

{
local need_skills_opened = true
function ready()
  if you.turns() == 0 and need_skills_opened then
    need_skills_opened = false
    crawl.sendkeys("m")
  end
end
}
