// $Id: timer.cfg,v 1.13j 2006/01/14 12:00:00 aja Exp $ // Bindings: // The variables "__kt_X" indicate the keys you should bind. // __kt_reset - resets the timer, if you make a mistake entering a time. // __kt_spam - tell your teammates the time on the currently selected timer. // __kt_nudgeup - increment current item's time by 1. // __kt_nudgedown - you can guess! // __kt_zero/one... - typically these are the the numeric keypad. // Installation: // Put the timer.cfg in your quakeworld/id1 directory, and then place // "exec timer.cfg" in your config somewhere. This will bind all the // keys and set your timers to zero. The script will not be much use unless // you also set "cl_gameclock 1" in your config! // Usage: // At the moment, the timer only records quad, rl, lg, pent, ra and ya times. // To enter a time, first select the item you wish to record: // 1: ra // 2: ya // 4: quad // 6: pent // 7: rl // 8. lg // Then type the time you took the item. As an example, suppose we collect rl // on 47 seconds. Type "7", "4", "7" and the script will report that the next // rl is on 17. // // (these instructions assume you have the standard numeric keypad bindings) // Customisation: // To change your message, the tempalias __kt_spam can be redefined. // Contact: // The author, toekk, can usually be found on QuakeNet IRC, // channel #knockback. // JohnNy_cz, 1.13->1.13j updater - #qw.cz set __kt_reset "kp_del" set __kt_spam "kp_enter" set __kt_nudgeup "kp_plus" set __kt_nudgedown "kp_minus" set __kt_zero "kp_0" set __kt_one "kp_1" set __kt_two "kp_2" set __kt_three "kp_3" set __kt_four "kp_4" set __kt_five "kp_5" set __kt_six "kp_6" set __kt_seven "kp_7" set __kt_eight "kp_8" set __kt_nine "kp_9" set __t_quad "00" set __t_rl "00" set __t_lg "00" set __t_pent "00" set __t_ra "00" set __t_ya "00" set __t_tens 0 set __t_units 0 set __t_item 0 set __t_tmp 0 // Save the temporary time __t_tmp into the correct item's time tempalias _t_save "if $qt,$__t_item,$qt isin $qt,quad,rl,lg,pent,ya,ra,$qt then set __t_$__t_item $__t_tmp" // Load the selected item's time into the temporary time __t_tmp tempalias _t_load "if $qt,$__t_item,$qt isin $qt,quad,rl,lg,pent,ya,ra,$qt then _t_load$__t_item" tempalias _t_loadquad "set __t_tmp $__t_quad" tempalias _t_loadrl "set __t_tmp $__t_rl" tempalias _t_loadlg "set __t_tmp $__t_lg" tempalias _t_loadpent "set __t_tmp $__t_pent" tempalias _t_loadra "set __t_tmp $__t_ra" tempalias _t_loadya "set __t_tmp $__t_ya" // Show the current time as an echo tempalias _t_echo "echo $__t_item on $__t_tmp" // Spam the current time tempalias _t_spam "say_team $\$tpname $__t_item on $__t_tmp; _t_bindselect" // Panic button to stop setting a time if you make a mistake tempalias _t_reset "bf; echo reset - selection mode; _t_bindselect" // Select item to set/report it's time tempalias _ts_ya "echo ya selected; _t_save; set __t_item $tp_name_ya; _t_load; _t_bindtens;" tempalias _ts_ra "echo ra selected; _t_save; set __t_item $tp_name_ra; _t_load; _t_bindtens;" tempalias _ts_quad "echo quad selected; _t_save; set __t_item $tp_name_quad; _t_load; _t_bindtens" tempalias _ts_rl "echo rl selected; _t_save; set __t_item $tp_name_rl; _t_load; _t_bindtens" tempalias _ts_lg "echo lg selected; _t_save; set __t_item $tp_name_lg; _t_load; _t_bindtens" tempalias _ts_pent "echo pent selected; _t_save; set __t_item $tp_name_pent; _t_load; _t_bindtens" // Bind all the keys to item selection tempalias _t_bindselect "unbind $__kt_zero; bind $__kt_one _ts_ra; bind $__kt_two _ts_ya; unbind $__kt_three; bind $__kt_four _ts_quad; bind $__kt_five _ts_pent; unbind $__kt_six; bind $__kt_seven _ts_rl; bind $__kt_eight _ts_lg; unbind $__kt_nine;" // Bind all the keys to unit selection tempalias _t_bindunits "bind $__kt_zero _tu_zero; bind $__kt_one _tu_one; bind $__kt_two _tu_two; bind $__kt_three _tu_three; bind $__kt_four _tu_four; bind $__kt_five _tu_five; bind $__kt_six _tu_six; bind $__kt_seven _tu_seven; bind $__kt_eight _tu_eight; bind $__kt_nine _tu_nine" // Bind keys to tens selection tempalias _t_bindtens "bind $__kt_zero _tt_zero; bind $__kt_one _tt_one; bind $__kt_two _tt_two; bind $__kt_three _tt_three; bind $__kt_four _tt_four; bind $__kt_five _tt_five; unbind $__kt_six; unbind $__kt_seven; unbind $__kt_eight; unbind $__kt_nine" // Take a weapon, this adds 30 seconds // this works for any gameclock settings the same - JohnNy_cz tempalias _t_weapon "inc __t_tmp 30; if $__t_tmp >= 60 then inc __t_tmp -60; _t_pad" // Take an armour, this adds 20 seconds // tempalias _t_armour "if $cl_gameclock == 1 _t_armour_cw else if $cl_gameclock == 3 _t_armour_cw else _t_armour_ccw" tempalias _t_armour_cw "inc __t_tmp 20; if $__t_tmp >= 60 then inc __t_tmp -60; _t_pad" tempalias _t_armour_ccw "inc __t_tmp -20; if $__t_tmp < 0 then inc __t_tmp 60; _t_pad" // // Pad with leading zeros tempalias _t_pad "if $__t_tmp < 10 then set __t_tmp 0$__t_tmp" // Set the time tempalias _t_settime "set __t_tmp $qt$__t_tens$__t_units$qt; if $__t_item == $tp_name_rl then _t_weapon else if $__t_item == $tp_name_lg then _t_weapon else if $qt,$__t_item,$qt isin $qt,$tp_name_ra,$tp_name_ya,$qt then _t_armour" tempalias _t_nudgeup "inc __t_tmp; if $__t_tmp >= 60 then inc __t_tmp -60; _t_pad; _t_echo" tempalias _t_nudgedown "inc __t_tmp -1; if $__t_tmp < 0 then inc __t_tmp 60; _t_pad; _t_echo" // Units tempalias _tu_zero "set __t_units 0; _t_settime; _t_spam; _t_bindselect" tempalias _tu_one "set __t_units 1; _t_settime; _t_spam; _t_bindselect" tempalias _tu_two "set __t_units 2; _t_settime; _t_spam; _t_bindselect" tempalias _tu_three "set __t_units 3; _t_settime; _t_spam; _t_bindselect" tempalias _tu_four "set __t_units 4; _t_settime; _t_spam; _t_bindselect" tempalias _tu_five "set __t_units 5; _t_settime; _t_spam; _t_bindselect" tempalias _tu_six "set __t_units 6; _t_settime; _t_spam; _t_bindselect" tempalias _tu_seven "set __t_units 7; _t_settime; _t_spam; _t_bindselect" tempalias _tu_eight "set __t_units 8; _t_settime; _t_spam; _t_bindselect" tempalias _tu_nine "set __t_units 9; _t_settime; _t_spam; _t_bindselect" // Tens tempalias _tt_zero "echo 0...; set __t_tens 0; _t_bindunits" tempalias _tt_one "echo 1...; set __t_tens 1; _t_bindunits" tempalias _tt_two "echo 2...; set __t_tens 2; _t_bindunits" tempalias _tt_three "echo 3...; set __t_tens 3; _t_bindunits" tempalias _tt_four "echo 4...; set __t_tens 4; _t_bindunits" tempalias _tt_five "echo 5...; set __t_tens 5; _t_bindunits" // Setup _t_bindselect bind $__kt_reset "_t_reset" bind $__kt_spam "_t_spam" bind $__kt_nudgeup "_t_nudgeup" bind $__kt_nudgedown "_t_nudgedown"