Close
Page 1 of 2 1 2 LastLast
Showing results 1 to 10 of 12
  1. #1

    Default [FTL] Perl Script to Generate Keyclone Hotstrings and /target

    I use a Perl script to generate all my .kcl files and my /target line for FTL. Fast for initial setup and to change bindings. Someone PM'd and asked that I post the script I use, so here it is. This was originally a 10 minute hack that I just doctored up to post here, so take it for what it's worth.

    You need Perl to run this. You can get Perl for windows from www.activestate.com, just install it (and check the "add to path" checkbox if there is one), and follow the directions in the script comments (copy the script to a file named genkcl.pl, edit the settings in the file, then run "perl genkcl.pl" from the command line).

    - Phara

    edit 1: added comment to indicate 0-9 is D0-D9 in the key list

    Code:
    ################# description ############################### 
    # Author: Phara 
    # Contact Info: Post on the dual-boxing.com forums! 
    # 
    # This perl script assists with FTL setup and does two things: 
    # 1. Generates keyclone .kcl (keymap hotstrings) files. 
    # 2. Prints the FTL /target line for your wow macros with modifiers. 
    # 
    # You need Perl to run this. You can get Perl for windows from 
    # activestate.com. 
    # 
    # You only need to complete steps 1 (your toons names) and step 2 
    # (the keys you wish to bind using FTL), and run from the command 
    # line like so: 
    # 
    # perl genkcl.pl 
    # 
    # The script will print the /target command to the command line window 
    # , and also generate 1 keyclone .kcl file for each toon name you specified. 
    ############################################################ 
    
    ############################################################# 
    ############################################################# 
    # Edit the following settings 
    ############################################################# 
    ############################################################# 
    
    ############ step 1 ######################################## 
    # enter you toons names, if you're not using five just enter 
    # the first N toons you have, leaving the others as is 
    $toonA = "YourToonNameA"; 
    $toonB = "YourToonNameB"; 
    $toonC = "YourToonNameC"; 
    $toonD = "YourToonNameD"; 
    $toonE = "YourToonNameE"; 
    
    ############ step 2 ######################################## 
    # Make the list of FTL keys you plan to bind. The format is: 
    # 
    # "MasterKeyName", "SlaveKeyName" 
    # 
    # Where SlaveKeyName is the key that would be sent by keyclone 
    # to all slave windows with modifiers when MasterKeyName is pressed 
    # 
    # See the key listing in the "do not edit" section below for 
    # key names to use. 
    # 
    # Note:  numbers 0-9 are D0-D9 in the key listing
    # 
    
    %keysToBind = ( 
    "F1", "Period" 
    ,"F2", "Rbrack" 
    ,"F3", "Bslash" 
    ,"F4", "Subtract" 
    ,"F5", "Quote" 
    ,"F6", "Pageup" 
    ,"F7", "Next" 
    ,"F8", "End" 
    ); 
    
    ############ step 3 ######################################## 
    # You don't need to edit this entry, but you can if you want 
    # to change which toons use which modifiers 
    
    %mods = ( 
    "A", ".5.5" # ctrl shift 
    ,"B",".20.20" # ctrl alt 
    ,"C",".17.17" # alt shift 
    ,"D",".21.21" # ctrl alt shift 
    ,"E",".4.4" # ctrl 
    ); 
    
    
    ############################################################# 
    ############################################################# 
    # DO NOT EDIT BELOW THIS LINE 
    ############################################################# 
    ############################################################# 
    
    ########################################## 
    # KEY LISTING - USE THE TEXT VALUES FOR 
    # "keysToBind" above 
    ########################################## 
    %vkeys = ( 
    "Pause",19 
    ,"Capital",20 
    ,"Escape",27 
    ,"Space",32 
    ,"PageUp",33 
    ,"Next",34 
    ,"End",35 
    ,"Home",36 
    ,"Left",37 
    ,"Up",38 
    ,"Right",39 
    ,"Down",40 
    ,"Select",41 
    ,"Print",42 
    ,"PrintScreen",44 
    ,"Insert",45 
    ,"Delete",46 
    ,"Help",47 
    ,"D0",48 
    ,"D1",49 
    ,"D2",50 
    ,"D3",51 
    ,"D4",52 
    ,"D5",53 
    ,"D6",54 
    ,"D7",55 
    ,"D8",56 
    ,"D9",57 
    ,"A",65 
    ,"B",66 
    ,"C",67 
    ,"D",68 
    ,"E",69 
    ,"F",70 
    ,"G",71 
    ,"H",72 
    ,"I",73 
    ,"J",74 
    ,"K",75 
    ,"L",76 
    ,"M",77 
    ,"N",78 
    ,"O",79 
    ,"P",80 
    ,"Q",81 
    ,"R",82 
    ,"S",83 
    ,"T",84 
    ,"U",85 
    ,"V",86 
    ,"W",87 
    ,"X",88 
    ,"Y",89 
    ,"Z",90 
    ,"NumPad0",96 
    ,"NumPad1",97 
    ,"NumPad2",98 
    ,"NumPad3",99 
    ,"NumPad4",100 
    ,"NumPad5",101 
    ,"NumPad6",102 
    ,"NumPad7",103 
    ,"NumPad8",104 
    ,"NumPad9",105 
    ,"Multiply",106 
    ,"Add",107 
    ,"Separator",108 
    ,"Subtract",109 
    ,"Decimal",110 
    ,"Divide",111 
    ,"F1",112 
    ,"F2",113 
    ,"F3",114 
    ,"F4",115 
    ,"F5",116 
    ,"F6",117 
    ,"F7",118 
    ,"F8",119 
    ,"F9",120 
    ,"F10",121 
    ,"F11",122 
    ,"F12",123 
    ,"F13",124 
    ,"F14",125 
    ,"F15",126 
    ,"F16",127 
    ,"F17",128 
    ,"F18",129 
    ,"F19",130 
    ,"F20",131 
    ,"F21",132 
    ,"F22",133 
    ,"F23",134 
    ,"F24",135 
    ,"NumLock",144 
    ,"Scroll",145 
    ,"Semicolon",186 
    ,"Equal",187 
    ,"Comma",188 
    ,"Minus",189 
    ,"Period",190 
    ,"Question",191 
    ,"Tilde",192 
    ,"Rbrack",219 
    ,"Fslash",220 
    ,"Lbrack",221 
    ,"Quote",222 
    ,"Bslash",226 
    ); 
    
    
    %modsMacro = ( 
    ".5.5", "[mod:ctrl,mod:shift,nomod:alt," # ctrl shift 
    ,".20.20", "[mod:ctrl,mod:alt,nomod:shift," # ctrl alt 
    ,".17.17", "[mod:alt,mod:shift,nomod:ctrl," # alt shift 
    ,".21.21", "[mod:ctrl,mod:alt,mod:shift," # ctrl alt shift 
    ,".4.4", "[mod:ctrl,nomod:alt,nomod:shift," # ctrl 
    ); 
    
    open(FILEA, ">$toonA.kcl") || die "Could not open " . "$toonA.kcl\nError: " . $! . "\n"; 
    print "Generating file \"$toonA.kcl\" ...\n"; 
    print FILEA "$toonA\n"; 
    open(FILEB, ">$toonB.kcl") || die "Could not open " . "$toonB.kcl\nError: " . $! . "\n"; 
    print "Generating file \"$toonB.kcl\" ...\n"; 
    print FILEB "$toonB\n"; 
    open(FILEC, ">$toonC.kcl") || die "Could not open " . "$toonC.kcl\nError: " . $! . "\n"; 
    print "Generating file \"$toonC.kcl\" ...\n"; 
    print FILEC "$toonC\n"; 
    open(FILED, ">$toonD.kcl") || die "Could not open " . "$toonD.kcl\nError: " . $! . "\n"; 
    print "Generating file \"$toonD.kcl\" ...\n"; 
    print FILED "$toonD\n"; 
    open(FILEE, ">$toonE.kcl") || die "Could not open " . "$toonE.kcl\nError: " . $! . "\n"; 
    print "Generating file \"$toonE.kcl\" ...\n"; 
    print FILEE "$toonE\n"; 
    for $key(keys %keysToBind) 
    { 
    keymap($key, $keysToBind{$key}); 
    } 
    close(FILEA); 
    close(FILEB); 
    close(FILEC); 
    close(FILED); 
    close(FILEE); 
    
    #print a target macro line for wow 
    $macro = "/target "; 
    for(A .. E) 
    { 
    $toonmods = $mods{$_}; 
    $macro .= $modsMacro{$toonmods}; 
    $macro .= "target=" . ${"toon" . $_} . "]"; 
    } 
    print "\n"; 
    print $macro; 
    
    print "\n\nPress enter key to end ...\n"; 
    $foo = <STDIN>; 
    sub keymap 
    { 
    my $key = shift; 
    my $bind = shift; 
    
    
    for $out(A .. E) 
    { 
    for $in(A .. E) 
    { 
    if($out eq $in) 
    { 
    
    print FILEA "k(" . $vkeys{$key} . ".0.0):hs(K" . $key . $in . ")\n" if($out eq "A"); 
    print FILEB "k(" . $vkeys{$key} . ".0.0):hs(K" . $key . $in . ")\n" if($out eq "B"); 
    print FILEC "k(" . $vkeys{$key} . ".0.0):hs(K" . $key . $in . ")\n" if($out eq "C"); 
    print FILED "k(" . $vkeys{$key} . ".0.0):hs(K" . $key . $in . ")\n" if($out eq "D"); 
    print FILEE "k(" . $vkeys{$key} . ".0.0):hs(K" . $key . $in . ")\n" if($out eq "E"); 
    } 
    else 
    { 
    print FILEA "k(" . $vkeys{$bind} . $mods{$in} . "):hs(K" . $key . $in . ")\n" if($out eq "A"); 
    print FILEB "k(" . $vkeys{$bind} . $mods{$in} . "):hs(K" . $key . $in . ")\n" if($out eq "B"); 
    print FILEC "k(" . $vkeys{$bind} . $mods{$in} . "):hs(K" . $key . $in . ")\n" if($out eq "C"); 
    print FILED "k(" . $vkeys{$bind} . $mods{$in} . "):hs(K" . $key . $in . ")\n" if($out eq "D"); 
    print FILEE "k(" . $vkeys{$bind} . $mods{$in} . "):hs(K" . $key . $in . ")\n" if($out eq "E"); 
    
    } 
    } 
    } 
    }

  2. #2

    Default

    Sweet, nice work and great idea. Thanks for sharing this

  3. #3

    Default

    This is a crazy random thought...but I would think the people that are having problems setting up their hoststrings..will probably have more problems setting up Perl on their machines.
    Everquest II - <Pain for Glory> on Nektulos Server
    (Shadowknight: Uhmono| Inquisitor: Blyssia | Warden: Wysh | Defiler: Gahealju | Troubador: Moxia | Warlock: Phyrloc) X 51
    (Guardian: Tukilu | Templar: Ajechu | Warden: Fayanna | Conjuror: Akaesia | Troubador: Lollah | Warlock: Onona) X 27-ish[/align]

  4. #4

    Default

    Quote Originally Posted by 'Frosty',index.php?page=Thread&postID=141882#post1 41882
    This is a crazy random thought...but I would think the people that are having problems setting up their hoststrings..will probably have more problems setting up Perl on their machines.
    I think some could have issues with it, but really it's a "click next, click finish" operation. I'd still see this likely used more by powerusers though ... I can easily set up FTL and hotstrings manually, but I use this cause I'm lazy =p

    If I had the time, I'd create an app with a GUI that lets you do a full FTL setup, but I don't have the time

  5. #5

    Default

    The script as it is, is great for limiting the tediousness that is required with manually creating and updating hotstring files. I don't think a gui would really add any value, im sure most people using the FTL setup already create and manage their hotstring files in ediators as it is (I do anyway).

  6. #6

    Default

    Small bug. Key names have to match exactly, so, for example, line 57

    Code:
    ,"F6", "Pageup"
    doesn't get converted with the entry at line 90

    Code:
     ,"PageUp",33
    resulting in some blank areas in the output that needed the scancode.
    Doing my best to get motivated for the WoW Headless Horseman mount hunt of 2013... so far failing. and now in 2018, let's see about those HH mounts! [Edit: Actually got an HH mount in 2018... on separate account 6. One to go! In 2019, my last BNet accout, the main one, got the HH mount. End of an era.]

    I multibox because I have no time, have a life, have a job and[/or] money and have little patience for drama and temper tantrums. -- heffner

  7. #7

    Default

    Quote Originally Posted by 'suprafro',index.php?page=Thread&postID=141915#pos t141915
    The script as it is, is great for limiting the tediousness that is required with manually creating and updating hotstring files. I don't think a gui would really add any value, im sure most people using the FTL setup already create and manage their hotstring files in ediators as it is (I do anyway).
    I have wanted to for quite some time. Had to setup a new team yesterday, and 10 new buttons on 4 accounts about drove me nuts. I usually copy and paste the macro into notepad, and then into all 4 of the macro text areas on the account. I screwed up and typoed my own name on one of the macros, and then it got copied over to all new macros. Took me about an hour to figure out the mistake, and thats after redoing the damn keymap twice by hand.

    Something like this if I can figure it out would be a huge time saver for me.

  8. #8

    Default

    I tried to go a route similar and write the bindings.wtf file and the kcl/hotkeyscript files from a YAML description.

    Now I just make a 'report' of sorts of what my multiplexers have in its source file and what the bindings-cache.wtf has in it (or doesn't have in it).

  9. #9

    Default

    I dont understand two things:

    # Make the list of FTL keys you plan to bind. The format is:
    #
    # "MasterKeyName", "SlaveKeyName"
    #
    # Where SlaveKeyName is the key that would be sent by keyclone
    # to all slave windows with modifiers when MasterKeyName is pressed
    If i have for example key 3 for earthshock (and i play 5 shamans) why would i then like to change that key to press something else on my main? And where do i need to edit these keys?
    And:

    %keysToBind = (
    "F1", "Period"
    ,"F2", "Rbrack"
    ,"F3", "Bslash"
    ,"F4", "Subtract"
    ,"F5", "Quote"
    ,"F6", "Pageup"
    ,"F7", "Next"
    ,"F8", "End"
    );
    Are that your characters name? I want to have F1 for my main, F2 for clone #1, F3 for clone #2 etc.
    Bladefist EU:
    ÖverdöseÒverdòseÓverdóseÔverdôse
    StõmpdòwnStòmpdõwnStómpdõwnStõmpdówn

  10. #10

    Default

    i'm at a loss about FTL. i just use /focus based macros and it seems to work well for me.

    as for when you would want to change the keys, well... you wouldn't if you have 5 of the same class. but i don't think that's the big thing with FTL. my understanding, and please... correct me as i realize i'm pulling this out of thin air... you would want to use FTL so you can get to any wow window and as you start hitting keys, it somehow becomes the targeting leader (i get fuzzy as to how that works and why)

Similar Threads

  1. Some help with Keyclone Hotstrings please?
    By PauperJin in forum New Multi-Boxers & Support
    Replies: 4
    Last Post: 09-06-2009, 10:33 PM
  2. perl script to generate keymaps
    By dubiox in forum Software Tools
    Replies: 0
    Last Post: 12-30-2008, 06:42 PM
  3. Keyclone hotstrings
    By blast3r in forum Software Tools
    Replies: 6
    Last Post: 10-24-2008, 06:53 PM
  4. keyclone help hotstrings
    By ahnubis in forum Software Tools
    Replies: 13
    Last Post: 08-19-2008, 08:37 AM
  5. Can this be done - calling a script to set target.
    By shaeman in forum Macros and Addons
    Replies: 6
    Last Post: 08-14-2008, 03:54 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
  •