123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- # 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 = '<TABLE cellpadding="1" cellspacing="0" width="200"><TR>'
- 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 += '<TD bgcolor="<<$indiktab[''bar_color'']>>" width="<<indiktab[''bar_progress'']>>%"' & !! bar
- $result += ' align="right"><font color ="<<$indiktab[''bar_label'']>>"><<$ARGS[2]>></font> </TD>' & !! label
- $result += '<TD width="<<100 - indiktab[''bar_progress'']>>%"></TD>' & !! background
- ! bgcolor="<<$indiktab[''bar_bg_color'']>>"
- else
- $result += '<TD bgcolor="<<$indiktab[''bar_color'']>>" width="<<indiktab[''bar_progress'']>>%"></TD>' & !! bar
- $result += '<TD width="<<100 - indiktab[''bar_progress'']>>%"' & !! background
- ! bgcolor="<<$indiktab[''bar_bg_color'']>>"
- $result += ' align="left"> <<$ARGS[2]>></TD>' & !! label
- ! <font color ="<<$fcolor>>"></font>
- 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 += '<TD bgcolor="<<$indiktab[''bar_color'']>>" width="<<indiktab[''bar_progress'']>>%"' & !! bar
- $result += ' align="right"><font color ="<<$indiktab[''bar_label'']>>"><<$ARGS[2]>></font> </TD>' & !! label
- $result += '<TD bgcolor="<<$indiktab[''phantom_color'']>>" width="<<indiktab[''bar_phantom'']>>%"></TD>' & !! phantom
- $result += '<TD width="<<100 - indiktab[''bar_phantom''] - indiktab[''bar_progress'']>>%"></TD>' & !! background
- ! bgcolor="<<$indiktab[''bar_bg_color'']>>"
- elseif indiktab['bar_phantom'] > indiktab['label_width']:
- $result += '<TD bgcolor="<<$indiktab[''bar_color'']>>" width="<<indiktab[''bar_progress'']>>%"></TD>' & !! bar
- $result += '<TD bgcolor="<<$indiktab[''phantom_color'']>>" width="<<indiktab[''bar_phantom'']>>%"' & !! phantom
- $result += ' align="left"> <font color ="<<$indiktab[''phantom_label'']>>"><<$ARGS[2]>></font></TD>' & !! label
- $result += '<TD width="<<100 - indiktab[''bar_phantom''] - indiktab[''bar_progress'']>>%"></TD>' & !! background
- ! bgcolor="<<$indiktab[''bar_bg_color'']>>"
- else
- $result += '<TD bgcolor="<<$indiktab[''bar_color'']>>" width="<<indiktab[''bar_progress'']>>%"></TD>' & !! bar
- $result += '<TD bgcolor="<<$indiktab[''phantom_color'']>>" width="<<indiktab[''bar_phantom'']>>%"></TD>' & !! phantom
- $result += '<TD width="<<100 - indiktab[''bar_progress'']>>%"' & !! background
- ! bgcolor="<<$indiktab[''bar_bg_color'']>>"
- $result += ' align="left"> <<$ARGS[2]>></TD>' & !! label
- ! <font color ="<<$fcolor>>"></font>
- end
- end
- $result += '</TR></TABLE>'
- killvar 'indiktab'
- killvar '$indiktab'
- --- indiktab ---------------------------------
|