mIRC Home    About    Download    Register    News    Help

Print Thread
Bandwidth alias #148239 01/05/06 06:34 PM
Joined: Feb 2006
Posts: 164
V
vexed Offline OP
Vogon poet
OP Offline
Vogon poet
V
Joined: Feb 2006
Posts: 164
I've been using band.dll recently and have a simple alias (like most people) to show the bandwidth up and down, i wanted to spice it up a bit so i'm asking for some help to make it show the following..


currently:

<nick> Down: 234Kb/s Up: 5Kb/s

what i'd like it to show

<nick> Down: 234Kb/s [||||||||--] Up: 5KB/s [||||----] Records, Down: 245Kb/s Up: 31Kb/s

Code:
  
alias band1 { return Down: $_band_dn $+ Kb/s Up: $_band_up $+ Kb/s }
alias band { return $dll($shortfn(system\Dll\band.dll),$1,$2) }
alias _band_up { return $gettok($band(band,_),5,32) }
alias _band_dn { return $gettok($band(band,_),4,32) }  


It'd be great if anyone could help!

Re: Bandwidth alias #148240 02/05/06 05:22 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Code:
alias band1reset { unset %_band_dn.max | unset %_band_up.max }
alias band1new { 
  var %_band_dn = $_band_dn | if (%_band_dn &gt; 0 $+ %_band_dn.max) { set %_band_dn.max %_band_dn }
  var %_band_up = $_band_up | if (%_band_up &gt; 0 $+ %_band_up.max) { set %_band_up.max %_band_up }
  return $+(Down: %_band_dn,Kb/s [,$left($+($str(|,$calc(%_band_dn / %_band_dn.max * 10)),----------),10),] Up: %_band_up,Kb/s [,$left($+($str(|,$calc(%_band_up / %_band_up.max * 10)),----------),10),] Records,$chr(44) Down: %_band_dn.max,Kb/s Up: %_band_up.max,Kb/s)
}
;
alias band1 { return Down: $_band_dn $+ Kb/s Up: $_band_up $+ Kb/s }
alias _band_up { return $gettok($band(band,_),5,32) }
alias _band_dn { return $gettok($band(band,_),4,32) }  
alias band { return $dll($shortfn(system\Dll\band.dll),$1,$2) }


use $band1new or just rename it band1 and use $band1
use /band1reset to kill record values

Re: Bandwidth alias #148241 02/05/06 08:34 AM
Joined: Feb 2006
Posts: 164
V
vexed Offline OP
Vogon poet
OP Offline
Vogon poet
V
Joined: Feb 2006
Posts: 164
Brilliant! Thanks DaveC that's just what i needed. laugh