# indiktab ! ARGS[0] ... color !! color palette selector ! ARGS[1] ... percentage !! scales the bar from 0 to 100 ! ARGS[2] ... real value !! the value displayed on the bar ! ARGS[3] ... phantom !! ghost value, used for painkillers if $ARGS[2] = '': $ARGS[2] = str(ARGS[2]) indiktab['bar_progress'] = min(max(ARGS[1], 0), 100) if Enable_statfsize > 0: indiktab['label_width'] = len($ARGS[2]) * Enable_statfsize*2 else indiktab['label_width'] = len($ARGS[2]) * fsize/2 end if ARGS[3] > 0: indiktab['bar_phantom'] = min(max(ARGS[3] - indiktab['bar_progress'], 0), 100 - indiktab['bar_progress']) !{if Enable_Android = 1: $indiktab['bar_bg_color'] = 'gray' else} ! $indiktab['bar_bg_color'] = $bcolor ! end if ARGS[0] = 1: !{ if Enable_Android = 1: if indiktab['bar_progress'] >= 65: $indiktab['bar_color'] = 'green' elseif indiktab['bar_progress'] >= 35: $indiktab['bar_color'] = 'blue' $indiktab['phantom_color'] = '#00007F' else $indiktab['bar_color'] = 'red' end else} if indiktab['bar_progress'] >= 85: $indiktab['bar_color'] = '#008000' $indiktab['phantom_color'] = '#003F00' $indiktab['bar_label'] = '#FFFFFF' $indiktab['phantom_label'] = '#FFFFFF' elseif indiktab['bar_progress'] >= 70: $indiktab['bar_color'] = '#b3b300' $indiktab['phantom_color'] = '#595900' $indiktab['bar_label'] = '#000000' $indiktab['phantom_label'] = '#FFFFFF' elseif indiktab['bar_progress'] >= 50: $indiktab['bar_color'] = '#00CED1' $indiktab['phantom_color'] = '#006666' $indiktab['bar_label'] = '#000000' $indiktab['phantom_label'] = '#FFFFFF' elseif indiktab['bar_progress'] >= 20: $indiktab['bar_color'] = '#0000ff' $indiktab['phantom_color'] = '#00007F' $indiktab['bar_label'] = '#FFFFFF' $indiktab['phantom_label'] = '#FFFFFF' elseif indiktab['bar_progress'] >= 10: $indiktab['bar_color'] = '#ff6600' $indiktab['phantom_color'] = '#7F3300' $indiktab['bar_label'] = '#000000' $indiktab['phantom_label'] = '#FFFFFF' else $indiktab['bar_color'] = '#ff0000' $indiktab['phantom_color'] = '#7F0000' $indiktab['bar_label'] = '#000000' $indiktab['phantom_label'] = '#FFFFFF' end ! end elseif ARGS[0] = 2: !{ if Enable_Android = 1: if indiktab['bar_progress'] >= 85: $indiktab['bar_color'] = 'red' elseif indiktab['bar_progress'] >= 65: $indiktab['bar_color'] = 'orange' elseif indiktab['bar_progress'] >= 45: $indiktab['bar_color'] = 'yellow' elseif indiktab['bar_progress'] >= 25: $indiktab['bar_color'] = 'green' else $indiktab['bar_color'] = 'blue' end else} if indiktab['bar_progress'] >= 90: $indiktab['bar_color'] = '#ff0000' $indiktab['phantom_color'] = '#7F0000' $indiktab['bar_label'] = '#000000' $indiktab['phantom_label'] = '#FFFFFF' elseif indiktab['bar_progress'] >= 80: $indiktab['bar_color'] = '#ff1a1a' $indiktab['phantom_color'] = '#7F0E0E' $indiktab['bar_label'] = '#000000' $indiktab['phantom_label'] = '#FFFFFF' elseif indiktab['bar_progress'] >= 70: $indiktab['bar_color'] = '#ff3333' $indiktab['phantom_color'] = '#7F1919' $indiktab['bar_label'] = '#000000' $indiktab['phantom_label'] = '#FFFFFF' elseif indiktab['bar_progress'] >= 60: $indiktab['bar_color'] = '#ff4d4d' $indiktab['phantom_color'] = '#7F2727' $indiktab['bar_label'] = '#000000' $indiktab['phantom_label'] = '#FFFFFF' elseif indiktab['bar_progress'] >= 50: $indiktab['bar_color'] = '#ff6666' $indiktab['phantom_color'] = '#7F3333' $indiktab['bar_label'] = '#000000' $indiktab['phantom_label'] = '#FFFFFF' elseif indiktab['bar_progress'] >= 40: $indiktab['bar_color'] = '#ff8080' $indiktab['phantom_color'] = '#7F4141' $indiktab['bar_label'] = '#000000' $indiktab['phantom_label'] = '#FFFFFF' elseif indiktab['bar_progress'] >= 30: $indiktab['bar_color'] = '#e68080' $indiktab['phantom_color'] = '#724040' $indiktab['bar_label'] = '#000000' $indiktab['phantom_label'] = '#FFFFFF' elseif indiktab['bar_progress'] >= 20: $indiktab['bar_color'] = '#cc8080' $indiktab['phantom_color'] = '#664040' $indiktab['bar_label'] = '#000000' $indiktab['phantom_label'] = '#FFFFFF' elseif indiktab['bar_progress'] >= 10: $indiktab['bar_color'] = '#b38080' $indiktab['phantom_color'] = '#594040' $indiktab['bar_label'] = '#000000' $indiktab['phantom_label'] = '#FFFFFF' else $indiktab['bar_color'] = '#998080' $indiktab['phantom_color'] = '#4C4040' $indiktab['bar_label'] = '#000000' $indiktab['phantom_label'] = '#FFFFFF' end ! end elseif ARGS[0] = 3: if indiktab['bar_progress'] >= 20: $indiktab['bar_color'] = '#0000ff' $indiktab['phantom_color'] = '#00007F' $indiktab['bar_label'] = '#FFFFFF' $indiktab['phantom_label'] = '#FFFFFF' else $indiktab['bar_color'] = '#0000ff' $indiktab['phantom_color'] = '#00007F' $indiktab['bar_label'] = '#000000' $indiktab['phantom_label'] = '#FFFFFF' end end $result = '' if indiktab['bar_progress'] >= ARGS[3]: ! if indiktab['bar_progress'] = 100: $indiktab['bar_bg_color'] = $indiktab['bar_color'] if indiktab['bar_progress'] > indiktab['label_width']: $result += '' & !! label $result += '' & !! background ! bgcolor="<<$indiktab[''bar_bg_color'']>>" else $result += '' & !! bar $result += '' & !! label $result += '' & !! phantom $result += '' & !! background ! bgcolor="<<$indiktab[''bar_bg_color'']>>" elseif indiktab['bar_phantom'] > indiktab['label_width']: $result += '' & !! bar $result += '' & !! label $result += '' & !! background ! bgcolor="<<$indiktab[''bar_bg_color'']>>" else $result += '' & !! bar $result += '' & !! phantom $result += '
>"><<$ARGS[2]>>  end else ! if indiktab['bar_progress'] + indiktab['bar_phantom'] = 100: $indiktab['bar_bg_color'] = $indiktab['phantom_color'] if indiktab['bar_progress'] > indiktab['label_width']: $result += '>"><<$ARGS[2]>> >"><<$ARGS[2]>> end end $result += '
' killvar 'indiktab' killvar '$indiktab' --- indiktab ---------------------------------