Jump to content

Ocenzurowano

Member
  • Posts

    9
  • Joined

  • Last visited

Awards

This user doesn't have any awards

Recent Profile Visitors

405 profile views

Ocenzurowano's Achievements

  1. I experimented a bit with this concept fo a fiew hours, and I think I've improve it a bit. It's still uses AutoHotKey as it's much more powerfull in doing complex macros than luamacro. Instead of writing new file on your hard drive (slow and dependent on hd speed), you can write autohotkey script that can take arguments when it's run. Here's how to do it: I assume that you already have AutoHotKey installed and luamacros downloaded. In your luamacros(where LuaMacros.exe is) folder, create new folder, call it "AHK" In this folder, create new autohotkey script, call it SendKeys.ahk. Use this code: #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. if 0 < 1 ; The left side of a non-expression if-statement is always the name of a variable. { MsgBox This script requires at least 1 incoming parameters but it only received %0%. ExitApp } Send %1% Return Save it, right click on it, and choose "Compile Script". This will create SendKeys.exe file. Now to the luamacros. Open LuaMacros.exe and paste this code: (remember to change id's of keyboards to something unique for each keyboard, from lmc_print_devices() command. lines 15,16) clear() lmc.minimizeToTray = true lmc_minimize() print('Version: ' .. lmc.version) print(_VERSION) SendKeysPath = ".//AHK//SendKeys.exe" function SendKeys(keys)--as keys you can pass anythink that can be used by autohotkey function Send lmc_spawn(SendKeysPath, keys) end --change those weird '194036CA' to something unique, in your keyboard id code lmc_device_set_name('KB1', '194036CA')--Your primary keyboard lmc_device_set_name('KB2', '184B7BA3')--Your secondary keybord, the one with macros lmc_print_devices() lmc_set_handler('KB2',function(button, direction) if (direction == 0) then return end -- ignore key up print('Callback for whole keyboard 2: button ' .. button .. ', direction '..direction) if(button == string.byte('N')) then lmc_spawn("notepad")-- run notepad program elseif ( button == string.byte('T')) then SendKeys("test")-- write "test" elseif ( button == string.byte('S')) then SendKeys("{Media_Play_Pause}") end end) Save it in the same folder as LuaMacros.exe, Call it "MyAwsomeMacros.lua". Now test it. Run this script in luamacro (it will hide itself to tray, that's expected). Try pressing "T" on your secondary keyboard. It should write "test". If it didn't try: running luamacros with administator privileges. check if SendKeys.exe is in AHK folder, and that AHK folder is in the same folder as LuaMacros.exe make sure that you correctly changed keyboards id's in luamacros script (lines 15,16) (optional but usefull) Autostart luamacros script create shortcut to LuaMacros.exe go to properties of this shortcut and add " -r MyAwsomeMacros.lua" to "target element" field, so you should have something like this "C:\Users\YourUserName\Documents\luamacros\LuaMacros.exe -r MyAwsomeMacros.lua" find your autostart folder (depending on version of your windows, google it if you dont know where it is) coppy paste shortcut to LuaMacros.exe to autostart folder. now your macros will be activated on system bootup How it's working: When you call "SendKeys()" function in our luamacros script, it's running SendKeys.exe which is our compiled autohotkey script. Path to SendKeys.exe is defined in line 8 "SendKeysPath = ".//AHK//SendKeys.exe" " But it's not just running the script, it's also passing argument with what script should do. It works just like command line arguments eg. "notepad.exe myFile.txt", opens file called myFile.txt in notepad. in the same way we are passing what keypresses should be simulated by autohotkey using SendKeys.exe "test". So now, what is in SendKeys.ahk. Not like most autohotkey scripts, we are not listening here for any key strokes. Basicly what really maters is only line 12 "Send %1%" it says "take first argument (%1%) and call Send function on it. Send function is basic autohotkey function that can simulate almost any keystrokes. Here's documentation. The if statement above is just a check if there is any argument passed to the script. If you want autoHotkey to use other functions beside Send it's just matter of adding if's to SendKeys.ahk. eg if you want to get pixel color under your mouse, you add if 1 = "GetPixel" { MouseGetPos, MouseX, MouseY PixelGetColor, color, %MouseX%, %MouseY% MsgBox The color at the current cursor position is %color%. } return before Send %1%, in line 11 of SendKeys.ahk and then, in MyAwsomeMacros.lua call SendKeys("GetPixel").
  2. on Vessel Im Ocenzurowano https://www.vessel.com/videos/LCoY5zfFfthis storage solution i sick! I love it. https://www.vessel.com/videos/JemZ8O7Hyand this thing i want to see hooked up to some 4k VR set.
  3. Im saving money to replace my 6 year old core 2 duo pc ... this would upgrade me from fx8350 witch I plan to buy
  4. Accent lighting kit - because i have to see all other cool thinks inside the case ;]
  5. Grate work on this 1M sub's! This channel is realy grate and techquickie is also awsom and wery helpfull!
×