DRL > Requests For Features
Add runmode binding to insert (numpad 0)
Simon-v:
--- Quote from: Evilpotatoe on February 22, 2013, 09:35 ---While I'm at it, is it possible to create a binding like the following ?
--- Code: ---["3"] = function()
if not command.quick_weapon('ashotgun') then
if not command.quick_weapon('shotgun') then
ui.msg("No cool weapon :(");
end
end
end,
--- End code ---
--- End quote ---
Nope. I tried this with the new beta, and it doesn't work.
--- Code: ---["1"] = function()
for i, item in pairs{"uscythe", "spear ", "ubutcher", "chainsaw", "knife"} do
if command.quick_weapon(item) then
return true
end
end
ui.msg("You don't have a melee weapon!")
return false
end,
--- End code ---
It just aborts after the first one in the list fails. Which is strange, because this works:
--- Code: ---["SHIFT+M"] = function()
for i, item in pairs{"smed", "lmed"} do
if command.use_item(item) then
return true
end
end
ui.msg("No medpacks left!")
return false
end,
["SHIFT+H"] = function()
for i, item in pairs{"hphase", "phase", "umodstaff"} do
if command.use_item(item) then
return true
end
end
ui.msg("No phases left!")
return false
end,
--- End code ---
I call bug. Pity, would've been fun.
shark20061:
That's because quick_weapon doesn't return whether or not it works like use_item does.
Simon-v:
--- Quote from: shark20061 on February 23, 2013, 11:57 ---That's because quick_weapon doesn't return whether or not it works like use_item does.
--- End quote ---
That's no good! Will it do that?
A way to suppress the failed wield messages would also help, i suppose.
Navigation
[0] Message Index
[*] Previous page
Go to full version