steed/stead/click.lua

23 lines
529 B
Lua
Raw Normal View History

2010-06-23 15:09:33 +03:00
input.click = stead.hook(input.click,
2010-06-16 12:41:03 +03:00
function(f, s, press, mb, x, y, px, py, ...)
2010-06-07 16:53:00 +03:00
if press and px then
return "click "..px..','..py;
end
2010-06-16 12:41:03 +03:00
return f(s, press, mb, x, y, px, py, unpack(arg))
end)
2010-06-07 16:53:00 +03:00
2010-06-23 15:09:33 +03:00
game.action = stead.hook(game.action,
2010-06-07 16:53:00 +03:00
function(f, s, cmd, x, y, ...)
if cmd == 'click' then
2010-06-09 13:19:11 +03:00
if here().click then
return call(here(), 'click', x, y, unpack(arg));
end
if game.click then
return call(game, 'click', x, y, unpack(arg));
end
return nil,true
2010-06-07 16:53:00 +03:00
end
2010-06-16 08:05:23 +03:00
return f(s, cmd, x, y, unpack(arg))
2010-06-07 16:53:00 +03:00
end)
2010-07-06 13:15:27 +03:00
-- vim:ts=4