Page 1 of 1

LuaMacros in Minecraft

Posted: 10 Jun 2016, 01:37
by mistr_k
I'm trying to get LuaMacros to work in Minecraft, but the keypresses seem to just open the inventory (which is mapped to the 'e' key)

This is what I have:

Code: Select all

-- assign logical name to macro keyboard
lmc_device_set_name('MACROS', 'D33524F')

-- define callback for whole device
lmc_set_handler('MACROS',function(button, direction)
  if (direction == 1) then return end -- ignore down
  if (button == 27) then lmc_send_keys('t/Set Time 1200{ENTER}')
  elseif (button == 9) then lmc_send_keys('t/weather clear{ENTER}')
  elseif (button == 187) then lmc_send_keys('tHowdy{ENTER}')
  elseif (button == 111) then lmc_send_keys('tGood Morning!{ENTER}')
  elseif (button == 106) then lmc_send_keys('t/Set Time 1200{ENTER}')
  elseif (button == 8) then lmc_send_keys('t/Set Time 1200{ENTER}')
  elseif (button == 103) then lmc_send_keys('t/Set Time 1200{ENTER}')
  elseif (button == 104) then lmc_send_keys('t/Set Time 1200{ENTER}')
  elseif (button == 105) then lmc_send_keys('t/Set Time 1200{ENTER}')
  elseif (button == 109) then lmc_send_keys('t/Set Time 1200{ENTER}')
  elseif (button == 100) then lmc_send_keys('t/Set Time 1200{ENTER}')
  elseif (button == 101) then lmc_send_keys('t/Set Time 1200{ENTER}')
  elseif (button == 102) then lmc_send_keys('t/Set Time 1200{ENTER}')
  elseif (button == 107) then lmc_send_keys('t/Set Time 1200{ENTER}')
  elseif (button == 97) then lmc_send_keys('t/Set Time 1200{ENTER}')
  elseif (button == 98) then lmc_send_keys('t/Set Time 1200{ENTER}')
  elseif (button == 99) then lmc_send_keys('t/Set Time 1200{ENTER}')
  elseif (button == 13) then lmc_send_keys('t/Set Time 1200{ENTER}')
  elseif (button == 96) then lmc_send_keys('t/Set Time 1200{ENTER}')
  elseif (button == 110) then lmc_send_keys('t/Set Time 1200{ENTER}')

  else lmc_say('Not yet assigned')
  end
end)
If you're not familar with Minecraft commands, 't' is the chat key, and the commands are after the '/'

So I want to make Minecraft think that I pressed the 't' key, chat or do a command, then make Minecraft think I pressed the enter key at the end.

Thanks!

Re: LuaMacros in Minecraft

Posted: 10 Jun 2016, 07:54
by admin
My only advise would be to check your script e.g. in Notepad to see if it's well written (seems to be).
Then issues can be Minecraft specifix but I don't have it installed.