Medar

Repel and Go!

Sep 26th, 2015
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. local function repel_and_go(command)
  2.   local letter = nil
  3.   local spell = nil
  4.   for l, s in pairs(you.spell_table()) do
  5.     if s == "Deflect Missiles" then
  6.       letter = l
  7.       spell = s
  8.       break
  9.     end
  10.     if spell == "Repel Missiles" then
  11.       letter = l
  12.       spell = s
  13.     end
  14.   end
  15.   if spell and not you.status(spell:lower()) then
  16.     crawl.process_keys("z" .. letter .. command)
  17.   else
  18.     crawl.process_keys(command)
  19.   end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment