Advertisement
crispyking

CJR Lotro dual-box HotKeyNet script

Feb 1st, 2016
551
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.20 KB | None | 0 0
  1. // HotKeyNet LoTRO config
  2. // GROUP
  3.  
  4. // vim: ts=4
  5. //<IncludeFile "C:\Users\cc\Documents\The Lord of the Rings Online\common.hkn">
  6. //<IncludeFile "C:\Users\cc\Documents\The Lord of the Rings Online\lotro-common.hkn">
  7. //<IncludeFile "C:\Users\cc\Documents\The Lord of the Rings Online\lotro-group.hkn">
  8. //<IncludeFile "C:\Users\cc\Documents\The Lord of the Rings Online\lotro-1080.hkn">
  9.  
  10. //=========================================================================
  11. // common.hkn
  12. // HotKeyNet common configuration for all profiles
  13.  
  14. // vim: ts=4
  15. // Vim syntax file: http://pastebin.com/rbTLU23Y
  16.  
  17. <Label WDEFAULT local sendfocuswin>
  18.  
  19. //=========================================================================
  20. // Mac compatible keyboard:
  21. // WindowsLogo key remap -> Ctrl
  22. // NB: happens for ALL windows, all the time, except for UltraVNC ("tringa")
  23. <UseKeyAsModifier LWin>
  24. // remap all LWin -> Ctrl keys
  25. <KeyList alphanum A-Z, 0-9>
  26. <Hotkey LWin alphanum >
  27. <If ActiveWinIsNot "tringa">
  28. <SendLabel WDEFAULT>
  29. <Key Ctrl %TriggerMainKey%>
  30. <Else>
  31. <SendLabel WDEFAULT>
  32. <Key %TRIGGER%>
  33.  
  34. // remap all LWin -> Ctrl mouse buttons
  35. <KeyList buttons LButton,RButton,MButton>
  36. <Hotkey LWin buttons >
  37. <If ActiveWinIsNot "tringa">
  38. <SendLabel WDEFAULT>
  39. <KeyDown Ctrl>
  40. <ClickMouse %TriggerMainKey%>
  41. <KeyUp Ctrl>
  42. <Else>
  43. <SendLabel WDEFAULT>
  44. <Key %TRIGGER%>
  45.  
  46.  
  47. //=========================================================================
  48. // lotro-common.hkn
  49. // HotKeyNet config for dual-boxing LOTRO with different classes.
  50. // COMMON
  51.  
  52. // vim: ts=4
  53. // Vim syntax file: http://pastebin.com/rbTLU23Y
  54.  
  55. // It is optimized for playing different classes and all bindings work
  56. // equally well from either window.
  57. // On a fast machine it usually doesn't cause a window focus switch
  58. // so you can play with one window full-screen.
  59.  
  60. // You'll almost certainly need to edit the script for your own key bindings:
  61.  
  62. // HOTKEYS ASSIGNED:
  63. // Alt W Rename the current window. Press multiple times to toogle.
  64. // You'll need to have one window called "LotRO MAIN",
  65. // and one called "LotRO AUX".
  66. // Alt Q Set up for Full-screen mode (adjust in-game resolution first)
  67. // Alt A Set up for Windowed mode
  68. // F1-F6 These are intercepted and sent only to the "other" window,
  69. // (where they target the second fellowship member first).
  70. // Shift F Turn on FOLLOWING (the second fellowship member).
  71. // FOLLOWING HOTKEYS: These are sent to both windows when FOLLOWING is on:
  72. // Shift-D Mount/Unmount
  73. // Space Jump
  74. // Plus Equip first cosmetic outfit
  75. // Shift Plus Equip second cosmetic outfit
  76. // Ctrl Plus Equip third cosmetic outfit
  77. // Alt Plus Equip fourth cosmetic outfit
  78. // Ctrl Tab Toggle walk/run
  79. // Shift S Turn off FOLLOWING (by moving imperceptibly)
  80. // Ctrl-W Send a 'W' to the OTHER window
  81. // "OTHER" HOTKEYS: These are for controlling just the other character
  82. // Ctrl-E Switch to the other window and move forward (while held)
  83. // Ctrl-Backquote Select nearest object and Use it
  84.  
  85.  
  86. // HOTKEYS ASSUMED:
  87. // E A movement key. Used to stop following.
  88. // Ctrl F2-6 Target second-sixth fellowship member.
  89.  
  90. // HKN Settings (diff from defaults):
  91. // General:
  92. // X Start hidden
  93. // - Disable foreground lock
  94. // - Check for newer version
  95. // Send Mode Settings
  96. // X Use new SendWinM and SendWinMF
  97. // - Attach threads for SendInput
  98. // X Clear modifier before executing hotkey
  99. //
  100.  
  101.  
  102. // Define labels for LOTRO windows
  103. <Label WMAIN local SendWin "LoTRO MAIN">
  104. <Label WAUX local SendWin "LoTRO AUX">
  105.  
  106. // Use this a "subroutine" hotkey
  107. // (work-around for not having compound or nested IF statements)
  108. <UseKeyAsModifier Junja>
  109.  
  110.  
  111. //=========================================================================
  112. // WINDOW RENAME
  113.  
  114. // Rename Active Window
  115. <Hotkey Alt W>
  116. <If ActiveWinIs "The Lord of the Rings Online">
  117. // <RenameFromPath "D:\Program Files (x86)\Turbine\The Lord of the Rings Online\lotroclient.exe" "LoTRO MAIN">
  118. <RenameWin "The Lord of the Rings Online" "LoTRO MAIN">
  119. <Else If ActiveWinIs "LoTRO MAIN">
  120. <RenameWin "LoTRO MAIN" "LoTRO AUX">
  121. <Else If ActiveWinIs "LoTRO AUX">
  122. <RenameWin "LoTRO AUX" "LoTRO MAIN">
  123. <Else>
  124. <SendLabel WDEFAULT>
  125. <Key %TRIGGER%>
  126. <EndIf>
  127.  
  128. //=========================================================================
  129. // WINDOW MINIMIZE/MAXIMIZE TOOLS
  130. // NB: These are done in the solo/group files
  131.  
  132. //=========================================================================
  133. // ALWAYS-ON HOTKEYS
  134. // NB: These are done in the solo/group files
  135.  
  136.  
  137. //=========================================================================
  138. // FOLLOWING -- hotkeys sent only if FOLLOWING is On.
  139.  
  140. // Turn FOLLOWING On
  141. <Hotkey Shift F>
  142. <SetVar FOLLOWING "On">
  143. <If ActiveWinIs "LoTRO MAIN">
  144. <SendLabel WAUX>
  145. <Key Ctrl F2> // target first fellow
  146. <Key Shift Tab> // follow (keybinding)
  147. // <Text /follow><Key Enter> // follow
  148. // don't send this: it delays enough to cause a window-focus switch
  149. // <Text /f Now Following ;target><Key Enter>
  150. <Restore>
  151. <Else If ActiveWinIs "LoTRO AUX">
  152. <SendLabel WMAIN>
  153. <Key Ctrl F2> // target first fellow
  154. <Key Shift Tab> // follow (keybinding)
  155. // <Text /follow><Key Enter> // follow
  156. // <Text /f Now Following ;target><Key Enter>
  157. <Restore>
  158. <Else>
  159. <SendLabel WDEFAULT>
  160. <Key %TRIGGER%>
  161. <EndIf>
  162.  
  163. // Turn FOLLOWING Off
  164. <Hotkey Shift S>
  165. <SetVar FOLLOWING "Off">
  166. <If ActiveWinIs "LoTRO MAIN">
  167. <SendLabel WAUX>
  168. <Key E> // move forward (unfollow)
  169. // <Text /f Stopped following><Key Enter>
  170. <Restore>
  171. <Else If ActiveWinIs "LoTRO AUX">
  172. <SendLabel WMAIN>
  173. <Key E> // move forward (unfollow)
  174. // <Text /f Stopped following><Key Enter>
  175. <Restore>
  176. <Else>
  177. <SendLabel WDEFAULT>
  178. <Key %TRIGGER%>
  179. <EndIf>
  180.  
  181.  
  182.  
  183. // OtherHotKeyFollow: Send a hotkey to the other window and then follow
  184. <Template OtherHotKeyFollow>
  185. <HotKey Junja %1%> // my subroutine fake-keybinding
  186. <If ActiveWinIs "LoTRO MAIN">
  187. <Wait 1000> // delay follower so it looks natural
  188. <SendLabel WAUX>
  189. <Key Ctrl F2> // target first fellow
  190. <Key %1%> // send the key
  191. <Key Shift Tab> // follow (keybinding)
  192. // <Text /follow><Key Enter> // resume following
  193. <Restore>
  194. <Else If ActiveWinIs "LoTRO AUX">
  195. <Wait 1000> // delay follower so it looks natural
  196. <SendLabel WMAIN>
  197. <Key Ctrl F2> // target first fellow
  198. <Key %1%> // send the key
  199. <Key Shift Tab> // follow (keybinding)
  200. // <Text /follow><Key Enter> // resume following
  201. <Restore>
  202. <EndIf>
  203. <EndTemplate>
  204.  
  205. // OtherHotKeyFollow2: Same as above but for double-keystroke key binding
  206. <Template OtherHotKeyFollow2>
  207. <HotKey Junja %1% %2%>
  208. <If ActiveWinIs "LoTRO MAIN">
  209. <Wait 1000> // delay follower so it looks natural
  210. <SendLabel WAUX>
  211. <Key Ctrl F2> // target first fellow
  212. <Key %1% %2%> // send the key
  213. <Key Shift Tab> // follow (keybinding)
  214. // <Text /follow><Key Enter> // resume following
  215. <Restore>
  216. <Else If ActiveWinIs "LoTRO AUX">
  217. <Wait 1000> // delay follower so it looks natural
  218. <SendLabel WMAIN>
  219. <Key Ctrl F2> // target first fellow
  220. <Key %1% %2%> // send the key
  221. <Key Shift Tab> // follow (keybinding)
  222. // <Text /follow><Key Enter> // resume following
  223. <Restore>
  224. <EndIf>
  225. <EndTemplate>
  226.  
  227. // OtherHotKeyFollow22: Same as above but with work-around for walk/run
  228. // walk/run toggle doesn't take effect until the next voluntary movement
  229. <Template OtherHotKeyFollow22>
  230. <HotKey Junja %1% %2%>
  231. <If ActiveWinIs "LoTRO MAIN">
  232. <Wait 1000> // delay follower so it looks natural
  233. <SendLabel WAUX>
  234. <Key %1% %2%> // send the key
  235. <Key E> // voluntary movement
  236. <Key Ctrl F2> // target first fellow
  237. <Key Shift Tab> // re-follow (keybinding)
  238. <Restore>
  239. <Else If ActiveWinIs "LoTRO AUX">
  240. <Wait 1000> // delay follower so it looks natural
  241. <SendLabel WMAIN>
  242. <Key %1% %2%> // send the key
  243. <Key E> // voluntary movement
  244. <Key Ctrl F2> // target first fellow
  245. <Key Shift Tab> // re-follow (keybinding)
  246. <Restore>
  247. <EndIf>
  248. <EndTemplate>
  249.  
  250. // OtherHotkey: Send a keystroke command to the other window
  251. <Template OtherHotKey>
  252. <Hotkey Junja %1%>
  253. <If ActiveWinIs "LoTRO MAIN">
  254. <Wait 1000> // delay follower so it looks natural
  255. <SendLabel WAUX>
  256. <Key %1%>
  257. <Restore>
  258. <Else If ActiveWinIs "LoTRO AUX">
  259. <Wait 1000> // delay follower so it looks natural
  260. <SendLabel WMAIN>
  261. <Key %1%>
  262. <Restore>
  263. <EndIf>
  264. <EndTemplate>
  265.  
  266. // OtherHotKey2: Same as above but for double-keystroke key binding
  267. <Template OtherHotKey2>
  268. <Hotkey Junja %1% %2%>
  269. <If ActiveWinIs "LoTRO MAIN">
  270. <Wait 1000> // delay follower so it looks natural
  271. <SendLabel WAUX>
  272. <Key %1% %2%>
  273. <Restore>
  274. <Else If ActiveWinIs "LoTRO AUX">
  275. <Wait 1000> // delay follower so it looks natural
  276. <SendLabel WMAIN>
  277. <Key %1% %2%>
  278. <Restore>
  279. <EndIf>
  280. <EndTemplate>
  281.  
  282.  
  283. // Define FOLLOW commands (for both windows)
  284. <ApplyTemplate OtherHotKey2 Shift D> // mount/unmount
  285. <ApplyTemplate OtherHotKeyFollow Space> // jump
  286. <ApplyTemplate OtherHotKey Plus> // equip first cosmetic outfit
  287. <ApplyTemplate OtherHotKey2 Shift Plus> // equip second cosmetic outfit
  288. <ApplyTemplate OtherHotKey2 Ctrl Plus> // equip third cosmetic outfit
  289. <ApplyTemplate OtherHotKey2 Alt Plus> // equip fourth cosmetic outfit
  290. <ApplyTemplate OtherHotKeyFollow22 Ctrl Tab> // toggle run/walk
  291.  
  292. // here is the actual key binding...
  293. // NB: these keys will no longer key-repeat on other (non-LOTRO) windows.
  294. <Hotkey Shift D; Space; Plus; Shift Plus; Ctrl Plus; Alt Plus; Ctrl Tab>
  295. <SendLabel WDEFAULT>
  296. <Key %TRIGGER%> // send key to current window
  297. <If FOLLOWING Is "On">
  298. <DoHotKey HotKey Junja %TRIGGER%>
  299. <EndIf>
  300.  
  301.  
  302. //=========================================================================
  303. // OTHER -- hotkeys sent only to the other window
  304.  
  305.  
  306. // Send a E movement key to the other window
  307. <MovementHotkey Ctrl E>
  308. <If ActiveWinIs "LoTRO MAIN">
  309. <SendLabel WAUX>
  310. <Key E>
  311. //<Restore>
  312. <Else If ActiveWinIs "LoTRO AUX">
  313. <SendLabel WMAIN>
  314. <Key E>
  315. //<Restore>
  316. <Else>
  317. <SendLabel WDEFAULT>
  318. <Key %TRIGGER%>
  319. <EndIf>
  320.  
  321. // Target nearest object and use it
  322. // Oem8 == backquote
  323. <Hotkey Ctrl Oem8>
  324. <If ActiveWinIs "LoTRO MAIN">
  325. <SendLabel WAUX>
  326. <Key Shift V> // Target Nearest Item
  327. <Key Shift C> // Use Selection
  328. <Restore>
  329. <Else If ActiveWinIs "LoTRO AUX">
  330. <SendLabel WMAIN>
  331. <Key Shift V> // Target Nearest Item
  332. <Key Shift C> // Use Selection
  333. <Restore>
  334. <Else>
  335. <SendLabel WDEFAULT>
  336. <Key %TRIGGER%>
  337. <EndIf>
  338. //=========================================================================
  339. // lotro-group.hkn
  340. // HotKeyNet LoTRO GROUP keybindings
  341.  
  342. // vim: ts=4
  343.  
  344. //=========================================================================
  345. // ALWAYS-ON HOTKEYS
  346.  
  347. // Skills targetting the other player
  348. <Hotkey F1>
  349. <If ActiveWinIs "LoTRO MAIN">
  350. <SendLabel WAUX>
  351. <Key Shift F4> // Mel: assist Boph
  352. <Key %TRIGGER%>
  353. <Restore>
  354. <Else If ActiveWinIs "LoTRO AUX">
  355. <SendLabel WMAIN>
  356. <Key Shift F4> // Daer: assist Boph
  357. <Key %TRIGGER%>
  358. <Restore>
  359. <Else>
  360. <SendLabel WDEFAULT>
  361. <Key %TRIGGER%>
  362. <EndIf>
  363.  
  364. <Hotkey F2-F6>
  365. <If ActiveWinIs "LoTRO MAIN">
  366. <SendLabel WAUX>
  367. <Key Ctrl F3> // Mel: target TANK
  368. <Key %TRIGGER%>
  369. <Restore>
  370. <Else If ActiveWinIs "LoTRO AUX">
  371. <SendLabel WMAIN>
  372. <Key Shift F4> // Daer: assist Boph
  373. <Key %TRIGGER%>
  374. <Restore>
  375. <Else>
  376. <SendLabel WDEFAULT>
  377. <Key %TRIGGER%>
  378. <EndIf>
  379. //=========================================================================
  380. // lotro-1080.hkn
  381. // HotKeyNet LoTRO 1920x1080 config
  382. // vim: ts=4
  383.  
  384. //=========================================================================
  385. // WINDOW MINIMIZE/MAXIMIZE TOOLS
  386. // NB: do this in solo/group file
  387.  
  388. // Window Frame dimensions:
  389. // borders: 8px
  390. // "caption" (title bar): 30px
  391. // LoTRO windowed size setting doesn't include the frame unless it is
  392. // larger than the display resolution in which case it is reduced to fit (Grr)
  393.  
  394. // Another option (doesn't work)
  395. //<SetFramelessWinSizeWithSimulatedMouse 1920 1080 100>
  396.  
  397. // Lotro doesn't reset its resolution even when using SimMouse
  398.  
  399. // Windowed Full Screen 1920x1080
  400. // ## This is now unnecessary:
  401. // set to same size/position as when 1920x1080 is selected:
  402. // 1904x1042 @ 8,30
  403. // NB: set in-game Screen Mode to Windowed Full Screen first
  404. <Hotkey Alt Q>
  405. <If ActiveWinIs "LoTRO MAIN">
  406. <TargetWin "LoTRO MAIN">
  407. <SetWinFrame None>
  408. // <SetWinRect 8 32 1904 1042 SimMouse>
  409. <SetWinRect 0 0 1920 1080 SimMouse>
  410. <SendLabel WMAIN>
  411. <Text /ui layout load f><Key Enter>
  412. <Restore>
  413. <TargetWin "LoTRO AUX">
  414. <SetWinPos 612 32>
  415. <Else If ActiveWinIs "LoTRO AUX">
  416. <TargetWin "LoTRO AUX">
  417. <SetWinFrame None>
  418. // <SetWinRect 8 32 1904 1042 SimMouse>
  419. <SetWinRect 0 0 1920 1080 SimMouse>
  420. <SendLabel WAUX>
  421. <Text /ui layout load f><Key Enter>
  422. <Restore>
  423. <TargetWin "LoTRO MAIN">
  424. <SetWinPos 612 32>
  425. <Else>
  426. <SendLabel WDEFAULT>
  427. <Key %TRIGGER%>
  428. <EndIf>
  429.  
  430. // Windowed 1280x720 (1296x758 incl frame)
  431. // NB: drag the window frame to trigger in-game resolution change
  432. <Hotkey Alt A>
  433. <If ActiveWinIs "LoTRO MAIN">
  434. <TargetWin "LoTRO MAIN">
  435. <SetWinFrame Caption ThickFrame Border WindowEdge>
  436. <SetWinRect 0 322 1296 758 SimMouse>
  437. <TargetWin "LoTRO AUX">
  438. <SetWinFrame Caption ThickFrame Border WindowEdge>
  439. <SetWinRect 624 0 1296 758 SimMouse>
  440. <SendLabel WMAIN, WAUX>
  441. <Text /ui layout load w><Key Enter>
  442. <Restore>
  443. <Else If ActiveWinIs "LoTRO AUX">
  444. <TargetWin "LoTRO MAIN">
  445. <SetWinFrame Caption ThickFrame Border WindowEdge>
  446. <SetWinRect 0 322 1296 758 SimMouse>
  447. <TargetWin "LoTRO AUX">
  448. <SetWinFrame Caption ThickFrame Border WindowEdge>
  449. <SetWinRect 624 0 1296 758 SimMouse>
  450. <SendLabel WMAIN, WAUX>
  451. <Text /ui layout load w><Key Enter>
  452. <Restore>
  453. <Else>
  454. <SendLabel WDEFAULT>
  455. <Key %TRIGGER%>
  456. <EndIf>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement