mIRC Home    About    Download    Register    News    Help

Print Thread
#3319 24/12/02 10:24 AM
Joined: Dec 2002
Posts: 29
H
Ameglian cow
OP Offline
Ameglian cow
H
Joined: Dec 2002
Posts: 29
progress { window -p +b-b @progress 1 1 200 15 | drawrect -f @progress 1 5 0 0 200 15 | var %p = $round($calc(($$1 / $$2)*100),1) | if ((%p > 100) || (%p < 0)) { %p = 100 } | var %x = 0 | while (%x <= $calc(%p * 2)) { drawline @progress 5 2 %x 0 %x 15 | %x = %x + 2 } | drawtext @progress 0 "terminal" 8 90 2 %p $chr(37) }

#3320 24/12/02 11:15 AM
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
First idea is don't use pipes, that is almost unreadable.

Code:
progress {
  window -p +b-b @progress 1 1 200 15
  drawrect -f @progress 1 5 0 0 200 15
  var %p = $round($calc(($$1 / $$2)*100),1)
  if ((%p &gt; 100) || (%p &lt; 0)) {
    %p = 100
  }
  var %x = 0
  while (%x &lt;= $calc(%p * 2)) {
    drawline @progress 5 2 %x 0 %x 15
    %x = %x + 2
  }
  drawtext @progress 0 "terminal" 8 90 2 %p $chr(37)
}
This looks much better. Now... What did you actually want help with? It all looks okay to me.


Link Copied to Clipboard