how to open multiple .lua with luamacro?

Announcements, questions
Post Reply
afafok
Posts: 4
Joined: 03 Feb 2018, 09:56

how to open multiple .lua with luamacro?

Post by afafok » 03 Feb 2018, 10:02

I have 3 keyboards, i plan the 2 is for macro, but i dont know how to open multiple .lua file with luamacro?

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: how to open multiple .lua with luamacro?

Post by admin » 05 Feb 2018, 10:52

Why do you need multiple files?
You can open just one, if it is too big, you can include other files.
Petr Medek
LUAmacros author

afafok
Posts: 4
Joined: 03 Feb 2018, 09:56

Re: how to open multiple .lua with luamacro?

Post by afafok » 05 Feb 2018, 15:09

admin wrote:
05 Feb 2018, 10:52
Why do you need multiple files?
You can open just one, if it is too big, you can include other files.
How to get separate function with 2 macro keyboard in just 1 file? I dont know how to code those

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: how to open multiple .lua with luamacro?

Post by admin » 06 Feb 2018, 09:26

You have multiple handling functions and multiple lmc_set_handler calls.
See e.g. https://github.com/me2d13/luamacros/blo ... rc/lmc.lua
Petr Medek
LUAmacros author

afafok
Posts: 4
Joined: 03 Feb 2018, 09:56

Re: how to open multiple .lua with luamacro?

Post by afafok » 06 Feb 2018, 10:43

admin wrote:
06 Feb 2018, 09:26
You have multiple handling functions and multiple lmc_set_handler calls.
See e.g. https://github.com/me2d13/luamacros/blo ... rc/lmc.lua
please help me man, first please look at my code here: https://pastebin.com/GLnZeT0y

my problem is:
lua macro can define both keyboard, but why the Photoshop keyboard keep writing the 'key' in keypressed2.txt, which is the task of Premiere keyboard,so both my keyboard is writing in keypressed2.txt, what i really want is... the Photoshop keyboard writing the 'key' in keypressed.txt, and the Premiere keyboard writing the key in keypressed2.txt...

my question:
whats wrong with my code?

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: how to open multiple .lua with luamacro?

Post by admin » 07 Feb 2018, 09:47

You named both functions sendToAHK so 2nd one replace the first one
Petr Medek
LUAmacros author

afafok
Posts: 4
Joined: 03 Feb 2018, 09:56

Re: how to open multiple .lua with luamacro?

Post by afafok » 08 Feb 2018, 10:30

admin wrote:
07 Feb 2018, 09:47
You named both functions sendToAHK so 2nd one replace the first one
bro, u are so good bro!!!

Thx for helping me out bro!!!

Tiabo
Posts: 1
Joined: 14 Jun 2020, 04:59

Re: how to open multiple .lua with luamacro?

Post by Tiabo » 14 Jun 2020, 05:05

I am just beging with programming Lua MACRO
but it seems that you might be able to declare the function for the each keyboard. In this case i am intercepting obspad, but one might use a third and forth keyboard, and program it in the same .lua

Code: Select all

lmc_device_set_name('keyboard','2670AE8')
[b]
lmc_device_set_name('obspad','FD00948')[/b]
lmc_print_devices()

[b]
lmc_set_handler('obspad', function(button,direction)
[/b]
  if (direction == 1) then return end   
  ......
  ......
  -- zoom 4
  elseif (button == 51) then
    lmc_send_keys('+{F6}', 50)
    lmc_send_keys('^{P}', 50)
  end
end
)    
                 

Post Reply