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 (), 50 guests, and 23 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,356
Members1,477
Most Online276
Aug 3rd, 2023
Top Likes Received (30 Days)
None yet
Top Posters(30 Days)
Popular Topics(Views)
2,034,252 Trump card
1,342,149 Picture Thread
480,195 Romney
Previous Thread
Next Thread
Print Thread
Rate Thread
#60265 03/03/10 05:49 PM
Joined: Apr 2003
Posts: 12,986
Likes: 44
JetStar Offline OP
(GM10) KGB High King
KGB Federal Faction
(F5) High Chancellor
KGB New World Faction
KGB Oracle Administrator
Founded KGB in 1997
****
OP 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
keyArray = {
{ -- Profile 1
[6] = {"ctrl+O", "crtl+P"}
},
{ -- Profile 2
},
{ -- Profile 3
}
};

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}};
lastGkey = 0;
lastMacro = 0;

function OnEvent(event, arg)
if (event=="G_PRESSED" and arg ~=1) then
pushKey(arg);
end
end

function pushKey(gkey)
-- 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


[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: Jan 2009
Posts: 5,070
Likes: 6
KGB (F4) Chancellor
Crowfall Faction
***
Offline
KGB (F4) Chancellor
Crowfall Faction
***
Joined: Jan 2009
Posts: 5,070
Likes: 6
Are you getting a compile error, or is it not running, or are you getting an error script when you run it?

If your getting an error script, screen shot it and paste it in here.

Also I noticed, maybe its because of the paste, but no indentation, no nested "if" with corrisdoponding "EndIf" just "End", and if your trying to complete multiple functions in a boolean string you want to be using "ElseIf" or "Else"

Like conceptually, Do this, if this is done, else then do that, else that is done, then go back to this.


Don't make me have'ta Troll ya Bro!
Joined: Nov 2009
Posts: 1,908
KGB Supreme Knight
***
Offline
KGB Supreme Knight
***
Joined: Nov 2009
Posts: 1,908
Yea Tas it wasn't working however I found he typo'ed on the binding at the top and used "crtl-P" instead of "ctrl+P" however while that fixed the script it still wasn't working..

Jet had an older version of the software too and others had issues with the scripts working on old version so he was updating before I had to leave vent.

Hopefully it worked out and be back ingame/vent soon.



Joined: Apr 2003
Posts: 12,986
Likes: 44
JetStar Offline OP
(GM10) KGB High King
KGB Federal Faction
(F5) High Chancellor
KGB New World Faction
KGB Oracle Administrator
Founded KGB in 1997
****
OP 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
I upgraded and still nothing :-(

HELP


[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

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