The KGB Oracle
Serving the online gaming community since 1997
Visit www.the-kgb.com
For additional information

Join KGB DISCORD: http://discord.gg/KGB
 
KGB Information
Untitled 1

Visit KGB HQ
www.the-kgb.com

Who's Online Now
0 members (), 26 guests, and 26 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Today's Birthdays
There are no members with birthdays on this day.
Newest Members
Luckystrikes, Shingen, BillNyeCommieSpy, Lamp, AllenGlines
1,477 Registered Users
Forum Statistics
Forums53
Topics13,095
Posts116,357
Members1,477
Most Online276
Aug 3rd, 2023
Top Likes Received (30 Days)
None yet
Top Posters(30 Days)
Sini 1
Popular Topics(Views)
2,051,082 Trump card
1,346,923 Picture Thread
482,555 Romney
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
#52382 10/23/09 09:22 AM
Joined: Nov 2005
Posts: 1,876
Likes: 10
Arkh Offline OP
KGB Supreme Court Justice
KGB Supreme Knight
****
OP Offline
KGB Supreme Court Justice
KGB Supreme Knight
****
Joined: Nov 2005
Posts: 1,876
Likes: 10
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

Last edited by Arkh; 10/23/09 09:40 AM.

[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]
Arkh #52386 10/23/09 11:26 PM
Joined: Apr 2003
Posts: 12,986
Likes: 44
(GM10) KGB High King
KGB Federal Faction
(F5) High Chancellor
KGB New World Faction
KGB Oracle Administrator
Founded KGB in 1997
****
Offline
(GM10) KGB High King
KGB Federal Faction
(F5) High Chancellor
KGB New World Faction
KGB Oracle Administrator
Founded KGB in 1997
****
Joined: Apr 2003
Posts: 12,986
Likes: 44
Very NICE. I might have to retire my Nostromos.


[Linked Image from w3.the-kgb.com][Linked Image from oracle.the-kgb.com]
Star Citizen Hanger:
RSI Javelin Destroyer, Hull E, RSI Constellation Pheonix, Aegis Dynamics Retaliator, Banu Merchantman
F7A Military Hornet Upgrade, F7C-S Hornet Ghost, F7C-R Hornet Tracker, Origin 325a Fighter
Joined: Mar 2009
Posts: 183
KGB Knight
*****
Offline
KGB Knight
*****
Joined: Mar 2009
Posts: 183
Ya looks great , im finally now putting it together.

Last edited by Bearrok; 10/25/09 03:22 AM.

[Linked Image]
Joined: Mar 2009
Posts: 183
KGB Knight
*****
Offline
KGB Knight
*****
Joined: Mar 2009
Posts: 183
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?

Last edited by Bearrok; 10/25/09 03:53 AM.

[Linked Image]
Joined: Nov 2005
Posts: 1,876
Likes: 10
Arkh Offline OP
KGB Supreme Court Justice
KGB Supreme Knight
****
OP Offline
KGB Supreme Court Justice
KGB Supreme Knight
****
Joined: Nov 2005
Posts: 1,876
Likes: 10
I affect the script only on the cycling and loot keys :

Last edited by Arkh; 10/25/09 04:12 AM.

[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]
Arkh #52409 10/25/09 03:43 PM
Joined: Mar 2009
Posts: 183
KGB Knight
*****
Offline
KGB Knight
*****
Joined: Mar 2009
Posts: 183
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.

Last edited by Bearrok; 10/26/09 12:01 AM.

[Linked Image]
Joined: Nov 2005
Posts: 1,876
Likes: 10
Arkh Offline OP
KGB Supreme Court Justice
KGB Supreme Knight
****
OP Offline
KGB Supreme Court Justice
KGB Supreme Knight
****
Joined: Nov 2005
Posts: 1,876
Likes: 10
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.


[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]
Arkh #52423 10/26/09 10:25 AM
Joined: Nov 2005
Posts: 1,876
Likes: 10
Arkh Offline OP
KGB Supreme Court Justice
KGB Supreme Knight
****
OP Offline
KGB Supreme Court Justice
KGB Supreme Knight
****
Joined: Nov 2005
Posts: 1,876
Likes: 10
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

Last edited by Arkh; 10/26/09 10:46 AM.

[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]
Arkh #53633 11/28/09 05:56 AM
Joined: Nov 2005
Posts: 1,876
Likes: 10
Arkh Offline OP
KGB Supreme Court Justice
KGB Supreme Knight
****
OP Offline
KGB Supreme Court Justice
KGB Supreme Knight
****
Joined: Nov 2005
Posts: 1,876
Likes: 10
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


[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]
Arkh #53705 11/29/09 11:47 AM
Joined: Dec 2005
Posts: 4,115
Likes: 13
(GM5) KGB King
KGB Federal Faction
****
Offline
(GM5) KGB King
KGB Federal Faction
****
Joined: Dec 2005
Posts: 4,115
Likes: 13
I'm going to have to give the loot script a try as well.
Currently do not have that on my G13 layout.


[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]
[Linked Image from the-kgb.com][Linked Image from oracle.the-kgb.com]
Joined: Jun 2009
Posts: 240
Former Member
Offline
Former Member
Joined: Jun 2009
Posts: 240
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!

Joined: Aug 2006
Posts: 3,147
Likes: 14
Former KGB Member
***
Offline
Former KGB Member
***
Joined: Aug 2006
Posts: 3,147
Likes: 14
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.


[Linked Image from nodiatis.com]
Joined: Nov 2005
Posts: 1,876
Likes: 10
Arkh Offline OP
KGB Supreme Court Justice
KGB Supreme Knight
****
OP Offline
KGB Supreme Court Justice
KGB Supreme Knight
****
Joined: Nov 2005
Posts: 1,876
Likes: 10
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 ?


[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]
Arkh #54219 12/07/09 03:24 PM
Joined: Nov 2005
Posts: 1,876
Likes: 10
Arkh Offline OP
KGB Supreme Court Justice
KGB Supreme Knight
****
OP Offline
KGB Supreme Court Justice
KGB Supreme Knight
****
Joined: Nov 2005
Posts: 1,876
Likes: 10
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}};


[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]
Arkh #54223 12/07/09 03:42 PM
S
Squared
Unregistered
Squared
Unregistered
S
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?

#54225 12/07/09 03:54 PM
Joined: Nov 2005
Posts: 1,876
Likes: 10
Arkh Offline OP
KGB Supreme Court Justice
KGB Supreme Knight
****
OP Offline
KGB Supreme Court Justice
KGB Supreme Knight
****
Joined: Nov 2005
Posts: 1,876
Likes: 10
It works with logitech programmable things. I don't know what the nostromo looks like for scripts.


[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]
Arkh #54227 12/07/09 04:38 PM
Joined: Nov 2005
Posts: 1,876
Likes: 10
Arkh Offline OP
KGB Supreme Court Justice
KGB Supreme Knight
****
OP Offline
KGB Supreme Court Justice
KGB Supreme Knight
****
Joined: Nov 2005
Posts: 1,876
Likes: 10
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

Last edited by Arkh; 12/11/09 07:47 PM.

[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]
Arkh #54908 12/15/09 12:12 PM
Joined: Nov 2005
Posts: 1,876
Likes: 10
Arkh Offline OP
KGB Supreme Court Justice
KGB Supreme Knight
****
OP Offline
KGB Supreme Court Justice
KGB Supreme Knight
****
Joined: Nov 2005
Posts: 1,876
Likes: 10
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





[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]
Arkh #55425 12/23/09 08:56 PM
Joined: Jun 2009
Posts: 240
Former Member
Offline
Former Member
Joined: Jun 2009
Posts: 240
I'll have to get you in vent and ask some questions Arkh but it looks to be even better than the last!

S
Squared
Unregistered
Squared
Unregistered
S
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.

#56993 01/12/10 03:00 PM
Joined: Nov 2009
Posts: 1,908
KGB Supreme Knight
***
Offline
KGB Supreme Knight
***
Joined: Nov 2009
Posts: 1,908
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



Joined: Dec 2005
Posts: 4,115
Likes: 13
(GM5) KGB King
KGB Federal Faction
****
Offline
(GM5) KGB King
KGB Federal Faction
****
Joined: Dec 2005
Posts: 4,115
Likes: 13
Gamestop had them last weekend, for delivery only though.
Don't know if they still have them or not.


[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]
[Linked Image from the-kgb.com][Linked Image from oracle.the-kgb.com]
Joined: Nov 2005
Posts: 1,876
Likes: 10
Arkh Offline OP
KGB Supreme Court Justice
KGB Supreme Knight
****
OP Offline
KGB Supreme Court Justice
KGB Supreme Knight
****
Joined: Nov 2005
Posts: 1,876
Likes: 10
Fuck, I should ask some money from Logitech there.


[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]
Arkh #57005 01/12/10 06:42 PM
Joined: Nov 2009
Posts: 1,908
KGB Supreme Knight
***
Offline
KGB Supreme Knight
***
Joined: Nov 2009
Posts: 1,908
Mines all ordered. I use G15 (old full version) now but reaching on the keyboard still.. Hoping this helps laugh



Joined: May 2009
Posts: 784
KGB Knight
***
Offline
KGB Knight
***
Joined: May 2009
Posts: 784
jioned the g13 club

Joined: Jun 2008
Posts: 1,036
KGB Arch Duke
****
Offline
KGB Arch Duke
****
Joined: Jun 2008
Posts: 1,036
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


Arkh #57425 01/19/10 10:42 AM
S
Squared
Unregistered
Squared
Unregistered
S
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.

#57432 01/19/10 11:50 AM
Joined: Nov 2009
Posts: 1,908
KGB Supreme Knight
***
Offline
KGB Supreme Knight
***
Joined: Nov 2009
Posts: 1,908
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



Joined: Aug 2006
Posts: 3,147
Likes: 14
Former KGB Member
***
Offline
Former KGB Member
***
Joined: Aug 2006
Posts: 3,147
Likes: 14
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


[Linked Image from nodiatis.com]
#64199 04/26/10 05:52 PM
Joined: Aug 2006
Posts: 3,147
Likes: 14
Former KGB Member
***
Offline
Former KGB Member
***
Joined: Aug 2006
Posts: 3,147
Likes: 14
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


[Linked Image from nodiatis.com]
Joined: Aug 2006
Posts: 3,147
Likes: 14
Former KGB Member
***
Offline
Former KGB Member
***
Joined: Aug 2006
Posts: 3,147
Likes: 14
Serious Bumpage..lol


[Linked Image from nodiatis.com]
Joined: Nov 2005
Posts: 1,876
Likes: 10
Arkh Offline OP
KGB Supreme Court Justice
KGB Supreme Knight
****
OP Offline
KGB Supreme Court Justice
KGB Supreme Knight
****
Joined: Nov 2005
Posts: 1,876
Likes: 10
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

Last edited by Arkh; 04/27/10 11:18 PM.

[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]
Arkh #64553 04/30/10 08:37 AM
Joined: Aug 2006
Posts: 3,147
Likes: 14
Former KGB Member
***
Offline
Former KGB Member
***
Joined: Aug 2006
Posts: 3,147
Likes: 14
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


[Linked Image from nodiatis.com]
Joined: Nov 2005
Posts: 1,876
Likes: 10
Arkh Offline OP
KGB Supreme Court Justice
KGB Supreme Knight
****
OP Offline
KGB Supreme Court Justice
KGB Supreme Knight
****
Joined: Nov 2005
Posts: 1,876
Likes: 10
All week-end long. And you can bother other script users : Mor, Kray, Ehwol etc.


[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]
Arkh #69702 06/27/10 12:18 PM
Joined: Nov 2005
Posts: 1,876
Likes: 10
Arkh Offline OP
KGB Supreme Court Justice
KGB Supreme Knight
****
OP Offline
KGB Supreme Court Justice
KGB Supreme Knight
****
Joined: Nov 2005
Posts: 1,876
Likes: 10
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


[Linked Image from w3.the-kgb.com][Linked Image from w3.the-kgb.com]
Page 1 of 4 1 2 3 4

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5