bubblehash Posted February 19, 2020 Posted February 19, 2020 Hey dudes. I've stolen enough of your config that I thought I'd share a script I threw together to generate my utility config file. The main point was to automate the generation of increment/decrement/cycle script vars. It's currently python2 because that's what I happened to have installed on my desktop at home, so sorry for any linux dudes out there on distros that make it hard to sideload py2 next to py3. *For anyone curious, the main reason this won't plug into py3 is because of their terrible decision to turn "print" into a function instead of the keyword/expression it's been literally forever...I'm pretty sure that one decision is why py2 will never die. def printupdown(echo, prefix, cvar, val, inc, num, default, nextbind, prevbind, mult=None): print '\n//%s script' % echo.lower() bindstr = 'set next%s "vstr %s%d"\nset prev%s "vstr %s%d"\nbind %s "vstr next%s"\nbind %s "vstr prev%s"' for i in range(0, num + 1): if val == default: bindstr = bindstr % (prefix, prefix, i + 1, prefix, prefix, i - 1 if i != 0 else num, nextbind, prefix, prevbind, prefix) if mult: print 'set %s%d "set %s %0.2f; echo ^3%s %0.2f^7; set next%s vstr %s%d; set prev%s vstr %s%d"' % (prefix, i, cvar, val * mult, echo, val * mult, prefix, prefix, i + 1, prefix, prefix, i - 1 if i != 0 else num) else: print 'set %s%d "set %s %d; echo ^3%s %d^7; set next%s vstr %s%d; set prev%s vstr %s%d"' % (prefix, i, cvar, val, echo, val, prefix, prefix, i + 1, prefix, prefix, i - 1 if i != 0 else num) val = val + inc print bindstr if mult: print '\nset %s "%0.2f"' % (cvar, default * mult) else: print '\nset %s "%d"' % (cvar, default) def printcycle(echo, prefix, cvar, val, inc, num, default, nextbind, mult=None): print '\n//%s script' % echo.lower() bindstr = 'set next%s "vstr %s%d"\nbind %s "vstr next%s"' for i in range(0, num + 1): if val == default: bindstr = bindstr % (prefix, prefix, 0 if i == num else i + 1, nextbind, prefix) if mult: print 'set %s%d "set %s %0.2f; echo ^3%s %0.2f^7; set next%s vstr %s%d"' % (prefix, i, cvar, val * mult, echo, val * mult, prefix, prefix, 0 if i == num else i + 1) else: print 'set %s%d "set %s %d; echo ^3%s %d^7; set next%s vstr %s%d"' % (prefix, i, cvar, val, echo, val, prefix, prefix, 0 if i == num else i + 1) val = val + inc print bindstr if __name__ == '__main__': print '//helper utils' printupdown('Sensitivity', 'sens', 'sensitivity', 5, 5, 39, 90, 'PGUP', 'PGDN', 0.01) printupdown('Gamma', 'gamma', 'r_gamma', 100, 5, 20, 150, 'KP_RIGHTARROW', 'KP_5', 0.01) printupdown('Crosshair size', 'crosshrsize', 'cg_crosshairsize', 10, 1, 30, 28, 'p', 'o') printupdown('FOV', 'fovopt', 'cg_fov', 90, 5, 8, 120, 'KP_PGUP', 'KP_UPARROW') printcycle('FPS', 'fpssel', 'com_maxfps', 76, 49, 1, 125, 'KP_LEFTARROW') print ''' set crosshaircolor0 "set cg_crosshairColor black; set crosshr vstr crosshaircolor1" set crosshaircolor1 "set cg_crosshairColor red; set crosshr vstr crosshaircolor2" set crosshaircolor2 "set cg_crosshairColor green; set crosshr vstr crosshaircolor3" set crosshaircolor3 "set cg_crosshairColor yellow; set crosshr vstr crosshaircolor4" set crosshaircolor4 "set cg_crosshairColor blue; set crosshr vstr crosshaircolor5" set crosshaircolor5 "set cg_crosshairColor cyan; set crosshr vstr crosshaircolor6" set crosshaircolor6 "set cg_crosshairColor magenta; set crosshr vstr crosshaircolor7" set crosshaircolor7 "set cg_crosshairColor white; set crosshr vstr crosshaircolor8" set crosshaircolor8 "set cg_crosshairColor orange; set crosshr vstr crosshaircolor0" set crosshr "vstr crosshaircolor0" bind [ "vstr crosshr" set cg_crosshairColor "cyan" set crosshairaltcolor0 "set cg_crosshairColorAlt black; set crosshralt vstr crosshairaltcolor1" set crosshairaltcolor1 "set cg_crosshairColorAlt red; set crosshralt vstr crosshairaltcolor2" set crosshairaltcolor2 "set cg_crosshairColorAlt green; set crosshralt vstr crosshairaltcolor3" set crosshairaltcolor3 "set cg_crosshairColorAlt yellow; set crosshralt vstr crosshairaltcolor4" set crosshairaltcolor4 "set cg_crosshairColorAlt blue; set crosshralt vstr crosshairaltcolor5" set crosshairaltcolor5 "set cg_crosshairColorAlt cyan; set crosshralt vstr crosshairaltcolor6" set crosshairaltcolor6 "set cg_crosshairColorAlt magenta; set crosshralt vstr crosshairaltcolor7" set crosshairaltcolor7 "set cg_crosshairColorAlt white; set crosshralt vstr crosshairaltcolor8" set crosshairaltcolor8 "set cg_crosshairColorAlt orange; set crosshralt vstr crosshairaltcolor0" set crosshralt "vstr crosshairaltcolor0" bind ] "vstr crosshralt" set cg_crosshairColorAlt "magenta" ''' Sorry to any fellow programmers. It's messy and dense, but I cheaped out and didn't pay myself to care. It just prints to the console, but it's a small set of changes if you want it to write to a file (more than happy if someone wants to try and needs help). If you have it open in "IDLE" (the editor that comes with python), you just need to press F5 to run it and get the output. The main functions that do all the work are "printupdown" and "printcycle". The whole "mult" thing is because it got easier to do something stupid than reliably compare floats (who the f invents an unstable number...it's a fing number...). I basically use integers for comparison and generating the range of values but output based on a multiplier you pass in. This works great in that it works, but it means you have to do the integer to decimal conversion in your head while you're providing parameter values...still easier than comparing floats. def printupdown(echo, prefix, cvar, val, inc, num, default, nextbind, prevbind, mult=None): This function generates the script vars for moving up and down a set of values with 2 bound keys. I use this one for sensitivity, crosshair size, and FOV in the screenshot above. The only reason r_gamma wasn't in there was because I didn't think about it until literally right now. I've been typing it into the console to fit the map like an idiot. It's included in the code above and output below along with sensible limits for the other settings. echo The resulting config script echoes all of the value changes. This is what you want the setting called in the echo. prefix Prefix for your generated variables. Helps keep the config file looking cleaner with all the lines that get generated. cvar ET setting you want to change. val Starting value. inc How much do you want to change the setting with each key press. num How many options you want. default What you want the setting to be by default. The script will also make sure the next/prev variables are set correctly so you're already in the right spot of your settings list when you start changing the value. nextbind Key to bind for the next value in the list. Will loop around to the start of the list. prevbind Key to bind for the previous value in the list. Will loop around to the end of the list. mult=None What decimal all of the potential setting values will be multiplied by before being output. Providing a value for mult will force the output values to be treated as floats and rounded to 2 decimal places. Calling the functions: printupdown('Sensitivity', 'sens', 'sensitivity', 5, 5, 39, 90, 'PGUP', 'PGDN', 0.01) printupdown('Gamma', 'gamma', 'r_gamma', 100, 5, 20, 150, 'KP_RIGHTARROW', 'KP_5', 0.01) printupdown('Crosshair size', 'crosshrsize', 'cg_crosshairsize', 10, 1, 30, 28, 'p', 'o') printupdown('FOV', 'fovopt', 'cg_fov', 90, 5, 8, 120, 'KP_PGUP', 'KP_UPARROW') Output: //sensitivity script set sens0 "set sensitivity 0.05; echo ^3Sensitivity 0.05^7; set nextsens vstr sens1; set prevsens vstr sens39" set sens1 "set sensitivity 0.10; echo ^3Sensitivity 0.10^7; set nextsens vstr sens2; set prevsens vstr sens0" set sens2 "set sensitivity 0.15; echo ^3Sensitivity 0.15^7; set nextsens vstr sens3; set prevsens vstr sens1" set sens3 "set sensitivity 0.20; echo ^3Sensitivity 0.20^7; set nextsens vstr sens4; set prevsens vstr sens2" set sens4 "set sensitivity 0.25; echo ^3Sensitivity 0.25^7; set nextsens vstr sens5; set prevsens vstr sens3" set sens5 "set sensitivity 0.30; echo ^3Sensitivity 0.30^7; set nextsens vstr sens6; set prevsens vstr sens4" set sens6 "set sensitivity 0.35; echo ^3Sensitivity 0.35^7; set nextsens vstr sens7; set prevsens vstr sens5" set sens7 "set sensitivity 0.40; echo ^3Sensitivity 0.40^7; set nextsens vstr sens8; set prevsens vstr sens6" set sens8 "set sensitivity 0.45; echo ^3Sensitivity 0.45^7; set nextsens vstr sens9; set prevsens vstr sens7" set sens9 "set sensitivity 0.50; echo ^3Sensitivity 0.50^7; set nextsens vstr sens10; set prevsens vstr sens8" set sens10 "set sensitivity 0.55; echo ^3Sensitivity 0.55^7; set nextsens vstr sens11; set prevsens vstr sens9" set sens11 "set sensitivity 0.60; echo ^3Sensitivity 0.60^7; set nextsens vstr sens12; set prevsens vstr sens10" set sens12 "set sensitivity 0.65; echo ^3Sensitivity 0.65^7; set nextsens vstr sens13; set prevsens vstr sens11" set sens13 "set sensitivity 0.70; echo ^3Sensitivity 0.70^7; set nextsens vstr sens14; set prevsens vstr sens12" set sens14 "set sensitivity 0.75; echo ^3Sensitivity 0.75^7; set nextsens vstr sens15; set prevsens vstr sens13" set sens15 "set sensitivity 0.80; echo ^3Sensitivity 0.80^7; set nextsens vstr sens16; set prevsens vstr sens14" set sens16 "set sensitivity 0.85; echo ^3Sensitivity 0.85^7; set nextsens vstr sens17; set prevsens vstr sens15" set sens17 "set sensitivity 0.90; echo ^3Sensitivity 0.90^7; set nextsens vstr sens18; set prevsens vstr sens16" set sens18 "set sensitivity 0.95; echo ^3Sensitivity 0.95^7; set nextsens vstr sens19; set prevsens vstr sens17" set sens19 "set sensitivity 1.00; echo ^3Sensitivity 1.00^7; set nextsens vstr sens20; set prevsens vstr sens18" set sens20 "set sensitivity 1.05; echo ^3Sensitivity 1.05^7; set nextsens vstr sens21; set prevsens vstr sens19" set sens21 "set sensitivity 1.10; echo ^3Sensitivity 1.10^7; set nextsens vstr sens22; set prevsens vstr sens20" set sens22 "set sensitivity 1.15; echo ^3Sensitivity 1.15^7; set nextsens vstr sens23; set prevsens vstr sens21" set sens23 "set sensitivity 1.20; echo ^3Sensitivity 1.20^7; set nextsens vstr sens24; set prevsens vstr sens22" set sens24 "set sensitivity 1.25; echo ^3Sensitivity 1.25^7; set nextsens vstr sens25; set prevsens vstr sens23" set sens25 "set sensitivity 1.30; echo ^3Sensitivity 1.30^7; set nextsens vstr sens26; set prevsens vstr sens24" set sens26 "set sensitivity 1.35; echo ^3Sensitivity 1.35^7; set nextsens vstr sens27; set prevsens vstr sens25" set sens27 "set sensitivity 1.40; echo ^3Sensitivity 1.40^7; set nextsens vstr sens28; set prevsens vstr sens26" set sens28 "set sensitivity 1.45; echo ^3Sensitivity 1.45^7; set nextsens vstr sens29; set prevsens vstr sens27" set sens29 "set sensitivity 1.50; echo ^3Sensitivity 1.50^7; set nextsens vstr sens30; set prevsens vstr sens28" set sens30 "set sensitivity 1.55; echo ^3Sensitivity 1.55^7; set nextsens vstr sens31; set prevsens vstr sens29" set sens31 "set sensitivity 1.60; echo ^3Sensitivity 1.60^7; set nextsens vstr sens32; set prevsens vstr sens30" set sens32 "set sensitivity 1.65; echo ^3Sensitivity 1.65^7; set nextsens vstr sens33; set prevsens vstr sens31" set sens33 "set sensitivity 1.70; echo ^3Sensitivity 1.70^7; set nextsens vstr sens34; set prevsens vstr sens32" set sens34 "set sensitivity 1.75; echo ^3Sensitivity 1.75^7; set nextsens vstr sens35; set prevsens vstr sens33" set sens35 "set sensitivity 1.80; echo ^3Sensitivity 1.80^7; set nextsens vstr sens36; set prevsens vstr sens34" set sens36 "set sensitivity 1.85; echo ^3Sensitivity 1.85^7; set nextsens vstr sens37; set prevsens vstr sens35" set sens37 "set sensitivity 1.90; echo ^3Sensitivity 1.90^7; set nextsens vstr sens38; set prevsens vstr sens36" set sens38 "set sensitivity 1.95; echo ^3Sensitivity 1.95^7; set nextsens vstr sens39; set prevsens vstr sens37" set sens39 "set sensitivity 2.00; echo ^3Sensitivity 2.00^7; set nextsens vstr sens40; set prevsens vstr sens38" set nextsens "vstr sens18" set prevsens "vstr sens16" bind PGUP "vstr nextsens" bind PGDN "vstr prevsens" set sensitivity "0.90" //gamma script set gamma0 "set r_gamma 1.00; echo ^3Gamma 1.00^7; set nextgamma vstr gamma1; set prevgamma vstr gamma20" set gamma1 "set r_gamma 1.05; echo ^3Gamma 1.05^7; set nextgamma vstr gamma2; set prevgamma vstr gamma0" set gamma2 "set r_gamma 1.10; echo ^3Gamma 1.10^7; set nextgamma vstr gamma3; set prevgamma vstr gamma1" set gamma3 "set r_gamma 1.15; echo ^3Gamma 1.15^7; set nextgamma vstr gamma4; set prevgamma vstr gamma2" set gamma4 "set r_gamma 1.20; echo ^3Gamma 1.20^7; set nextgamma vstr gamma5; set prevgamma vstr gamma3" set gamma5 "set r_gamma 1.25; echo ^3Gamma 1.25^7; set nextgamma vstr gamma6; set prevgamma vstr gamma4" set gamma6 "set r_gamma 1.30; echo ^3Gamma 1.30^7; set nextgamma vstr gamma7; set prevgamma vstr gamma5" set gamma7 "set r_gamma 1.35; echo ^3Gamma 1.35^7; set nextgamma vstr gamma8; set prevgamma vstr gamma6" set gamma8 "set r_gamma 1.40; echo ^3Gamma 1.40^7; set nextgamma vstr gamma9; set prevgamma vstr gamma7" set gamma9 "set r_gamma 1.45; echo ^3Gamma 1.45^7; set nextgamma vstr gamma10; set prevgamma vstr gamma8" set gamma10 "set r_gamma 1.50; echo ^3Gamma 1.50^7; set nextgamma vstr gamma11; set prevgamma vstr gamma9" set gamma11 "set r_gamma 1.55; echo ^3Gamma 1.55^7; set nextgamma vstr gamma12; set prevgamma vstr gamma10" set gamma12 "set r_gamma 1.60; echo ^3Gamma 1.60^7; set nextgamma vstr gamma13; set prevgamma vstr gamma11" set gamma13 "set r_gamma 1.65; echo ^3Gamma 1.65^7; set nextgamma vstr gamma14; set prevgamma vstr gamma12" set gamma14 "set r_gamma 1.70; echo ^3Gamma 1.70^7; set nextgamma vstr gamma15; set prevgamma vstr gamma13" set gamma15 "set r_gamma 1.75; echo ^3Gamma 1.75^7; set nextgamma vstr gamma16; set prevgamma vstr gamma14" set gamma16 "set r_gamma 1.80; echo ^3Gamma 1.80^7; set nextgamma vstr gamma17; set prevgamma vstr gamma15" set gamma17 "set r_gamma 1.85; echo ^3Gamma 1.85^7; set nextgamma vstr gamma18; set prevgamma vstr gamma16" set gamma18 "set r_gamma 1.90; echo ^3Gamma 1.90^7; set nextgamma vstr gamma19; set prevgamma vstr gamma17" set gamma19 "set r_gamma 1.95; echo ^3Gamma 1.95^7; set nextgamma vstr gamma20; set prevgamma vstr gamma18" set gamma20 "set r_gamma 2.00; echo ^3Gamma 2.00^7; set nextgamma vstr gamma21; set prevgamma vstr gamma19" set nextgamma "vstr gamma11" set prevgamma "vstr gamma9" bind KP_RIGHTARROW "vstr nextgamma" bind KP_5 "vstr prevgamma" set r_gamma "1.50" //crosshair size script set crosshrsize0 "set cg_crosshairsize 10; echo ^3Crosshair size 10^7; set nextcrosshrsize vstr crosshrsize1; set prevcrosshrsize vstr crosshrsize30" set crosshrsize1 "set cg_crosshairsize 11; echo ^3Crosshair size 11^7; set nextcrosshrsize vstr crosshrsize2; set prevcrosshrsize vstr crosshrsize0" set crosshrsize2 "set cg_crosshairsize 12; echo ^3Crosshair size 12^7; set nextcrosshrsize vstr crosshrsize3; set prevcrosshrsize vstr crosshrsize1" set crosshrsize3 "set cg_crosshairsize 13; echo ^3Crosshair size 13^7; set nextcrosshrsize vstr crosshrsize4; set prevcrosshrsize vstr crosshrsize2" set crosshrsize4 "set cg_crosshairsize 14; echo ^3Crosshair size 14^7; set nextcrosshrsize vstr crosshrsize5; set prevcrosshrsize vstr crosshrsize3" set crosshrsize5 "set cg_crosshairsize 15; echo ^3Crosshair size 15^7; set nextcrosshrsize vstr crosshrsize6; set prevcrosshrsize vstr crosshrsize4" set crosshrsize6 "set cg_crosshairsize 16; echo ^3Crosshair size 16^7; set nextcrosshrsize vstr crosshrsize7; set prevcrosshrsize vstr crosshrsize5" set crosshrsize7 "set cg_crosshairsize 17; echo ^3Crosshair size 17^7; set nextcrosshrsize vstr crosshrsize8; set prevcrosshrsize vstr crosshrsize6" set crosshrsize8 "set cg_crosshairsize 18; echo ^3Crosshair size 18^7; set nextcrosshrsize vstr crosshrsize9; set prevcrosshrsize vstr crosshrsize7" set crosshrsize9 "set cg_crosshairsize 19; echo ^3Crosshair size 19^7; set nextcrosshrsize vstr crosshrsize10; set prevcrosshrsize vstr crosshrsize8" set crosshrsize10 "set cg_crosshairsize 20; echo ^3Crosshair size 20^7; set nextcrosshrsize vstr crosshrsize11; set prevcrosshrsize vstr crosshrsize9" set crosshrsize11 "set cg_crosshairsize 21; echo ^3Crosshair size 21^7; set nextcrosshrsize vstr crosshrsize12; set prevcrosshrsize vstr crosshrsize10" set crosshrsize12 "set cg_crosshairsize 22; echo ^3Crosshair size 22^7; set nextcrosshrsize vstr crosshrsize13; set prevcrosshrsize vstr crosshrsize11" set crosshrsize13 "set cg_crosshairsize 23; echo ^3Crosshair size 23^7; set nextcrosshrsize vstr crosshrsize14; set prevcrosshrsize vstr crosshrsize12" set crosshrsize14 "set cg_crosshairsize 24; echo ^3Crosshair size 24^7; set nextcrosshrsize vstr crosshrsize15; set prevcrosshrsize vstr crosshrsize13" set crosshrsize15 "set cg_crosshairsize 25; echo ^3Crosshair size 25^7; set nextcrosshrsize vstr crosshrsize16; set prevcrosshrsize vstr crosshrsize14" set crosshrsize16 "set cg_crosshairsize 26; echo ^3Crosshair size 26^7; set nextcrosshrsize vstr crosshrsize17; set prevcrosshrsize vstr crosshrsize15" set crosshrsize17 "set cg_crosshairsize 27; echo ^3Crosshair size 27^7; set nextcrosshrsize vstr crosshrsize18; set prevcrosshrsize vstr crosshrsize16" set crosshrsize18 "set cg_crosshairsize 28; echo ^3Crosshair size 28^7; set nextcrosshrsize vstr crosshrsize19; set prevcrosshrsize vstr crosshrsize17" set crosshrsize19 "set cg_crosshairsize 29; echo ^3Crosshair size 29^7; set nextcrosshrsize vstr crosshrsize20; set prevcrosshrsize vstr crosshrsize18" set crosshrsize20 "set cg_crosshairsize 30; echo ^3Crosshair size 30^7; set nextcrosshrsize vstr crosshrsize21; set prevcrosshrsize vstr crosshrsize19" set crosshrsize21 "set cg_crosshairsize 31; echo ^3Crosshair size 31^7; set nextcrosshrsize vstr crosshrsize22; set prevcrosshrsize vstr crosshrsize20" set crosshrsize22 "set cg_crosshairsize 32; echo ^3Crosshair size 32^7; set nextcrosshrsize vstr crosshrsize23; set prevcrosshrsize vstr crosshrsize21" set crosshrsize23 "set cg_crosshairsize 33; echo ^3Crosshair size 33^7; set nextcrosshrsize vstr crosshrsize24; set prevcrosshrsize vstr crosshrsize22" set crosshrsize24 "set cg_crosshairsize 34; echo ^3Crosshair size 34^7; set nextcrosshrsize vstr crosshrsize25; set prevcrosshrsize vstr crosshrsize23" set crosshrsize25 "set cg_crosshairsize 35; echo ^3Crosshair size 35^7; set nextcrosshrsize vstr crosshrsize26; set prevcrosshrsize vstr crosshrsize24" set crosshrsize26 "set cg_crosshairsize 36; echo ^3Crosshair size 36^7; set nextcrosshrsize vstr crosshrsize27; set prevcrosshrsize vstr crosshrsize25" set crosshrsize27 "set cg_crosshairsize 37; echo ^3Crosshair size 37^7; set nextcrosshrsize vstr crosshrsize28; set prevcrosshrsize vstr crosshrsize26" set crosshrsize28 "set cg_crosshairsize 38; echo ^3Crosshair size 38^7; set nextcrosshrsize vstr crosshrsize29; set prevcrosshrsize vstr crosshrsize27" set crosshrsize29 "set cg_crosshairsize 39; echo ^3Crosshair size 39^7; set nextcrosshrsize vstr crosshrsize30; set prevcrosshrsize vstr crosshrsize28" set crosshrsize30 "set cg_crosshairsize 40; echo ^3Crosshair size 40^7; set nextcrosshrsize vstr crosshrsize31; set prevcrosshrsize vstr crosshrsize29" set nextcrosshrsize "vstr crosshrsize19" set prevcrosshrsize "vstr crosshrsize17" bind p "vstr nextcrosshrsize" bind o "vstr prevcrosshrsize" set cg_crosshairsize "28" //fov script set fovopt0 "set cg_fov 90; echo ^3FOV 90^7; set nextfovopt vstr fovopt1; set prevfovopt vstr fovopt8" set fovopt1 "set cg_fov 95; echo ^3FOV 95^7; set nextfovopt vstr fovopt2; set prevfovopt vstr fovopt0" set fovopt2 "set cg_fov 100; echo ^3FOV 100^7; set nextfovopt vstr fovopt3; set prevfovopt vstr fovopt1" set fovopt3 "set cg_fov 105; echo ^3FOV 105^7; set nextfovopt vstr fovopt4; set prevfovopt vstr fovopt2" set fovopt4 "set cg_fov 110; echo ^3FOV 110^7; set nextfovopt vstr fovopt5; set prevfovopt vstr fovopt3" set fovopt5 "set cg_fov 115; echo ^3FOV 115^7; set nextfovopt vstr fovopt6; set prevfovopt vstr fovopt4" set fovopt6 "set cg_fov 120; echo ^3FOV 120^7; set nextfovopt vstr fovopt7; set prevfovopt vstr fovopt5" set fovopt7 "set cg_fov 125; echo ^3FOV 125^7; set nextfovopt vstr fovopt8; set prevfovopt vstr fovopt6" set fovopt8 "set cg_fov 130; echo ^3FOV 130^7; set nextfovopt vstr fovopt9; set prevfovopt vstr fovopt7" set nextfovopt "vstr fovopt7" set prevfovopt "vstr fovopt5" bind KP_PGUP "vstr nextfovopt" bind KP_UPARROW "vstr prevfovopt" set cg_fov "120" The next function is a lot simpler in what it does. def printcycle(echo, prefix, cvar, val, inc, num, default, nextbind, mult=None): This function generates the script vars for forward-only through a set of values with 1 bound key and loops around to the start of the list when you hit the end. I had other stuff I used this for, but it had a 'meh' impact on my gameplay so I tossed it to keep my config from getting too cluttered. I shoehorned FPS into this one because it's really nice to be able to flip to 76 on parts of certain maps where the server can't handle the user density combined with smoke/arty/frag-orgies. I usually go from laggy, choppy gameplay to an experience equivalent to bond64. Totally worth it. This function doesn't print the cvar set because I was targeting values I want stable in my autoexec, but it does drop you into the right spot of the value list. The parameters behave the same as they do in printupdown, so I won't rewrite them here. If this was a work email, you bet your ass you'd all be reading through that same bullet list again Calling the function: printcycle('FPS', 'fpssel', 'com_maxfps', 76, 49, 1, 125, 'KP_LEFTARROW') Output: //fps script set fpssel0 "set com_maxfps 76; echo ^3FPS 76^7; set nextfpssel vstr fpssel1" set fpssel1 "set com_maxfps 125; echo ^3FPS 125^7; set nextfpssel vstr fpssel0" set nextfpssel "vstr fpssel0" bind KP_LEFTARROW "vstr nextfpssel" I also have crosshair color changes that didn't fit the functions so I just did them by hand and print them out at the end. Hopefully you're not all asleep and get something useful out of this. I look forward to dying in new and creative ways at your hands on jay1 Full output for science: //helper utils //sensitivity script set sens0 "set sensitivity 0.05; echo ^3Sensitivity 0.05^7; set nextsens vstr sens1; set prevsens vstr sens39" set sens1 "set sensitivity 0.10; echo ^3Sensitivity 0.10^7; set nextsens vstr sens2; set prevsens vstr sens0" set sens2 "set sensitivity 0.15; echo ^3Sensitivity 0.15^7; set nextsens vstr sens3; set prevsens vstr sens1" set sens3 "set sensitivity 0.20; echo ^3Sensitivity 0.20^7; set nextsens vstr sens4; set prevsens vstr sens2" set sens4 "set sensitivity 0.25; echo ^3Sensitivity 0.25^7; set nextsens vstr sens5; set prevsens vstr sens3" set sens5 "set sensitivity 0.30; echo ^3Sensitivity 0.30^7; set nextsens vstr sens6; set prevsens vstr sens4" set sens6 "set sensitivity 0.35; echo ^3Sensitivity 0.35^7; set nextsens vstr sens7; set prevsens vstr sens5" set sens7 "set sensitivity 0.40; echo ^3Sensitivity 0.40^7; set nextsens vstr sens8; set prevsens vstr sens6" set sens8 "set sensitivity 0.45; echo ^3Sensitivity 0.45^7; set nextsens vstr sens9; set prevsens vstr sens7" set sens9 "set sensitivity 0.50; echo ^3Sensitivity 0.50^7; set nextsens vstr sens10; set prevsens vstr sens8" set sens10 "set sensitivity 0.55; echo ^3Sensitivity 0.55^7; set nextsens vstr sens11; set prevsens vstr sens9" set sens11 "set sensitivity 0.60; echo ^3Sensitivity 0.60^7; set nextsens vstr sens12; set prevsens vstr sens10" set sens12 "set sensitivity 0.65; echo ^3Sensitivity 0.65^7; set nextsens vstr sens13; set prevsens vstr sens11" set sens13 "set sensitivity 0.70; echo ^3Sensitivity 0.70^7; set nextsens vstr sens14; set prevsens vstr sens12" set sens14 "set sensitivity 0.75; echo ^3Sensitivity 0.75^7; set nextsens vstr sens15; set prevsens vstr sens13" set sens15 "set sensitivity 0.80; echo ^3Sensitivity 0.80^7; set nextsens vstr sens16; set prevsens vstr sens14" set sens16 "set sensitivity 0.85; echo ^3Sensitivity 0.85^7; set nextsens vstr sens17; set prevsens vstr sens15" set sens17 "set sensitivity 0.90; echo ^3Sensitivity 0.90^7; set nextsens vstr sens18; set prevsens vstr sens16" set sens18 "set sensitivity 0.95; echo ^3Sensitivity 0.95^7; set nextsens vstr sens19; set prevsens vstr sens17" set sens19 "set sensitivity 1.00; echo ^3Sensitivity 1.00^7; set nextsens vstr sens20; set prevsens vstr sens18" set sens20 "set sensitivity 1.05; echo ^3Sensitivity 1.05^7; set nextsens vstr sens21; set prevsens vstr sens19" set sens21 "set sensitivity 1.10; echo ^3Sensitivity 1.10^7; set nextsens vstr sens22; set prevsens vstr sens20" set sens22 "set sensitivity 1.15; echo ^3Sensitivity 1.15^7; set nextsens vstr sens23; set prevsens vstr sens21" set sens23 "set sensitivity 1.20; echo ^3Sensitivity 1.20^7; set nextsens vstr sens24; set prevsens vstr sens22" set sens24 "set sensitivity 1.25; echo ^3Sensitivity 1.25^7; set nextsens vstr sens25; set prevsens vstr sens23" set sens25 "set sensitivity 1.30; echo ^3Sensitivity 1.30^7; set nextsens vstr sens26; set prevsens vstr sens24" set sens26 "set sensitivity 1.35; echo ^3Sensitivity 1.35^7; set nextsens vstr sens27; set prevsens vstr sens25" set sens27 "set sensitivity 1.40; echo ^3Sensitivity 1.40^7; set nextsens vstr sens28; set prevsens vstr sens26" set sens28 "set sensitivity 1.45; echo ^3Sensitivity 1.45^7; set nextsens vstr sens29; set prevsens vstr sens27" set sens29 "set sensitivity 1.50; echo ^3Sensitivity 1.50^7; set nextsens vstr sens30; set prevsens vstr sens28" set sens30 "set sensitivity 1.55; echo ^3Sensitivity 1.55^7; set nextsens vstr sens31; set prevsens vstr sens29" set sens31 "set sensitivity 1.60; echo ^3Sensitivity 1.60^7; set nextsens vstr sens32; set prevsens vstr sens30" set sens32 "set sensitivity 1.65; echo ^3Sensitivity 1.65^7; set nextsens vstr sens33; set prevsens vstr sens31" set sens33 "set sensitivity 1.70; echo ^3Sensitivity 1.70^7; set nextsens vstr sens34; set prevsens vstr sens32" set sens34 "set sensitivity 1.75; echo ^3Sensitivity 1.75^7; set nextsens vstr sens35; set prevsens vstr sens33" set sens35 "set sensitivity 1.80; echo ^3Sensitivity 1.80^7; set nextsens vstr sens36; set prevsens vstr sens34" set sens36 "set sensitivity 1.85; echo ^3Sensitivity 1.85^7; set nextsens vstr sens37; set prevsens vstr sens35" set sens37 "set sensitivity 1.90; echo ^3Sensitivity 1.90^7; set nextsens vstr sens38; set prevsens vstr sens36" set sens38 "set sensitivity 1.95; echo ^3Sensitivity 1.95^7; set nextsens vstr sens39; set prevsens vstr sens37" set sens39 "set sensitivity 2.00; echo ^3Sensitivity 2.00^7; set nextsens vstr sens40; set prevsens vstr sens38" set nextsens "vstr sens18" set prevsens "vstr sens16" bind PGUP "vstr nextsens" bind PGDN "vstr prevsens" set sensitivity "0.90" //gamma script set gamma0 "set r_gamma 1.00; echo ^3Gamma 1.00^7; set nextgamma vstr gamma1; set prevgamma vstr gamma20" set gamma1 "set r_gamma 1.05; echo ^3Gamma 1.05^7; set nextgamma vstr gamma2; set prevgamma vstr gamma0" set gamma2 "set r_gamma 1.10; echo ^3Gamma 1.10^7; set nextgamma vstr gamma3; set prevgamma vstr gamma1" set gamma3 "set r_gamma 1.15; echo ^3Gamma 1.15^7; set nextgamma vstr gamma4; set prevgamma vstr gamma2" set gamma4 "set r_gamma 1.20; echo ^3Gamma 1.20^7; set nextgamma vstr gamma5; set prevgamma vstr gamma3" set gamma5 "set r_gamma 1.25; echo ^3Gamma 1.25^7; set nextgamma vstr gamma6; set prevgamma vstr gamma4" set gamma6 "set r_gamma 1.30; echo ^3Gamma 1.30^7; set nextgamma vstr gamma7; set prevgamma vstr gamma5" set gamma7 "set r_gamma 1.35; echo ^3Gamma 1.35^7; set nextgamma vstr gamma8; set prevgamma vstr gamma6" set gamma8 "set r_gamma 1.40; echo ^3Gamma 1.40^7; set nextgamma vstr gamma9; set prevgamma vstr gamma7" set gamma9 "set r_gamma 1.45; echo ^3Gamma 1.45^7; set nextgamma vstr gamma10; set prevgamma vstr gamma8" set gamma10 "set r_gamma 1.50; echo ^3Gamma 1.50^7; set nextgamma vstr gamma11; set prevgamma vstr gamma9" set gamma11 "set r_gamma 1.55; echo ^3Gamma 1.55^7; set nextgamma vstr gamma12; set prevgamma vstr gamma10" set gamma12 "set r_gamma 1.60; echo ^3Gamma 1.60^7; set nextgamma vstr gamma13; set prevgamma vstr gamma11" set gamma13 "set r_gamma 1.65; echo ^3Gamma 1.65^7; set nextgamma vstr gamma14; set prevgamma vstr gamma12" set gamma14 "set r_gamma 1.70; echo ^3Gamma 1.70^7; set nextgamma vstr gamma15; set prevgamma vstr gamma13" set gamma15 "set r_gamma 1.75; echo ^3Gamma 1.75^7; set nextgamma vstr gamma16; set prevgamma vstr gamma14" set gamma16 "set r_gamma 1.80; echo ^3Gamma 1.80^7; set nextgamma vstr gamma17; set prevgamma vstr gamma15" set gamma17 "set r_gamma 1.85; echo ^3Gamma 1.85^7; set nextgamma vstr gamma18; set prevgamma vstr gamma16" set gamma18 "set r_gamma 1.90; echo ^3Gamma 1.90^7; set nextgamma vstr gamma19; set prevgamma vstr gamma17" set gamma19 "set r_gamma 1.95; echo ^3Gamma 1.95^7; set nextgamma vstr gamma20; set prevgamma vstr gamma18" set gamma20 "set r_gamma 2.00; echo ^3Gamma 2.00^7; set nextgamma vstr gamma21; set prevgamma vstr gamma19" set nextgamma "vstr gamma11" set prevgamma "vstr gamma9" bind KP_RIGHTARROW "vstr nextgamma" bind KP_5 "vstr prevgamma" set r_gamma "1.50" //crosshair size script set crosshrsize0 "set cg_crosshairsize 10; echo ^3Crosshair size 10^7; set nextcrosshrsize vstr crosshrsize1; set prevcrosshrsize vstr crosshrsize30" set crosshrsize1 "set cg_crosshairsize 11; echo ^3Crosshair size 11^7; set nextcrosshrsize vstr crosshrsize2; set prevcrosshrsize vstr crosshrsize0" set crosshrsize2 "set cg_crosshairsize 12; echo ^3Crosshair size 12^7; set nextcrosshrsize vstr crosshrsize3; set prevcrosshrsize vstr crosshrsize1" set crosshrsize3 "set cg_crosshairsize 13; echo ^3Crosshair size 13^7; set nextcrosshrsize vstr crosshrsize4; set prevcrosshrsize vstr crosshrsize2" set crosshrsize4 "set cg_crosshairsize 14; echo ^3Crosshair size 14^7; set nextcrosshrsize vstr crosshrsize5; set prevcrosshrsize vstr crosshrsize3" set crosshrsize5 "set cg_crosshairsize 15; echo ^3Crosshair size 15^7; set nextcrosshrsize vstr crosshrsize6; set prevcrosshrsize vstr crosshrsize4" set crosshrsize6 "set cg_crosshairsize 16; echo ^3Crosshair size 16^7; set nextcrosshrsize vstr crosshrsize7; set prevcrosshrsize vstr crosshrsize5" set crosshrsize7 "set cg_crosshairsize 17; echo ^3Crosshair size 17^7; set nextcrosshrsize vstr crosshrsize8; set prevcrosshrsize vstr crosshrsize6" set crosshrsize8 "set cg_crosshairsize 18; echo ^3Crosshair size 18^7; set nextcrosshrsize vstr crosshrsize9; set prevcrosshrsize vstr crosshrsize7" set crosshrsize9 "set cg_crosshairsize 19; echo ^3Crosshair size 19^7; set nextcrosshrsize vstr crosshrsize10; set prevcrosshrsize vstr crosshrsize8" set crosshrsize10 "set cg_crosshairsize 20; echo ^3Crosshair size 20^7; set nextcrosshrsize vstr crosshrsize11; set prevcrosshrsize vstr crosshrsize9" set crosshrsize11 "set cg_crosshairsize 21; echo ^3Crosshair size 21^7; set nextcrosshrsize vstr crosshrsize12; set prevcrosshrsize vstr crosshrsize10" set crosshrsize12 "set cg_crosshairsize 22; echo ^3Crosshair size 22^7; set nextcrosshrsize vstr crosshrsize13; set prevcrosshrsize vstr crosshrsize11" set crosshrsize13 "set cg_crosshairsize 23; echo ^3Crosshair size 23^7; set nextcrosshrsize vstr crosshrsize14; set prevcrosshrsize vstr crosshrsize12" set crosshrsize14 "set cg_crosshairsize 24; echo ^3Crosshair size 24^7; set nextcrosshrsize vstr crosshrsize15; set prevcrosshrsize vstr crosshrsize13" set crosshrsize15 "set cg_crosshairsize 25; echo ^3Crosshair size 25^7; set nextcrosshrsize vstr crosshrsize16; set prevcrosshrsize vstr crosshrsize14" set crosshrsize16 "set cg_crosshairsize 26; echo ^3Crosshair size 26^7; set nextcrosshrsize vstr crosshrsize17; set prevcrosshrsize vstr crosshrsize15" set crosshrsize17 "set cg_crosshairsize 27; echo ^3Crosshair size 27^7; set nextcrosshrsize vstr crosshrsize18; set prevcrosshrsize vstr crosshrsize16" set crosshrsize18 "set cg_crosshairsize 28; echo ^3Crosshair size 28^7; set nextcrosshrsize vstr crosshrsize19; set prevcrosshrsize vstr crosshrsize17" set crosshrsize19 "set cg_crosshairsize 29; echo ^3Crosshair size 29^7; set nextcrosshrsize vstr crosshrsize20; set prevcrosshrsize vstr crosshrsize18" set crosshrsize20 "set cg_crosshairsize 30; echo ^3Crosshair size 30^7; set nextcrosshrsize vstr crosshrsize21; set prevcrosshrsize vstr crosshrsize19" set crosshrsize21 "set cg_crosshairsize 31; echo ^3Crosshair size 31^7; set nextcrosshrsize vstr crosshrsize22; set prevcrosshrsize vstr crosshrsize20" set crosshrsize22 "set cg_crosshairsize 32; echo ^3Crosshair size 32^7; set nextcrosshrsize vstr crosshrsize23; set prevcrosshrsize vstr crosshrsize21" set crosshrsize23 "set cg_crosshairsize 33; echo ^3Crosshair size 33^7; set nextcrosshrsize vstr crosshrsize24; set prevcrosshrsize vstr crosshrsize22" set crosshrsize24 "set cg_crosshairsize 34; echo ^3Crosshair size 34^7; set nextcrosshrsize vstr crosshrsize25; set prevcrosshrsize vstr crosshrsize23" set crosshrsize25 "set cg_crosshairsize 35; echo ^3Crosshair size 35^7; set nextcrosshrsize vstr crosshrsize26; set prevcrosshrsize vstr crosshrsize24" set crosshrsize26 "set cg_crosshairsize 36; echo ^3Crosshair size 36^7; set nextcrosshrsize vstr crosshrsize27; set prevcrosshrsize vstr crosshrsize25" set crosshrsize27 "set cg_crosshairsize 37; echo ^3Crosshair size 37^7; set nextcrosshrsize vstr crosshrsize28; set prevcrosshrsize vstr crosshrsize26" set crosshrsize28 "set cg_crosshairsize 38; echo ^3Crosshair size 38^7; set nextcrosshrsize vstr crosshrsize29; set prevcrosshrsize vstr crosshrsize27" set crosshrsize29 "set cg_crosshairsize 39; echo ^3Crosshair size 39^7; set nextcrosshrsize vstr crosshrsize30; set prevcrosshrsize vstr crosshrsize28" set crosshrsize30 "set cg_crosshairsize 40; echo ^3Crosshair size 40^7; set nextcrosshrsize vstr crosshrsize31; set prevcrosshrsize vstr crosshrsize29" set nextcrosshrsize "vstr crosshrsize19" set prevcrosshrsize "vstr crosshrsize17" bind p "vstr nextcrosshrsize" bind o "vstr prevcrosshrsize" set cg_crosshairsize "28" //fov script set fovopt0 "set cg_fov 90; echo ^3FOV 90^7; set nextfovopt vstr fovopt1; set prevfovopt vstr fovopt8" set fovopt1 "set cg_fov 95; echo ^3FOV 95^7; set nextfovopt vstr fovopt2; set prevfovopt vstr fovopt0" set fovopt2 "set cg_fov 100; echo ^3FOV 100^7; set nextfovopt vstr fovopt3; set prevfovopt vstr fovopt1" set fovopt3 "set cg_fov 105; echo ^3FOV 105^7; set nextfovopt vstr fovopt4; set prevfovopt vstr fovopt2" set fovopt4 "set cg_fov 110; echo ^3FOV 110^7; set nextfovopt vstr fovopt5; set prevfovopt vstr fovopt3" set fovopt5 "set cg_fov 115; echo ^3FOV 115^7; set nextfovopt vstr fovopt6; set prevfovopt vstr fovopt4" set fovopt6 "set cg_fov 120; echo ^3FOV 120^7; set nextfovopt vstr fovopt7; set prevfovopt vstr fovopt5" set fovopt7 "set cg_fov 125; echo ^3FOV 125^7; set nextfovopt vstr fovopt8; set prevfovopt vstr fovopt6" set fovopt8 "set cg_fov 130; echo ^3FOV 130^7; set nextfovopt vstr fovopt9; set prevfovopt vstr fovopt7" set nextfovopt "vstr fovopt7" set prevfovopt "vstr fovopt5" bind KP_PGUP "vstr nextfovopt" bind KP_UPARROW "vstr prevfovopt" set cg_fov "120" //fps script set fpssel0 "set com_maxfps 76; echo ^3FPS 76^7; set nextfpssel vstr fpssel1" set fpssel1 "set com_maxfps 125; echo ^3FPS 125^7; set nextfpssel vstr fpssel0" set nextfpssel "vstr fpssel0" bind KP_LEFTARROW "vstr nextfpssel" set crosshaircolor0 "set cg_crosshairColor black; set crosshr vstr crosshaircolor1" set crosshaircolor1 "set cg_crosshairColor red; set crosshr vstr crosshaircolor2" set crosshaircolor2 "set cg_crosshairColor green; set crosshr vstr crosshaircolor3" set crosshaircolor3 "set cg_crosshairColor yellow; set crosshr vstr crosshaircolor4" set crosshaircolor4 "set cg_crosshairColor blue; set crosshr vstr crosshaircolor5" set crosshaircolor5 "set cg_crosshairColor cyan; set crosshr vstr crosshaircolor6" set crosshaircolor6 "set cg_crosshairColor magenta; set crosshr vstr crosshaircolor7" set crosshaircolor7 "set cg_crosshairColor white; set crosshr vstr crosshaircolor8" set crosshaircolor8 "set cg_crosshairColor orange; set crosshr vstr crosshaircolor0" set crosshr "vstr crosshaircolor0" bind [ "vstr crosshr" set cg_crosshairColor "cyan" set crosshairaltcolor0 "set cg_crosshairColorAlt black; set crosshralt vstr crosshairaltcolor1" set crosshairaltcolor1 "set cg_crosshairColorAlt red; set crosshralt vstr crosshairaltcolor2" set crosshairaltcolor2 "set cg_crosshairColorAlt green; set crosshralt vstr crosshairaltcolor3" set crosshairaltcolor3 "set cg_crosshairColorAlt yellow; set crosshralt vstr crosshairaltcolor4" set crosshairaltcolor4 "set cg_crosshairColorAlt blue; set crosshralt vstr crosshairaltcolor5" set crosshairaltcolor5 "set cg_crosshairColorAlt cyan; set crosshralt vstr crosshairaltcolor6" set crosshairaltcolor6 "set cg_crosshairColorAlt magenta; set crosshralt vstr crosshairaltcolor7" set crosshairaltcolor7 "set cg_crosshairColorAlt white; set crosshralt vstr crosshairaltcolor8" set crosshairaltcolor8 "set cg_crosshairColorAlt orange; set crosshralt vstr crosshairaltcolor0" set crosshralt "vstr crosshairaltcolor0" bind ] "vstr crosshralt" set cg_crosshairColorAlt "magenta" Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.