Jump to content

Need help with lua script

Nalyd217

I'm trying out the lua macros program and  i have the extreme basics down for the language (namely how to make it say "lol"). What i was wondering though is one of 2 things. Either A) I need a way for it to be able to open a batch file from a key press (right now i can only get it to open .jar's and certain .exe's). Or B) I need a way to sequentially open cmd, type something, and then press enter, all from one keypress.

 

(below is the default "beginner" lua script that ive modified (and also line 11 does not work))

Quote

-- assign logical name to macro keyboard
lmc_assign_keyboard('MACROS');

-- define callback for whole device
lmc_set_handler('MACROS',function(button, direction)
  if (direction == 1) then return end  -- ignore down
  if     (button == string.byte('C')) then lmc_spawn("calc")
  elseif (button == string.byte('N')) then lmc_spawn("notepad", "C:\\test.txt")
  elseif (button == string.byte('H')) then lmc_send_keys('lol=888000000ly7uththuuu7=?!?!?!?')
  elseif (button == string.byte('G')) then os.execute("start launcher.jar")
  elseif (button == string.byte('B')) then os.execute("start cmd.exe")
  elseif (button == ('27')) then os.execute("start cmd.exe")
  else print('Not yet assigned: ' .. button)
  end
end)
            

EDIT: I have figured out the above issue. However now i need to figure out how to send 2 key-presses from one key-press (i.e. I press "1" which would send "2" and "3" simultaneously 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×