;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; A gauge macro ;; by Noose ;; ;; I originally coded this macro to be used with ;; my ticker. This could be used with anything ;; though. ;; ;; usage ;; /gauge - ;; ;; t title ;; c color ;; f colour fill char ;; e empty fill char ;; l gauge length ;; n fraction of.. ;; m ..total amount /def -i gauge = \ /if (!getopts("t:c:f:e:l:n:m:","")) /return 0%;/endif%;\ /let gauge_flength $[trunc(((%opt_n*1.0)/(%opt_m*1.0))*%opt_l)]%;\ /let gauge_tlength %opt_l%;\ /if (gauge_flength>gauge_tlength) /let gauge_flength %gauge_tlength%;/endif%;\ /echo -p $[strcat((test(%opt_t!~"") ? strcat("@{B}", %opt_t, "@{n} ") : " "), "[", "@{BC", %opt_c, "}", strrep(%opt_f, gauge_flength), "@{n}", strrep(%opt_e, gauge_tlength-gauge_flength), "]" )]