The KGB Oracle
Posted By: Arkh Logitech G13 config - 10/23/09 04:22 PM
As promised here is my current G13 config. I also put my script config cause it should work with a G15.

G4, G10, G11, G12 = ZQSD
G1 = loot
G2 = food
G3 = heal pot
G5 = sheath / unsheath
G6 = use
G7 = alternate use
G8 = spawn mount
G9 = stam pot
G13 = small AoE cycle (virtuous wrath, fireball, corrosive blast)
G14 = ray AoE cycle (holy flame, wall of fire, I must add acid rain)
G15 = shift
G16 = cycle situationnal debuff (exhaust, stam leech, burden)
G17 = cycle heal other (heal other, sacrifice)
G18 = cycle self heal (stam2health, witches brew, heal)
G19 = cycle utility spells (Wall of force, confusion, launch)
G20 = gank
G21 = mana2stam
G22 = cycle self buff (a shit-ton to list)
G23 = jump
G24 = crouch
Joystick :
Up = equip 2h weapon + ready whirlwind
Left = equip 1h weapon then shield
Down = equip staff + ready attack spell
Right = equip bow

Here is the script for cycling and looting. The problem with DFO is if you bind something to a key + modifier (ctrl or alt) they won't work if you are using the shift. That's why I have to detect it for some keys.

Code:
keyArray = {{}, -- 1
            {},
            {},
            {},
            {},
            {},
            {},
            {},
            {},
            {},
            {},
            {},
            {"F1", "F2", "F3"}, -- 13
            {"F11", "F12"}, -- 14
            {},
            {"lbracket", "rbracket", "backslash"},
            {"U", "V"},
            {"F5", "F6", "F7"}, -- 18
            {"F8", "F9", "F10"}, -- 19
            {},
            {},
            {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"}
            };
ctrlModifier = {{}, -- 1
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {}, -- 13
                {}, -- 14
                {},
                {},
                {},
                {}, -- 18
                {}, -- 19
                {},
                {},
                {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
                };
indexes = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
lastGkey = 0;
function OnEvent(event, arg)
    if (event=="G_PRESSED" and arg ~=1) then
        if(lastGkey > 0 and lastGkey == arg) then
            indexes[arg] = indexes[arg] + 1;
            if(indexes[arg] > table.getn(keyArray[arg])) then
                indexes[arg] = 1;
            end
        end
        isSprint = IsModifierPressed("shift");
        if(ctrlModifier[arg][indexes[arg]]) then
            if(isSprint) then
                ReleaseKey("lshift");             
            end
            PressKey("lctrl");
        end
        PressAndReleaseKey(keyArray[arg][indexes[arg]]);
        if(ctrlModifier[arg][indexes[arg]]) then
            if(isSprint) then
                PressKey("lshift");
            end
            ReleaseKey("lctrl");
        end
        lastGkey = arg;
    end


    if(event=="G_PRESSED" and arg==1) then
        x, y = GetMousePosition();
        PressMouseButton(1);
        Sleep(10);
        MoveMouseTo(26532, 48321);
        Sleep(10);
        ReleaseMouseButton(1);
        Sleep(10);
        MoveMouseTo(x, y);
    end
end
Posted By: JetStar Re: Logitech G13 config - 10/24/09 06:26 AM
Very NICE. I might have to retire my Nostromos.
Posted By: GearHead-Bearrok Re: Logitech G13 config - 10/25/09 09:42 AM
Ya looks great , im finally now putting it together.
Posted By: GearHead-Bearrok Re: Logitech G13 config - 10/25/09 10:49 AM
Ok ya Im a noob, sorry iv not worked with scripts or macro's should I not bother? where do you insert the script smile to the hole thing or only on certain keys?
Posted By: Arkh Re: Logitech G13 config - 10/25/09 11:12 AM
I affect the script only on the cycling and loot keys :
Posted By: GearHead-Bearrok Re: Logitech G13 config - 10/25/09 10:43 PM
I hope I can catch you on vent cause I cant get this to work. I setup all your config and added script to loot and cycle keys and nothing happens. I tested everything in game and works but cycling and looting. Do I need to edit the script or something? If I get it working , ill owe you big time.
Posted By: Arkh Re: Logitech G13 config - 10/26/09 05:09 PM
Did you bind dfo keys to your hotbar items ?
For the loot script, you may have to change the numbers of the line "MoveMouseTo(26532, 48321);" so it drops in your backpack.
Posted By: Arkh Re: Logitech G13 config - 10/26/09 05:25 PM
To get mouse position, replace this part
Code:
if(event=="G_PRESSED" and arg==1) then
        x, y = GetMousePosition();
        PressMouseButton(1);
        Sleep(10);
        MoveMouseTo(26532, 48321);
        Sleep(10);
        ReleaseMouseButton(1);
        Sleep(10);
        MoveMouseTo(x, y);
    end


by
Code:
if(event=="G_PRESSED" and arg==1) then
local x, y = GetMousePosition();
local sFmt = string.format("Mouse is at %d,%d\n", x, y);
OutputLCDMessage(sFmt);
    end





Code:
keyArray = {{}, -- 1
            {},
            {},
            {},
            {},
            {},
            {},
            {},
            {},
            {},
            {},
            {},
            {"F1", "F2", "F3", "F1", "F2"}, -- 13
            {"F11", "F12", "F3"}, -- 14
            {},
            {"lbracket", "rbracket", "backslash"},
            {"U", "V"},
            {"F5", "F6", "F7"}, -- 18
            {"F8", "F9", "F10"}, -- 19
            {},
            {},
            {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"}
            };
ctrlModifier = {{}, -- 1
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {0, 0, 0, 1, 1}, -- 13
                {0, 0, 1}, -- 14
                {},
                {},
                {},
                {}, -- 18
                {}, -- 19
                {},
                {},
                {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
                };
indexes = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
lastGkey = 0;
function OnEvent(event, arg)
    if (event=="G_PRESSED" and arg ~=1) then
        if(lastGkey > 0 and lastGkey == arg) then
            indexes[arg] = indexes[arg] + 1;
            if(indexes[arg] > table.getn(keyArray[arg])) then
                indexes[arg] = 1;
            end
        end
        isSprint = IsModifierPressed("shift");
        if(ctrlModifier[arg][indexes[arg]] == 1) then
            if(isSprint) then
                ReleaseKey("lshift");             
            end
            PressKey("lctrl");
        end
        PressAndReleaseKey(keyArray[arg][indexes[arg]]);
        if(ctrlModifier[arg][indexes[arg]] == 1) then
            if(isSprint) then
                PressKey("lshift");
            end
            ReleaseKey("lctrl");
        end
        lastGkey = arg;
    end


    if(event=="G_PRESSED" and arg==1) then
local x, y = GetMousePosition();
local sFmt = string.format("Mouse is at %d,%d\n", x, y);
OutputLCDMessage(sFmt);
    end
end
Posted By: Arkh Re: Logitech G13 config - 11/28/09 12:56 PM
My current one, for ehwol
Code:
keyArray = {{}, -- 1
            {},
            {},
            {},
            {},
            {},
            {},
            {},
            {},
            {},
            {},
            {},
            {"F1", "F2", "F3", "F1", "F2"}, -- 13
            {"F11", "F12", "F3"}, -- 14
            {},
            {"lbracket", "rbracket", "backslash"},
            {"U", "V"},
            {"F5", "F6", "F7"}, -- 18
            {"F8", "F9", "F10"}, -- 19
            {},
            {},
            {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"}
            };
ctrlModifier = {{}, -- 1
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {},
                {0, 0, 0, 1, 1}, -- 13
                {0, 0, 1}, -- 14
                {},
                {},
                {},
                {}, -- 18
                {}, -- 19
                {},
                {},
                {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
                };
indexes = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
lastGkey = 0;
function OnEvent(event, arg)
    if (event=="G_PRESSED" and arg ~=1) then
        if(lastGkey > 0 and lastGkey == arg) then
            indexes[arg] = indexes[arg] + 1;
            if(indexes[arg] > table.getn(keyArray[arg])) then
                indexes[arg] = 1;
            end
        end
        isSprint = IsModifierPressed("shift");
        if(ctrlModifier[arg][indexes[arg]] == 1) then
            if(isSprint) then
                ReleaseKey("lshift");             
            end
            PressKey("lctrl");
        end
        PressAndReleaseKey(keyArray[arg][indexes[arg]]);
        if(ctrlModifier[arg][indexes[arg]] == 1) then
            if(isSprint) then
                PressKey("lshift");
            end
            ReleaseKey("lctrl");
        end
        lastGkey = arg;
    end


    if(event=="G_PRESSED" and arg==1) then
       x, y = GetMousePosition();
        PressMouseButton(1);
        Sleep(10);
        MoveMouseTo(26532, 48321);
        Sleep(10);
        ReleaseMouseButton(1);
        Sleep(10);
        MoveMouseTo(x, y);

    end
end
Posted By: Romeo_Montague Re: Logitech G13 config - 11/29/09 06:47 PM
I'm going to have to give the loot script a try as well.
Currently do not have that on my G13 layout.
Posted By: EhWoL Re: Logitech G13 config - 11/30/09 02:25 AM
I'm digging it, took a little time to figure it out but once Arkh helped me through it, its completly customizible and allows more room for spells and skills on the G13!
Posted By: Vuldan Re: Logitech G13 config - 11/30/09 12:10 PM
OK..so I have a G15..how would I apply this Arkh? I am beginning to determine that I lose fights, and other things, as I am still manually doing everything with the limited in game hot bar, mostly cause I am a dip and can not figure out the scripts, since I have not tried to use them for years..I will have to take some time and figure this out.
Posted By: Arkh Re: Logitech G13 config - 12/07/09 07:41 PM
Ok, new skills, new rules : new config to do.
I checked, a script can change what profile is on so I think I'll do something like M1 = melee/bow, M2 = magic, M3 = newb or mount or another magic ?

Now, for the left and upper part of the pad, I think I'll stay with the same thing : food, mount, gank, using things. Maybe G3/G4 for the different lean on mount.
For M1 :
- G13 = whirlwind (cycle throw all whirlwind so it select the good one)
- G22 = disabling shot
- G14 = knockback
- G18 = power attack

For M2 :
- G13 = Fireball and the acid one (jumpshot on both)
- G22 = heal (w/o witches brew in the cycle ?)
- G14 = Big ass AoE (I think I'll go with a virtuous wrath, volcano, maybe magma storm and even wall of force cycle), some AoE may have lesser CD than their global CD so they may be added (wall of fire and meteor strike for example)
- G19 = utility spells as usual (wall of force, confusion, launch, come hither)
- G16 = buffs and shields.
- G18 = heal other (heal other, sacrifice, maybe witches brew)
- G17 = buff other (hastes at least, arrow ward and iron skin, stats buffs, maybe some elemental wards)

Here is my current idea. What do you think about it ? Any stupid mistake to point out ?
Posted By: Arkh Re: Logitech G13 config - 12/07/09 10:24 PM
Ok, I can't test it tonight, but if it works you're gonna like this new script. Just some teaser :
Code:
{"ctrl+rbracket", "F11", "F12", "ctrl+F3"}, -- G17

Code:
-- list of macros to launch. Format : key = {"macro name", "profile to activate"}
macros = {  [26] = {"2HSpec", 1},
            [27] = {"N", 1},
            [28] = {"AoE", 2},
            [29] = {"1H Spec", 1}};
Posted By: Anonymous Re: Logitech G13 config - 12/07/09 10:42 PM
Will these macros work with other game pads? I use the N52te. I'm thinking it should work. When you assign a value to the keys, you have choices between single key, macro, and script and maybe a couple of other options. Correct?
Posted By: Arkh Re: Logitech G13 config - 12/07/09 10:54 PM
It works with logitech programmable things. I don't know what the nostromo looks like for scripts.
Posted By: Arkh Re: Logitech G13 config - 12/07/09 11:38 PM
Ok, this seems to work. You can now use things like "shift+alt+ctrl+F2" or "F2+ctrl" or "alt F2". And it handles 3 or more profiles.

Code:
keyArray = {
                { -- Profile 1
                },
                { -- Profile 2
                },
                { -- Profile 3
                    [3] = {"V", "alt+F6"},                                              -- heal self
                    [13] = {"alt+U", "alt+I"},                                     -- r50 nukes
                    [14] = {"alt+O", "alt+K", "alt+B", "alt+J"}, -- big AoEs
                    [16] = {"ctrl+5", "ctrl+6", "ctrl+7", "ctrl+8"},               -- debuffs
                    [17] = {"alt+F1", "alt+F2", "alt+F3", "alt+F6", "alt+F7", "alt+F8", "alt+F9", "alt+F10", "alt+F11", "alt+F12"}, -- buff other
                    [18] = {"alt+1", "alt+2", "alt+3", "alt+4", "alt+5", "alt+6", "alt+7", "alt+8", "alt+9", "alt+0", "ctrl+1"}, -- buff self
                    [19] = {"ctrl+4", "ctrl+2", "ctrl+3"}, -- heal other
                    [22] = {"ctrl+I", "ctrl+O", "ctrl+P", "K"} -- Utility spells
                }
            };
-- list of macros to launch. Format : key = {"macro name", "profile to activate"}
macros = { [26] = {"2Hander", "2"},
           [27] = {"Bow", "2"},
           [28] = {"staff", "3"},
           [29] = {"1Hander", "2"}};
indexes = {{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
            {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
            {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
-- when the profile is changed the pad lose all pressed key, so we have to manage this
movements = {[4] = "W",
             [10] = "A",
             [11] = "S",
             [12] = "D"};
lastGkey = 0;
profile = 1;
lastMacro = 0;

function OnEvent(event, arg)
    if (event=="G_PRESSED" and arg ~=1) then
        -- gets profile number
        profile = GetMKeyState();
        pushKey(arg);
    end

    if (event=="G_RELEASED" and movements[arg]) then
        releaseKey(arg);
    end
    -- loot key, usefull for moving stuff quick (like 2000 pants)
    if(event=="G_PRESSED" and arg==1) then
        x, y = GetMousePosition();
        PressMouseButton(1);
        Sleep(10);
        MoveMouseTo(26532, 48321);
        Sleep(10);
        ReleaseMouseButton(1);
        Sleep(10);
        MoveMouseTo(x, y);
    end
end

function releaseKey(gkey)
   ReleaseKey(movements[gkey]);
end

function pushKey(gkey)
    -- launch macro if needed
    if(macros[gkey]) then
        macroKey(gkey);
        return;
    end

    -- manage movement if needed
    if(movements[gkey]) then
        PressKey(movements[gkey]);
        return;
    end

    -- gets key name
    -- we check if the last gkey used was the same, if yes, cycle
    if(lastGkey > 0 and lastGkey == gkey) then
        indexes[profile][gkey] = indexes[profile][gkey] + 1;
        if(indexes[profile][gkey] > table.getn(keyArray[profile][gkey])) then
            indexes[profile][gkey] = 1;
        end
    end
    lastGkey = gkey;
    i = indexes[profile][gkey];
    keyString = keyArray[profile][gkey][i];

    -- we get modifiers to use
    toCtrl = 0;
    toAlt = 0;
    toShift = 0;
    if(string.find(keyString, "ctrl")) then
        toCtrl = 1;
    end
    if(string.find(keyString, "alt")) then
        toAlt = 1;
    end
    if(string.find(keyString, "shift")) then
        toShift = 1;
    end

    -- now, we clean the key string to extract only the key
    keyString = string.gsub(keyString, "ctrl", "");
    keyString = string.gsub(keyString, "alt", "");
    keyString = string.gsub(keyString, "shift", "");
    keyString = string.gsub(keyString, "\+", "");
    key = string.gsub(keyString, " ", "");
    -- check if shift is already pushed
    isSprint = IsModifierPressed("shift");

    -- if needed release or press shift key
    if((toCtrl == 1 or toAlt == 1) and isSprint and toShift == 0) then
        ReleaseKey("lshift");
    elseif(not isSprint and toShift == 1) then
        PressKey("lshift");
    end

    -- press modifiers
    if toCtrl == 1 then
       PressKey("lctrl");
    end
    if toAlt == 1 then
        PressKey("lalt");
    end

    -- press and release key
    PressAndReleaseKey(key);

    -- release modifiers
     if toCtrl == 1 then
        ReleaseKey("lctrl");
    end
    if toAlt == 1 then
        ReleaseKey("lalt");
    end

    -- release or press shift if it was pressed before
    if((toCtrl == 1 or toAlt == 1) and isSprint and toShift == 0) then
        PressKey("lshift");
    elseif(not isSprint and toShift == 1) then
        ReleaseKey("lshift");
    end
end

-- I have macros set for these keys and some need to change the active profile
function macroKey(key)
    if(lastMacro ~= key) then
        -- Abort old macro
        AbortMacro();
    end
    -- Change profile
    SetMKeyState(macros[key][2]);
    -- Activate macro
    PlayMacro(macros[key][1]);
end
Posted By: Arkh Re: Logitech G13 config - 12/15/09 07:12 PM
Last version, I debugged the "losing shift key when changing profile" problem.

Code:
keyArray = {
                { -- Profile 1
                },
                { -- Profile 2
                },
                { -- Profile 3
                    [3] = {"V", "alt+F6"},                                              -- heal self
                    [13] = {"alt+U", "alt+I"},                                     -- r50 nukes
                    [14] = {"alt+O", "alt+K", "alt+B", "alt+J"}, -- big AoEs
                    [16] = {"ctrl+5", "ctrl+6", "ctrl+7", "ctrl+8"},               -- debuffs
                    [17] = {"alt+F1", "alt+F2", "alt+F3", "alt+F6", "alt+F7", "alt+F8", "alt+F9", "alt+F10", "alt+F11", "alt+F12"}, -- buff other
                    [18] = {"alt+1", "alt+2", "alt+3", "alt+4", "alt+5", "alt+6", "alt+7", "alt+8", "alt+9", "alt+0", "ctrl+1"}, -- buff self
                    [19] = {"ctrl+4", "ctrl+2", "ctrl+3"}, -- heal other
                    [22] = {"ctrl+I", "ctrl+O", "ctrl+P", "K"} -- Utility spells
                }
            };
-- list of macros to launch. Format : key = {"macro name", "profile to activate"}
macros = { [26] = {"2Hander", 2},
           [27] = {"Bow", 2},
           [28] = {"staff", 3},
           [29] = {"1Hander", 2}};
indexes = {{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
            {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
            {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
-- when the profile is changed the pad lose all pressed key, so we have to manage this
movements = {[4] = "W",
             [10] = "A",
             [11] = "S",
             [12] = "D"};
lastGkey = 0;
profile = 1;
lastMacro = 0;

function OnEvent(event, arg)
    if (event=="G_PRESSED" and arg ~=1) then
        -- gets profile number
        profile = GetMKeyState();
        pushKey(arg);
    end

    if (event=="G_RELEASED" and movements[arg]) then
        releaseKey(arg);
    end
    -- loot key, usefull for moving stuff quick (like 2000 pants)
    if(event=="G_PRESSED" and arg==1) then
        x, y = GetMousePosition();
        PressMouseButton(1);
        Sleep(10);
        MoveMouseTo(26532, 48321);
        Sleep(10);
        ReleaseMouseButton(1);
        Sleep(10);
        MoveMouseTo(x, y);
    end
end

function releaseKey(gkey)
   ReleaseKey(movements[gkey]);
end

function pushKey(gkey)
    -- launch macro if needed
    if(macros[gkey]) then
        macroKey(gkey);
        return;
    end

    -- manage movement if needed
    if(movements[gkey]) then
        PressKey(movements[gkey]);
        return;
    end

    -- gets key name
    -- we check if the last gkey used was the same, if yes, cycle
    if(lastGkey > 0 and lastGkey == gkey) then
        indexes[profile][gkey] = indexes[profile][gkey] + 1;
        if(indexes[profile][gkey] > table.getn(keyArray[profile][gkey])) then
            indexes[profile][gkey] = 1;
        end
    end
    lastGkey = gkey;
    i = indexes[profile][gkey];
    keyString = keyArray[profile][gkey][i];

    -- we get modifiers to use
    toCtrl = 0;
    toAlt = 0;
    toShift = 0;
    if(string.find(keyString, "ctrl")) then
        toCtrl = 1;
    end
    if(string.find(keyString, "alt")) then
        toAlt = 1;
    end
    if(string.find(keyString, "shift")) then
        toShift = 1;
    end

    -- now, we clean the key string to extract only the key
    keyString = string.gsub(keyString, "ctrl", "");
    keyString = string.gsub(keyString, "alt", "");
    keyString = string.gsub(keyString, "shift", "");
    keyString = string.gsub(keyString, "\+", "");
    key = string.gsub(keyString, " ", "");
    -- check if shift is already pushed
    isSprint = IsModifierPressed("shift");

    -- if needed release or press shift key
    if((toCtrl == 1 or toAlt == 1) and isSprint and toShift == 0) then
        ReleaseKey("lshift");
    elseif(not isSprint and toShift == 1) then
        PressKey("lshift");
    end

    -- press modifiers
    if toCtrl == 1 then
       PressKey("lctrl");
    end
    if toAlt == 1 then
        PressKey("lalt");
    end

    -- press and release key
    PressAndReleaseKey(key);

    -- release modifiers
     if toCtrl == 1 then
        ReleaseKey("lctrl");
    end
    if toAlt == 1 then
        ReleaseKey("lalt");
    end

    -- release or press shift if it was pressed before
    if((toCtrl == 1 or toAlt == 1) and isSprint and toShift == 0) then
        PressKey("lshift");
    elseif(not isSprint and toShift == 1) then
        ReleaseKey("lshift");
    end
end

-- I have macros set for these keys and some need to change the active profile
function macroKey(key)
    if(lastMacro ~= key) then
        -- Abort old macro
        AbortMacro();
    end
    isSprint = IsModifierPressed("lshift");
    oldState = GetMKeyState();
    -- Activate macro
    PlayMacro(macros[key][1]);
    -- Change profile
    SetMKeyState(macros[key][2]);

    if(isSprint and (macros[key][2] ~= oldState)) then
        ReleaseKey("lshift");
        Sleep(20);
        PressKey("lshift");
    end
end



Posted By: EhWoL Re: Logitech G13 config - 12/24/09 03:56 AM
I'll have to get you in vent and ask some questions Arkh but it looks to be even better than the last!
Posted By: Anonymous Re: Logitech G13 config - 01/12/10 08:13 PM
Can we sticky this one? Seems that quite a few number of us have the G13 now. Out of stock at Best Buy, on sale at Amazon for $59.99 with free shipping as well. Should have mine next week.
Posted By: Ictinike Re: Logitech G13 config - 01/12/10 10:00 PM
Originally Posted By: Squared
Can we sticky this one? Seems that quite a few number of us have the G13 now. Out of stock at Best Buy, on sale at Amazon for $59.99 with free shipping as well. Should have mine next week.



Awesome! I missed the Best Buy one and figured it would go on sale somewhere else.. Ordering soon! smile
Posted By: Romeo_Montague Re: Logitech G13 config - 01/12/10 10:45 PM
Gamestop had them last weekend, for delivery only though.
Don't know if they still have them or not.
Posted By: Arkh Re: Logitech G13 config - 01/12/10 11:43 PM
Fuck, I should ask some money from Logitech there.
Posted By: Ictinike Re: Logitech G13 config - 01/13/10 01:42 AM
Mines all ordered. I use G15 (old full version) now but reaching on the keyboard still.. Hoping this helps laugh
Posted By: Instrument Re: Logitech G13 config - 01/18/10 09:35 AM
jioned the g13 club
Posted By: Morlander Re: Logitech G13 config - 01/19/10 12:54 AM
keyArray = {
{ -- Profile 1
[14] = { "ctrl+F3", "ctrl+F5"}, -- sword attacks
[13] = { "ctrl+F2", "ctrl+F4"}, -- sword movements
[12] = { "ctrl+F1"}, -- sword shield break
},
{ -- Profile 2

[14] = { "shift+F3", "shift+F5"}, -- 2sword attacks
[13] = { "shift+F2", "shift+F4"}, -- 2sword movements
[12] = { "shift+F1"}, -- 2sword shield break
},
{ -- Profile 3
[6] = {"f8", "f7", "f5", "f6"}, -- heal self
[14] = {"alt+U", "alt+I", "alt+y"}, -- r50 nukes
[13] = {"alt+O", "alt+K", "alt+B",}, -- big AoEs
[12] = {"ctrl+5", "ctrl+6", "ctrl+7"}, -- debuffs
[9] = {"alt+F1", "alt+F2", "alt+F3", "alt+F4", "alt+F5", "alt+F6", "alt+F7", "alt+F8", "alt+F9"}, -- buff other
[4] = {"alt+1", "alt+2", "alt+3", "alt+4", "alt+5", "alt+6", "alt+7", "alt+8", "alt+9", "alt+0", "ctrl+1"}, -- buff self
[8] = {"shift+f8", "f9", "shift+f12"}, -- heal other
[5] = {"ctrl+I", "ctrl+O", "ctrl+P"}, -- Utility spells
}
};
-- list of macros to launch. Format : key = {"macro name", "profile to activate"}
macros = {
[3] = {"Greatsword", 2},
[2] = {"staff", 3},
[1] = {"1Hander", 1}};
indexes = {{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
-- when the profile is changed the pad lose all pressed key, so we have to manage this
movements = {[26] = "W",
[29] = "A",
[28] = "S",
[27] = "D"};
lastGkey = 0;
profile = 1;
lastMacro = 0;

function OnEvent(event, arg)
if (event=="G_PRESSED" and arg ~=0) then
-- gets profile number
profile = GetMKeyState();
pushKey(arg);
end

if (event=="G_RELEASED" and movements[arg]) then
releaseKey(arg);
end
-- loot key, usefull for moving stuff quick (like 2000 pants)
if(event=="G_PRESSED" and arg==18 or arg==24 or arg==18) then
x, y = GetMousePosition();
PressMouseButton(1);
Sleep(10);
MoveMouseTo(54000, 45000);
Sleep(10);
ReleaseMouseButton(1);
Sleep(10);
MoveMouseTo(x, y);
end
end

function releaseKey(gkey)
ReleaseKey(movements[gkey]);
end

function pushKey(gkey)
-- launch macro if needed
if(macros[gkey]) then
macroKey(gkey);
return;
end

-- manage movement if needed
if(movements[gkey]) then
PressKey(movements[gkey]);
return;
end

-- gets key name
-- we check if the last gkey used was the same, if yes, cycle
if(lastGkey > 0 and lastGkey == gkey) then
indexes[profile][gkey] = indexes[profile][gkey] + 1;
if(indexes[profile][gkey] > table.getn(keyArray[profile][gkey])) then
indexes[profile][gkey] = 1;
end
end
lastGkey = gkey;
i = indexes[profile][gkey];
keyString = keyArray[profile][gkey][i];

-- we get modifiers to use
toCtrl = 0;
toAlt = 0;
toShift = 0;
if(string.find(keyString, "ctrl")) then
toCtrl = 1;
end
if(string.find(keyString, "alt")) then
toAlt = 1;
end
if(string.find(keyString, "shift")) then
toShift = 1;
end

-- now, we clean the key string to extract only the key
keyString = string.gsub(keyString, "ctrl", "");
keyString = string.gsub(keyString, "alt", "");
keyString = string.gsub(keyString, "shift", "");
keyString = string.gsub(keyString, "\+", "");
key = string.gsub(keyString, " ", "");
-- check if shift is already pushed
isSprint = IsModifierPressed("shift");

-- if needed release or press shift key
if((toCtrl == 1 or toAlt == 1) and isSprint and toShift == 0) then
ReleaseKey("lshift");
elseif(not isSprint and toShift == 1) then
PressKey("lshift");
end

-- press modifiers
if toCtrl == 1 then
PressKey("lctrl");
end
if toAlt == 1 then
PressKey("lalt");
end

-- press and release key
PressAndReleaseKey(key);

-- release modifiers
if toCtrl == 1 then
ReleaseKey("lctrl");
end
if toAlt == 1 then
ReleaseKey("lalt");
end

-- release or press shift if it was pressed before
if((toCtrl == 1 or toAlt == 1) and isSprint and toShift == 0) then
PressKey("lshift");
elseif(not isSprint and toShift == 1) then
ReleaseKey("lshift");
end
end

-- I have macros set for these keys and some need to change the active profile
function macroKey(key)
if(lastMacro ~= key) then
-- Abort old macro
AbortMacro();
end
isSprint = IsModifierPressed("lshift");
oldState = GetMKeyState();
-- Activate macro
PlayMacro(macros[key][1]);
-- Change profile
SetMKeyState(macros[key][2]);

if(isSprint and (macros[key][15] ~= oldState)) then
ReleaseKey("lshift");
Sleep(20);
PressKey("lshift");
end
end


posting this for a few of the guys that asked
Posted By: Anonymous Re: Logitech G13 config - 01/19/10 05:42 PM
I hate the US Postal Service. On the early afternoon of January 12th, I ordered my G13 through Amazon and took the standard shipping that was included with the price. NOT THE CHEAPEST FREE SHIPPING, but the standard shipping through the US Postal Service. Later that day Ichy ordered his G13 from Amazon and I believe he took the standard shipping as well. On the 13th, Ichy had his G13 in his hands. Today, the 19th, I am still waiting on mine. I can understand that it shipped from Indiana and went to Ohio, so that is why Icky got next day service, but I'm in Texas. It's not like I live in Australia. How many days does it take to get a package 1000 miles? 8 days and counting. geeeez.

Meanwhile the Wii I bought from Amazon and shipped UPS standard on MONDAY from Kentucky will be here on Thursday. 4 days. Funny how a greedy profit seeking corporation does a better job than the State run USPS.
Posted By: Ictinike Re: Logitech G13 config - 01/19/10 06:50 PM
Originally Posted By: Squared
I hate the US Postal Service. On the early afternoon of January 12th, I ordered my G13 through Amazon and took the standard shipping that was included with the price. NOT THE CHEAPEST FREE SHIPPING, but the standard shipping through the US Postal Service. Later that day Ichy ordered his G13 from Amazon and I believe he took the standard shipping as well. On the 13th, Ichy had his G13 in his hands. Today, the 19th, I am still waiting on mine. I can understand that it shipped from Indiana and went to Ohio, so that is why Icky got next day service, but I'm in Texas. It's not like I live in Australia. How many days does it take to get a package 1000 miles? 8 days and counting. geeeez.

Meanwhile the Wii I bought from Amazon and shipped UPS standard on MONDAY from Kentucky will be here on Thursday. 4 days. Funny how a greedy profit seeking corporation does a better job than the State run USPS.


Yea I feel ya.. someone must have been watchin over me cause I am the one typically in your shoes Squared.

Now I'm not 100% certain as I pitched the box already but I think mine came UPS, not USPS.. Maybe that's the difference.

If that's the case I'm not sure why they chose UPS for me and not you frown
Posted By: Vuldan Re: Logitech G13 config - 04/27/10 12:29 AM
OK...I need some serious help. I have the old school G15 and I can not figure out how to get these to work or re-create them..anyone? I am so tired of hunting and clicking and dieing cause I am fumbling for the right keys..lol
Posted By: Vuldan Re: Logitech G13 config - 04/27/10 12:52 AM
Arkh, I need you to break this down to me barney style..do I cut and paste it into my manager..and then what? lol
Posted By: Vuldan Re: Logitech G13 config - 04/28/10 05:38 AM
Serious Bumpage..lol
Posted By: Arkh Re: Logitech G13 config - 04/28/10 06:16 AM
Sorry, I'll be online after work. But first thing : download the last logitech drivers.

Then you have to have to open the script editor and copy-pasta the script code (last version end of this post) and select "script" as the key action.
There is a big "keyArray" array in it, it contains all the bound key I have, so for example, if I'm on M3, the G18 key will let me cycle through my self-buffs.

Here is my current script :
Code:
keyArray = {
                { -- Profile 1
                    [3] = {"alt+F9", "alt+F10", "alt+F11"},     -- heal self
                    [5] = {"alt+F1", "alt+F2"}, -- haste and rapidshot
                    [13] = {"shift+F1", "shift+F2", "shift+F3", "shift+F4", "J", "M"}, -- first wards
                    [16] = {"shift+F5", "shift+F6", "shift+F7", "shift+F8", "shift+F9"}, -- stats buffs
                    [17] = {"ctrl+F1", "ctrl+F2", "ctrl+F3", "ctrl+F4", "ctrl+F5", "ctrl+F6"}, -- secondary wards
                    [18] = {"alt+8", "alt+9", "alt+0", "ctrl+1", "ctrl+2"}, -- secondary self buffs
                    [19] = {"ctrl+3", "ctrl+4"}, -- heal other
                    [22] = {"alt+F6", "ctrl+U", "ctrl+I", "ctrl+O"} -- Utility spells
               },
                { -- Profile 2
                },
                { -- Profile 3
                    [2] = {"alt+L"}, -- ray AoE clouds "alt+K", 
                    [3] = {"alt+F9", "alt+F10", "alt+F11"},     -- heal self
                    [5] = {"shift+F10", "shift+F11", "shift+F12"}, -- utility rays
                    [9] = {"alt+O", "alt+J"}, -- big AoEs
                    [13] = {"alt+I", "K"},                                     -- r50 nukes
                    [16] = {"ctrl+N", "ctrl+B", "ctrl+5", "ctrl+6", "ctrl+7", "ctrl+8"},      -- melee debuffs
                    [17] = {"shift+V", "shift+N"}, -- caster debuffs
                    [18] = {"alt+1", "alt+2", "alt+3", "alt+4", "alt+5", "alt+6", "alt+7"}, -- primary self buff
                    [19] = {"ctrl+3", "ctrl+4"}, -- heal other
                    [22] = {"alt+F6", "ctrl+U", "ctrl+I", "ctrl+O"} -- Utility spells
                }
            };
-- list of macros to launch. Format : key = {"macro name", "profile to activate"}
macros = { [26] = {"2Hander", 2},
           [27] = {"Bow", 2},
           [28] = {"staff", 3},
           [29] = {"1Hander", 2},
           [25] = {"staff", 1}};
indexes = {{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1, 1, 1, 1, 1, 1, 1, 1},
            {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1, 1, 1, 1, 1, 1, 1, 1},
            {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1, 1, 1, 1, 1, 1, 1, 1}};
-- when the profile is changed the pad lose all pressed key, so we have to manage this
movements = {[4] = "W",
             [10] = "A",
             [11] = "S",
             [12] = "D"};
lastGkey = 0;
profile = 1;
lastMacro = 0;

function OnEvent(event, arg)
    if (event=="G_PRESSED" and arg ~=1) then
        -- gets profile number
        profile = GetMKeyState();
        pushKey(arg);
    end

    if (event=="G_RELEASED" and movements[arg]) then
        releaseKey(arg);
    end
    -- loot key, usefull for moving stuff quick (like 2000 pants)
    if(event=="G_PRESSED" and arg==1) then
        x, y = GetMousePosition();
        PressMouseButton(1);
        Sleep(10);
        MoveMouseTo(26532, 48321);
        Sleep(10);
        ReleaseMouseButton(1);
        Sleep(10);
        MoveMouseTo(x, y);
    end
end

function releaseKey(gkey)
   ReleaseKey(movements[gkey]);
end

function pushKey(gkey)
    -- launch macro if needed
    if(macros[gkey]) then
        macroKey(gkey);
        return;
    end

    -- manage movement if needed
    if(movements[gkey]) then
        PressKey(movements[gkey]);
        return;
    end

    if(not keyArray[profile][gkey]) then
        return;
    end

    -- gets key name
    -- we check if the last gkey used was the same, if yes, cycle
    if(lastGkey > 0 and lastGkey == gkey) then
        indexes[profile][gkey] = indexes[profile][gkey] + 1;
        if(indexes[profile][gkey] > table.getn(keyArray[profile][gkey])) then
            indexes[profile][gkey] = 1;
        end
    end
    lastGkey = gkey;
    i = indexes[profile][gkey];
    keyString = keyArray[profile][gkey][i];

    -- we get modifiers to use
    toCtrl = false;
    toAlt = false;
    toShift = false;
    if(string.find(keyString, "ctrl")) then
        toCtrl = true;
    end
    if(string.find(keyString, "alt")) then
        toAlt = true;
    end
    if(string.find(keyString, "shift")) then
        toShift = true;
    end

    -- now, we clean the key string to extract only the key
    keyString = string.gsub(keyString, "ctrl", "");
    keyString = string.gsub(keyString, "alt", "");
    keyString = string.gsub(keyString, "shift", "");
    keyString = string.gsub(keyString, "\+", "");
    key = string.gsub(keyString, " ", "");

    -- press modifiers
    if toCtrl then
       PressKey("lctrl");
    end
    if toAlt then
        PressKey("lalt");
    end
    if toShift then
        PressKey("lshift");
    end

    -- press and release key
    PressAndReleaseKey(key);

    -- release modifiers
    if toCtrl then
        ReleaseKey("lctrl");
    end
    if toAlt then
        ReleaseKey("lalt");
    end
    if toShift then
        ReleaseKey("lshift");
    end
end

-- I have macros set for these keys and some need to change the active profile
function macroKey(key)
    if(lastMacro ~= key) then
        -- Abort old macro
        AbortMacro();
    end
    oldState = GetMKeyState();
    -- Activate macro
    PlayMacro(macros[key][1]);
    -- Change profile
    SetMKeyState(macros[key][2]);
end
Posted By: Vuldan Re: Logitech G13 config - 04/30/10 03:37 PM
Thanks Arkh my friend. I will be messing with this trying to figure it out. I live in EST USA...give me some compatible times to find you online so I can mooch your help..lol
Posted By: Arkh Re: Logitech G13 config - 04/30/10 05:02 PM
All week-end long. And you can bother other script users : Mor, Kray, Ehwol etc.
Posted By: Arkh Re: Logitech G13 config - 06/27/10 07:18 PM
Update for Krull. Not tested atm tho.
It adds the rctrl, ralt and rshift modifier so you can bind things with the right ctrl, alt and shift keys. To use them, instead of doing something like alt+f1, just do ralt+f1 for example.
I also removed a little bug there was.
Code:
keyArray = {
                { -- Profile 1
                    [3] = {"alt+F9", "alt+F10", "alt+F11"},     -- heal self
                    [5] = {"alt+F1", "alt+F2", "shift+F3"}, -- haste and rapidshot
                    [13] = {"shift+F4", "shift+F1", "shift+F2", "J", "M"}, -- first wards
                    [16] = {"shift+F5", "shift+F6", "shift+F7", "shift+F8", "shift+F9"}, -- stats buffs
                    [17] = {"ctrl+F1", "ctrl+F2", "ctrl+F3", "ctrl+F4", "ctrl+F5", "ctrl+F6"}, -- secondary wards
                    [18] = {"alt+8", "alt+9", "alt+0", "ctrl+1"}, -- secondary self buffs
                    [19] = {"ctrl+3", "ctrl+4"}, -- heal other
                    [22] = {"alt+F6", "ctrl+U", "ctrl+I", "ctrl+O"} -- Utility spells
               },
                { -- Profile 2
                },
                { -- Profile 3
                    [2] = {"alt+L"}, -- ray AoE clouds "alt+K", 
                    [3] = {"alt+F9", "alt+F10", "alt+F11"},     -- heal self
                    [5] = {"shift+F10", "shift+F11", "shift+F12"}, -- utility rays
                    [9] = {"alt+O", "alt+J"}, -- big AoEs
                    [13] = {"K", "alt+I"},                                     -- r50 nukes
                    [16] = {"ctrl+N", "ctrl+8", "ctrl+5", "ctrl+6", "ctrl+7", "ctrl+B"},      -- melee debuffs
                    [17] = {"shift+N", "shift+V"}, -- caster debuffs
                    [18] = {"alt+1", "alt+2", "alt+3", "alt+4", "alt+5", "alt+6", "alt+7", "ctrl+2"}, -- primary self buff
                    [19] = {"ctrl+3", "ctrl+4"}, -- heal other
                    [22] = {"alt+F6", "ctrl+U", "ctrl+I", "ctrl+O"} -- Utility spells
                }
            };
-- list of macros to launch. Format : key = {"macro name", "profile to activate"}
macros = { [26] = {"2Hander", 2},
           [27] = {"Bow", 2},
           [28] = {"staff", 3},
           [29] = {"1Hander", 2},
           [25] = {"staff", 1}};
indexes = {{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1, 1, 1, 1, 1, 1, 1, 1},
            {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1, 1, 1, 1, 1, 1, 1, 1},
            {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1, 1, 1, 1, 1, 1, 1, 1}};

lastGkey = 0;
profile = 1;
lastMacro = 0;

function OnEvent(event, arg)
    if (event=="G_PRESSED" and arg ~=1) then
        -- gets profile number
        profile = GetMKeyState();
        pushKey(arg);
    end

    -- loot key, usefull for moving stuff quick (like 2000 pants)
    if(event=="G_PRESSED" and arg==1) then
        x, y = GetMousePosition();
        PressMouseButton(1);
        Sleep(10);
        MoveMouseTo(26532, 48321);
        Sleep(10);
        ReleaseMouseButton(1);
        Sleep(10);
        MoveMouseTo(x, y);
    end
end

function releaseKey(gkey)
   ReleaseKey(movements[gkey]);
end

function pushKey(gkey)
    -- launch macro if needed
    if(macros[gkey]) then
        macroKey(gkey);
        return;
    end

    if(not keyArray[profile][gkey]) then
        return;
    end

    -- gets key name
    -- we check if the last gkey used was the same, if yes, cycle
    if(lastGkey > 0 and lastGkey == gkey) then
        indexes[profile][gkey] = indexes[profile][gkey] + 1;
        if(indexes[profile][gkey] > table.getn(keyArray[profile][gkey])) then
            indexes[profile][gkey] = 1;
        end
    end
    lastGkey = gkey;
    i = indexes[profile][gkey];
    keyString = keyArray[profile][gkey][i];

    -- we get modifiers to use
    toRCtrl = false;
    toRAlt = false;
    toRShift = false;
    toCtrl = false;
    toAlt = false;
    toShift = false;
    if(string.find(keyString, "rctrl")) then
        toRCtrl = true;
	keyString = string.gsub(keyString, "rctrl", "");
    end

    if(string.find(keyString, "ctrl")) then
        toCtrl = true;
	keyString = string.gsub(keyString, "ctrl", "");
    end

    if(string.find(keyString, "ralt")) then
        toRAlt = true;
    	keyString = string.gsub(keyString, "ralt", "");
    end

    if(string.find(keyString, "alt")) then
        toAlt = true;
	keyString = string.gsub(keyString, "alt", "");
    end

    if(string.find(keyString, "rshift")) then
        toRShift = true;
    	keyString = string.gsub(keyString, "rshift", "");
    end

    if(string.find(keyString, "shift")) then
        toShift = true;
	keyString = string.gsub(keyString, "shift", "");
    end

    -- now, we clean the key string to extract only the key
    keyString = string.gsub(keyString, "\+", "");
    key = string.gsub(keyString, " ", "");

    -- press modifiers
    if toCtrl then
       PressKey("lctrl");
    end
    if toAlt then
        PressKey("lalt");
    end
    if toShift then
        PressKey("lshift");
    end

    if toRCtrl then
       PressKey("rctrl");
    end
    if toRAlt then
        PressKey("ralt");
    end
    if toRShift then
        PressKey("rshift");
    end

    -- press and release key
    PressAndReleaseKey(key);

    -- release modifiers
    if toCtrl then
        ReleaseKey("lctrl");
    end
    if toAlt then
        ReleaseKey("lalt");
    end
    if toShift then
        ReleaseKey("lshift");
    end
    if toRCtrl then
        ReleaseKey("rctrl");
    end
    if toRAlt then
        ReleaseKey("ralt");
    end
    if toRShift then
        ReleaseKey("rshift");
    end
end

-- I have macros set for these keys and some need to change the active profile
function macroKey(key)
    if(lastMacro ~= key) then
        -- Abort old macro
        AbortMacro();
    end
    -- Activate macro
    lastMacro = key;
    PlayMacro(macros[key][1]);
    -- Change profile
    if (profile ~= macros[key][2]) then
        SetMKeyState(macros[key][2]);
        indexes = {{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1, 1, 1, 1, 1, 1, 1, 1},
                    {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1, 1, 1, 1, 1, 1, 1, 1},
                    {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1, 1, 1, 1, 1, 1, 1, 1}};
    end
end
© The KGB Oracle