Close
Showing results 1 to 10 of 92

Hybrid View

  1. #1

    Default Advanced Stuff

    Here only some quick comments/links for how to implement other more advanced features using HotKeyNet.

    Round-Robin

    Round robin can be implemented using the <Toggle> -command.


    For example defining '4' as a round-robin-key for the windows WoW1 - WoW5 can be done like:

    Code:
    <Hotkey 4>
    <Toggle>
        <SendLabel w1>
        <Key %trigger%>
       <Toggle>
         <SendLabel w2>
         <Key %trigger%>
       <Toggle>
         <SendLabel w3>
         <Key %trigger%>
       <Toggle>
         <SendLabel w4>
         <Key %trigger%>
       <Toggle>
         <SendLabel w5>
         <Key %trigger%>
    Focusless Targetless Leaderless Setup

    It is possible to implement an ftl-setup with HotKeyNet, but as it would be a little much to explain it in an introduction thread, i like to only link to the implementation and disscussion:
    [HotKeyNet] Implementing an FTL quite simple with templates

    Example of an specific implementation:I need a FTL mentor :/ to come

    Templates:

    In HKN if you have a script-block you want to reuse (with slight modifications) you could use Templates.
    To do this, you define templates with <Template> and call them with <ApplyTemplate>.

    Remark:

    The following I wrote for a user to explain Templates to him, so it might be alittle bit out of context here, but I think to cover some more advanced features of HKN, this could be usefull:


    The general idea of templates in HKN is, to give a way to simplify some definitions, that occure quite often, and have a very similar structure.

    One relay simple example:

    -Lets say you want to define multiple keys (1,2) which sends the key to w1 and always 'w' to w2 (and you don't know about keylists ).

    This could be done by defining a Template like:
    Code:
        
    <Template blubb>
         <Sendlabel w1>
            <Key %trigger%>
        <Sendlabel w2>
             <Key w>
    <EndTemplate>
    and calling it like:
    Code:
    <Hotkey 1>
        <ApplyTemplate blubb>
    
    <Hotkey 2>
        <ApplyTemplate blubb>
    What HotkeyNet now does, is simply when finding the '<ApplyTemplate blubb>' look if there a definition for the template with the name 'blubb' specified by <Template blubb> and if it finds such a definition, it substitutes the <ApplyTemplate blubb> with the text defined between <Template blubb> and <EndTemplate>.

    So on runtime, the tow Hotkey definitions would look like:
    Code:
    <Hotkey 1>
        <Sendlabel w1>
            <Key %trigger%>
        <Sendlabel w2>
             <Key w>
    
    <Hotkey 2>
            <Sendlabel w1>
            <Key %trigger%>
        <Sendlabel w2>
             <Key w>
    This is a real simple working example, but if this would be all templates could do, it wouldn't be so usefull.

    The next component of templates are parameters. With parameters you can, when calling a template with <ApplyTemplate> give the call some specific values, which then are used in the template.

    For this the calling syntax is:
    <ApplyTemplate name parameter1 parameter2 parameter3 ..>

    in the Template itself every occurence of %PARAMETER_NUMBER% is than replaced with the text for the parameter.

    Short example:
    <ApplyTemplate test This is a test>

    in the Template specified by <Template test> every occurence of:
    - %1% is replaced with This
    - %2% is replaced with is
    - %3% is replaced with a
    - %4% is replaced with test

    so the following
    Code:
    <Template sendkey>
       <Hotkey %1%>
           <SendLabel %2%>
                 <Key %3%>
    <EndTemplate>
    
    <ApplyTemplate 1 w1 u>
    would create the following Hotkey:
    Code:
    <Hotkey 1>
       <Sendlabel w1>
           <Key u>
    Now, one last important thing:
    Normaly HKN seperates parameters by a space.
    If you want to use a phrase as an Parameter which containes spaces (like f.e. a path) you have to capsulate it in "" like "This is a test".

    So to come back to the original code:
    <Template If>
    <If MouseIsOverWindowRect %1% %2%>
    <SendLabel %3%>
    <Key %4%>
    <EndTemplate>
    <Template Else>
    <If MouseIsOverWindowRect %1% %2%>
    <SendLabel %3%>
    <Key %4%>
    <EndTemplate>

    <Hotkey ScrollLockOn LButton>
    <ApplyTemplate If "WoW5" "88 299 125 58" "w3" "Numpad1">
    <ApplyTemplate ElseIf "WoW5" "88 367 125 58" "w3" "Numpad2">
    <ApplyTemplate ElseIf "WoW5" "88 433 125 58" "w3" "Numpad3">
    <Else>
    <SendFocusWin>
    <ClickMouse down %Trigger%>
    Lets have a look at what <ApplyTemplate If "WoW5" "88 299 125 58" "w3" "Numpad1"> does:

    it replaces the <ApplayTemplate If ...> with the block between <Template If> and <EndTemplate> and substitutes:
    - %1% with WoW5
    - %2% with 88 299 125 58
    - %3% with w3
    - %4% with Numpad1

    So the code in HKN would look like:
    <Hotkey ScrollLockOn LButton>
    <If MouseIsOverWinRect WoW5 88 299 125 58>
    <Sendlabel
    w3>
    <Key
    Numpad1>
    <ApplyTemplate ElseIf "WoW5" "88 367 125 58" "w3" "Numpad2">
    <ApplyTemplate ElseIf "WoW5" "88 433 125 58" "w3" "Numpad3">
    <Else>
    <SendFocusWin>
    <ClickMouse down %Trigger%>

    ( And of course
    <ApplyTemplate ElseIf ..> would then be replaced with the text of <Template ElseIf> )
    Last edited by olipcs : 09-10-2009 at 04:54 AM

Similar Threads

  1. Replies: 15
    Last Post: 03-18-2012, 08:42 AM
  2. Lotro Dual-Boxing Howto
    By KrunkTheMadMan in forum New Multi-Boxers & Support
    Replies: 2
    Last Post: 04-02-2009, 02:27 AM
  3. 2 Boxing, 1-60 guide RAF guide?
    By pinnacle2009 in forum New Multi-Boxers & Support
    Replies: 1
    Last Post: 03-18-2009, 07:59 PM
  4. Beginners Guide 2 Dual-Boxing (3,4,5 boxing)
    By piejoh77 in forum New Multi-Boxers & Support
    Replies: 78
    Last Post: 03-12-2009, 03:17 AM
  5. Dual-Boxing / Multi-Boxing leveling guide
    By Ziie in forum General WoW Discussion
    Replies: 3
    Last Post: 09-06-2007, 12:45 PM

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •