click module
This commit is contained in:
parent
0111f5fd5a
commit
3679c69022
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -11,7 +11,7 @@ instead (1.2.0) unstable; urgency=low
|
|||
* hook and inherit;
|
||||
* entered/left human friendly actions;
|
||||
* stead.cmd, stead.args added;
|
||||
* require added (module goto);
|
||||
* require added (modules: goto, xobj, input, click);
|
||||
* aligned width for themes/games dialog;
|
||||
|
||||
-- Peter Kosyh <p.kosyh@gmail.com> Tue, 01 Jun 2010 17:40:00 +0300
|
||||
|
|
|
@ -11,6 +11,7 @@ install:
|
|||
$(INSTALL) goto.lua $(STEADPATH)/goto.lua
|
||||
$(INSTALL) xobj.lua $(STEADPATH)/xobj.lua
|
||||
$(INSTALL) input.lua $(STEADPATH)/input.lua
|
||||
$(INSTALL) click.lua $(STEADPATH)/click.lua
|
||||
|
||||
uninstall:
|
||||
$(RM) $(STEADPATH)/stead.lua
|
||||
|
|
|
@ -8,3 +8,4 @@ install:
|
|||
copy goto.lua ..\bin\stead
|
||||
copy xobj.lua ..\bin\stead
|
||||
copy input.lua ..\bin\stead
|
||||
copy click.lua ..\bin\stead
|
||||
|
|
14
stead/click.lua
Normal file
14
stead/click.lua
Normal file
|
@ -0,0 +1,14 @@
|
|||
input.click = function(s, press, mb, x, y, px, py)
|
||||
if press and px then
|
||||
return "click "..px..','..py;
|
||||
end
|
||||
end
|
||||
|
||||
game.action = hook(game.action,
|
||||
function(f, s, cmd, x, y, ...)
|
||||
if cmd == 'click' then
|
||||
return call(here(), 'click', x, y);
|
||||
end
|
||||
if f then return f(s, cmd, x, y, unpack(arg)) end
|
||||
end)
|
||||
|
Loading…
Reference in a new issue