Any scripts you've made or found? Discuss them here.
 #147687  by Meowster Chief
 
I've just had an idea for the world of keyboard binds. I noticed that I'm quickly running out of space for binds on my keyboard, and was trying to think of a way to combat this issue. Here's an interesting idea, and I'm wondering if this would work at all...

We could make a set of binds (like, two binds maybe) that correspond to different pages of binds.... say Page One is all your social binds. You got amhug, amsit3, amdropsaber and such in there. Then say Page Two is all your other commands. For instance, screenshot, some quick settings, idk.

Possibly it could go down like this...
Page one is accessed by pressing B:
Code: Select all
/bind B "bind O amhug;bind I amdropsaber;bind U amsit3"
Page two is accessed by pressing N:
Code: Select all
/bind N "bind O screenshot;bind I say NO LAMING!!!;bind U kill"
Is this a sweet idea or what? And would this really work, or would we be limited within the quotations to simply binding one-word commands?
 #147689  by Thunderbird
 
Good idea, however hard to work it out, if not impossible I think. JKA console has certain properties that are very hard to modify.
The current solution is to have several .cfg files.
 #147725  by John
 
I find using scripts is more efficient.
For example, this is a model color changing script I made that uses only one key.
Code: Select all
//assighing keys
bind G  "vstr NEXTCOLOR"

//Color changer
seta NEXTCOLOR "vstr COLORRED"
seta COLORRED "amcolor 200 0 0; echo ^1red; set NEXTCOLOR vstr COLORBLUE"
seta COLORBLUE "amcolor 0 0 255; echo ^4blue; set NEXTCOLOR vstr COLORGREEN"
seta COLORGREEN "amcolor 0 200 0; echo ^2green; set NEXTCOLOR vstr COLORYELLOW"
seta COLORYELLOW "amcolor 255 255 0; echo ^3yellow; set NEXTCOLOR vstr COLORCYAN"
seta COLORCYAN "amcolor 0 255 255; echo ^5cyan; set NEXTCOLOR vstr COLORPURPLE"
seta COLORPURPLE "amcolor 100 0 255; echo ^6purple; set NEXTCOLOR vstr COLORBLACK"
seta COLORBLACK "char_color_red 256; char_color_green 0; char_color_blue 0; echo ^0Black; set NEXTCOLOR vstr COLORPINK"
seta COLORPINK "amcolor 255 50 255; echo ^6pink; set NEXTCOLOR vstr COLORORANGE"
seta COLORORANGE "amcolor 255 50 0; echo ^1o^3r^1a^3n^1g^3e; set NEXTCOLOR vstr COLORPEACH"
seta COLORPEACH "amcolor 255 0 50; echo ^7peach; set NEXTCOLOR vstr COLORRED"
And if you like to cycle through options before choosing here's an example for that with telepoints.
Code: Select all
//assighing keys
bind [ "vstr PTele"
bind \ "vstr ITele"
bind ] "vstr NTele"

//duel6 tele cmds
seta Tele1 "echo ^2Overlook1; set ITele amtele 540 286 504 0; set NTele vstr Tele2; set PTele vstr Tele5"
seta Tele2 "echo ^2Overlook2; set ITele amtele -280 -510 499 0; set NTele vstr Tele3; set PTele vstr Tele1"
seta Tele3 "echo ^2Health; set ITele amtele 0 22 1534 0; set NTele vstr Tele4; set PTele vstr Tele2"
seta Tele4 "echo ^2Temple; set ITele amtele -6688 9957 -79327 0; set NTele vstr Tele5; set PTele vstr Tele3"
seta Tele5 "echo ^1Ninja^2Tree; set ITele amtele -883 -304 696 0; set NTele vstr Tele1; set PTele vstr Tele4"

//initialize
set PTele "vstr Tele5"
set ITele "vstr Tele1"
set NTele "vstr Tele2"

echo ^1Duel6
 #147726  by jawfin
 
If you intend to chain commands which take time to execute (like an emote), or are flood protected (like chat), or change the players info (like name, model, saber) you need to put waits between each command.

Also, to help you with this, please look at my Keyboard Mapper application. It is specifically written for mapping the keyboard: -
http://www.knights-reborn.org/forum/vie ... php?t=4590
 #147730  by Mnsomc
 
Why not just use configs? /writeconfig <config name> and /exec <config name> takes care of evereything you said. It even remembers all the settings such as model, name, sensitivity, etc. I have a config for general combat purposes and others for more specific ones like tffa and saying hi to Yama.
 #147733  by Meowster Chief
 
Okay, that color changing script sounds REALLY cool. Also, I was thinking more of switching between bind setups in-game, in one button press. Example: use and emote, then press a button to go to ur admin binds and click the same button as before to warn against lame :P

Kinda like this setup but with more keys involved...
Code: Select all
/bind P amhug
/bind N "bind P say NO LAMING"
/bind B "bind P amhug"
Press P to amhug, but then press N, then P to say 'no laming'. Then press B , then P to amhug again.

I guess kinda like a toggled numlock: depending on if you are in N-key mode or B-key mode, the button P does a different thing.

I also tested ingame and a bound key -can- bind another key. For instance, /bind P "bind P amhello" will work. Pressing P once binds itself to amhello, and pressing it again amhellos.
 #147737  by Falcon
 
If you want to do that why not just make P amhug, N your no laming bind and B can be a free key?

OR

Much like John pointed out, make a script. Something like -
Code: Select all
bind P "vstr NHug"

set NHug "vstr N01"

seta N01 "set NHug vstr N02; amhug"
seta N02 "set NHug vstr N01; Say No laming!"
This way you could even have it notify you in console with echo commands on how to which it's currently bound to.
 #147740  by Meowster Chief
 
The main idea of this would be if you have ALOT of binds... example:
Code: Select all
/bind N "bind O amhiltthrow1;bind I amdropsaber;bind U amhips;bind J screenshot"
/bind B "bind O say NO LAMING;bind I say NO FLAMING;bind U <some other command>;bind J <some other command>"
In this case, the keys O, I, U, and J are in use by some emotes. By sacrificing only two more keys, N and B, we can use the same O, I, U, and J for different commands. This way 6 keys are used instead of 8, and every other command we add is another key saved.

If it still doesn't make sense, I may be missing something or it may just not be all that smart. :P I've probably confused a good share of you.
 #147741  by John
 
Instead you could just make a config or several with the keys binded the way you want and do /bind N exec controls1
 #147748  by jawfin
 
To actually answer your question, how to retask existing keys on the fly, you can look at my toggle crouch here: -
http://www.knights-reborn.org/forum/vie ... php?t=3352
The trick is using cvars to hold the assignments, and use vstr to execute those to retask. Another example is my skip blue here: -
http://www.knights-reborn.org/forum/vie ... php?t=3353

If you have trouble applying that thinking to what you want to do, then say specifically exactly what you want each key to do on each press, and I'll write it for you.