# Waiting only in the Abyss, no monsters.
#
# Usage: ./crawl --no-save --rc test/stress/abyss_short_wait.rc
#
# Wizmode is needed.

name = Abyss_waiter
species = mu
background = fi
weapon = flail
restart_after_game = false
show_more = false
autofight_stop = 0

Lua{
bot_start = true
last_turn = -1
local cmds = {string.char(9), 'u', 'k', 'l', 'n', '.'}
function ready()
  local esc = string.char(27)
  local eol = string.char(13)
  if you.turns() == 0 and bot_start then
    bot_start = false
    crawl.enable_more(false)
    crawl.set_sendkeys_errors(true)
    crawl.sendkeys("&Y" .. esc)
    crawl.sendkeys("&" .. string.char(20) ..
                   "debug.disable('confirmations')" .. eol ..
                   "debug.disable('death')" .. eol ..
                   "debug.disable('spawns')" .. eol .. esc)
    crawl.sendkeys("&Y" .. esc)
    crawl.sendkeys("&l27" .. eol)
    crawl.sendkeys("&" .. string.char(2))
    crawl.sendkeys("&G" .. eol)
  end
  if you.turns() < 1000 then
    crawl.sendkeys('.')
  else
    crawl.sendkeys("*qquit" .. eol .. esc .. esc)
  end
end
}
